mirror of
https://github.com/revanced/smali.git
synced 2025-05-04 08:34:25 +02:00
Fix issue with how the set of interfaces a class implements is calculated
This commit is contained in:
parent
541b934948
commit
a0c24f1c9f
@ -865,6 +865,14 @@ public class ClassPath {
|
||||
}
|
||||
}
|
||||
|
||||
private static void addInterfaceToSet(Set<ClassDef> interfaces, ClassDef iface) {
|
||||
if (interfaces.add(iface)) {
|
||||
for (ClassDef subiface: iface.implementedInterfaces) {
|
||||
addInterfaceToSet(interfaces, subiface);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private TreeSet<ClassDef> loadAllImplementedInterfaces(UnresolvedClassInfo classInfo) {
|
||||
assert classType != null;
|
||||
assert classType.equals("Ljava/lang/Object;") || superclass != null;
|
||||
@ -874,11 +882,10 @@ public class ClassPath {
|
||||
|
||||
if (superclass != null) {
|
||||
for (ClassDef interfaceDef: superclass.implementedInterfaces) {
|
||||
implementedInterfaceSet.add(interfaceDef);
|
||||
addInterfaceToSet(implementedInterfaceSet, interfaceDef);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (classInfo.interfaces != null) {
|
||||
for (String interfaceType: classInfo.interfaces) {
|
||||
ClassDef interfaceDef;
|
||||
@ -889,14 +896,7 @@ public class ClassPath {
|
||||
String.format("Could not find interface %s", interfaceType));
|
||||
}
|
||||
assert interfaceDef.isInterface();
|
||||
implementedInterfaceSet.add(interfaceDef);
|
||||
|
||||
interfaceDef = interfaceDef.getSuperclass();
|
||||
while (!interfaceDef.getClassType().equals("Ljava/lang/Object;")) {
|
||||
assert interfaceDef.isInterface();
|
||||
implementedInterfaceSet.add(interfaceDef);
|
||||
interfaceDef = interfaceDef.getSuperclass();
|
||||
}
|
||||
addInterfaceToSet(implementedInterfaceSet, interfaceDef);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user