mirror of
https://github.com/skylot/jadx.git
synced 2024-11-23 04:39:46 +00:00
Deprecate class existence check by name
This commit is contained in:
parent
291b898c78
commit
a968de0f76
@ -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<String> getAllClassesNames() {
|
||||
List<Integer> types = dexBuf.typeIds();
|
||||
int size = types.size();
|
||||
List<String> list = new ArrayList<String>(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);
|
||||
}
|
||||
|
@ -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<DexNode> dexNodes;
|
||||
private final List<ClassNode> classes = new ArrayList<ClassNode>();
|
||||
|
||||
private final Set<String> earlyClassList = new HashSet<String>();
|
||||
private final Map<String, ClassNode> names = new HashMap<String, ClassNode>();
|
||||
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user