From a968de0f76f4b490df154d230b366104a26b0cfd Mon Sep 17 00:00:00 2001 From: Skylot Date: Sun, 24 Mar 2013 16:22:23 +0400 Subject: [PATCH] Deprecate class existence check by name --- src/main/java/jadx/dex/nodes/DexNode.java | 13 ------------- src/main/java/jadx/dex/nodes/RootNode.java | 13 +++++-------- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/src/main/java/jadx/dex/nodes/DexNode.java b/src/main/java/jadx/dex/nodes/DexNode.java index 379d3fd6..ed84022b 100644 --- a/src/main/java/jadx/dex/nodes/DexNode.java +++ b/src/main/java/jadx/dex/nodes/DexNode.java @@ -2,7 +2,6 @@ package jadx.dex.nodes; import jadx.dex.info.ClassInfo; import jadx.dex.instructions.args.ArgType; -import jadx.utils.Utils; import jadx.utils.exceptions.DecodeException; import jadx.utils.files.InputFile; @@ -62,18 +61,6 @@ public class DexNode { return ArgType.parse(getString(dexBuf.typeIds().get(index))); } - public List getAllClassesNames() { - List types = dexBuf.typeIds(); - int size = types.size(); - List list = new ArrayList(size); - for (Integer typeId : types) { - String type = getString(typeId); - if (type.length() > 0 && type.charAt(0) == 'L') - list.add(Utils.cleanObjectName(type)); - } - return list; - } - public MethodId getMethodId(int mthIndex) { return dexBuf.methodIds().get(mthIndex); } diff --git a/src/main/java/jadx/dex/nodes/RootNode.java b/src/main/java/jadx/dex/nodes/RootNode.java index 9934b9d7..e6477e4e 100644 --- a/src/main/java/jadx/dex/nodes/RootNode.java +++ b/src/main/java/jadx/dex/nodes/RootNode.java @@ -7,10 +7,8 @@ import jadx.utils.files.InputFile; import java.util.ArrayList; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Set; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -22,8 +20,6 @@ public class RootNode { private List dexNodes; private final List classes = new ArrayList(); - - private final Set earlyClassList = new HashSet(); private final Map names = new HashMap(); public RootNode(JadxArgs args) { @@ -43,9 +39,6 @@ public class RootNode { dexNodes.add(dexNode); } - for (DexNode dexNode : dexNodes) - earlyClassList.addAll(dexNode.getAllClassesNames()); - for (DexNode dexNode : dexNodes) dexNode.loadClasses(this); @@ -83,8 +76,12 @@ public class RootNode { return names.get(fullName); } + /** + * Without full classpath listing this function is useless + */ + @Deprecated public boolean isClassExists(String fullName) { - return earlyClassList.contains(fullName); + return true; } public ClassNode resolveClass(ClassInfo cls) {