mirror of
https://github.com/revanced/smali.git
synced 2025-05-29 20:20:12 +02:00
Added self (if interface) and super class interfaces to the interface table.
This commit is contained in:
parent
063862d44c
commit
9d8cf0d67c
@ -126,13 +126,14 @@ public class ClassProto implements TypeProto {
|
|||||||
interfaceDef = classPath.getClassDef(interfaceType);
|
interfaceDef = classPath.getClassDef(interfaceType);
|
||||||
interfaces.put(interfaceType, interfaceDef);
|
interfaces.put(interfaceType, interfaceDef);
|
||||||
} catch (UnresolvedClassException ex) {
|
} catch (UnresolvedClassException ex) {
|
||||||
|
interfaces.put(interfaceType, null);
|
||||||
interfacesFullyResolved = false;
|
interfacesFullyResolved = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ClassProto interfaceProto = (ClassProto) classPath.getClass(interfaceType);
|
ClassProto interfaceProto = (ClassProto) classPath.getClass(interfaceType);
|
||||||
for (ClassDef superInterface: interfaceProto.getInterfaces().values()) {
|
for (String superInterface: interfaceProto.getInterfaces().keySet()) {
|
||||||
if (!interfaces.containsKey(superInterface.getType())) {
|
if (!interfaces.containsKey(superInterface)) {
|
||||||
interfaces.put(superInterface.getType(), superInterface);
|
interfaces.put(superInterface, interfaceProto.getInterfaces().get(superInterface));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!interfaceProto.interfacesFullyResolved) {
|
if (!interfaceProto.interfacesFullyResolved) {
|
||||||
@ -144,6 +145,28 @@ public class ClassProto implements TypeProto {
|
|||||||
interfacesFullyResolved = false;
|
interfacesFullyResolved = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// now add self and super class interfaces, required for common super class lookup
|
||||||
|
// we don't really need ClassDef's for that, so let's just use null
|
||||||
|
|
||||||
|
if (isInterface() && !interfaces.containsKey(getType())) {
|
||||||
|
interfaces.put(getType(), null);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
String superclass = getSuperclass();
|
||||||
|
if (superclass != null) {
|
||||||
|
ClassProto superclassProto = (ClassProto) classPath.getClass(superclass);
|
||||||
|
for (String superclassInterface: superclassProto.getInterfaces().keySet()) {
|
||||||
|
if (!interfaces.containsKey(superclassInterface)) {
|
||||||
|
interfaces.put(superclassInterface, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (UnresolvedClassException ex) {
|
||||||
|
// TODO: not sure if this is necessary
|
||||||
|
interfacesFullyResolved = false;
|
||||||
|
}
|
||||||
|
|
||||||
return interfaces;
|
return interfaces;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -529,7 +552,9 @@ public class ClassProto implements TypeProto {
|
|||||||
addToVtable(getClassDef().getVirtualMethods(), virtualMethodList);
|
addToVtable(getClassDef().getVirtualMethods(), virtualMethodList);
|
||||||
|
|
||||||
for (ClassDef interfaceDef: getInterfacesFull().values()) {
|
for (ClassDef interfaceDef: getInterfacesFull().values()) {
|
||||||
addToVtable(interfaceDef.getVirtualMethods(), virtualMethodList);
|
if (interfaceDef != null) {
|
||||||
|
addToVtable(interfaceDef.getVirtualMethods(), virtualMethodList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user