Commit feeafc40 authored by Skylot's avatar Skylot

core: exclude inner classes from dependencies (#318)

parent ea1c1eb8
......@@ -354,8 +354,7 @@ public class ClassNode extends LineAttrNode implements ILoadable, IDexNode {
if (parentClass == null) {
if (clsInfo.isInner()) {
ClassNode parent = dex().resolveClass(clsInfo.getParentClass());
parent = parent == null ? this : parent;
parentClass = parent;
parentClass = parent == null ? this : parent;
} else {
parentClass = this;
}
......@@ -365,7 +364,7 @@ public class ClassNode extends LineAttrNode implements ILoadable, IDexNode {
public ClassNode getTopParentClass() {
ClassNode parent = getParentClass();
return parent == this ? this : parent.getParentClass();
return parent == this ? this : parent.getTopParentClass();
}
public List<ClassNode> getInnerClasses() {
......
......@@ -30,7 +30,6 @@ public class DependencyCollector extends AbstractVisitor {
processClass(inner, dex, depList);
}
depList.remove(cls);
removeInnerClassesFromDeps(cls, depList);
return false;
}
......@@ -123,11 +122,4 @@ public class DependencyCollector extends AbstractVisitor {
depList.add(clsNode.getTopParentClass());
}
}
private void removeInnerClassesFromDeps(ClassNode cls, Set<ClassNode> depList) {
cls.getInnerClasses().forEach(inner -> {
depList.remove(inner);
removeInnerClassesFromDeps(inner, depList);
});
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment