mirror of
https://github.com/revanced/smali.git
synced 2025-05-13 20:57:07 +02:00
More elegant way of getting direct interfaces, now using FluentIterable.
This commit is contained in:
parent
4147960f6e
commit
b16caa690d
@ -31,6 +31,8 @@
|
|||||||
|
|
||||||
package org.jf.dexlib2.analysis;
|
package org.jf.dexlib2.analysis;
|
||||||
|
|
||||||
|
import com.google.common.base.Predicate;
|
||||||
|
import com.google.common.collect.FluentIterable;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
@ -173,13 +175,12 @@ public class ClassProto implements TypeProto {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
protected LinkedHashMap<String, ClassDef> getInterfacesFull() {
|
protected Iterable<ClassDef> getDirectInterfaces() {
|
||||||
LinkedHashMap<String, ClassDef> interfaces = getInterfaces();
|
|
||||||
|
|
||||||
if (!interfacesFullyResolved) {
|
if (!interfacesFullyResolved) {
|
||||||
throw new UnresolvedClassException("Interfaces for class %s not fully resolved", getType());
|
throw new UnresolvedClassException("Interfaces for class %s not fully resolved", getType());
|
||||||
}
|
}
|
||||||
return interfaces;
|
|
||||||
|
return FluentIterable.from(getInterfaces().values()).filter(ClassDef.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -553,10 +554,8 @@ public class ClassProto implements TypeProto {
|
|||||||
if (!isInterface()) {
|
if (!isInterface()) {
|
||||||
addToVtable(getClassDef().getVirtualMethods(), virtualMethodList);
|
addToVtable(getClassDef().getVirtualMethods(), virtualMethodList);
|
||||||
|
|
||||||
for (ClassDef interfaceDef: getInterfacesFull().values()) {
|
for (ClassDef interfaceDef: getDirectInterfaces()) {
|
||||||
if (interfaceDef != null) {
|
addToVtable(interfaceDef.getVirtualMethods(), virtualMethodList);
|
||||||
addToVtable(interfaceDef.getVirtualMethods(), virtualMethodList);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user