@@ -262,16 +262,20 @@ def findSuperclassHierarchy(self) -> List[str]:
262
262
:return: Python list contains all superclass names of this method.
263
263
"""
264
264
265
- parentsHierarchy = list ()
266
- targetClassAnalysis = self .quark .apkinfo .analysis .get_class_analysis (
267
- self .class_name )
265
+ parentsHierarchy = set ()
266
+ hierarchyMap = self .quark .apkinfo .superclass_relationships
268
267
269
- while targetClassAnalysis and "Ljava/lang/Object;" != targetClassAnalysis .extends :
270
- parentsHierarchy .append (targetClassAnalysis .extends )
271
- targetClassAnalysis = self .quark .apkinfo .analysis .get_class_analysis (
272
- targetClassAnalysis .extends )
268
+ queue = [self .innerObj .class_name ]
269
+ while queue :
270
+ targetClass = queue .pop ()
271
+ if targetClass == "Ljava/lang/Object;" :
272
+ continue
273
+
274
+ queue .extend (hierarchyMap [targetClass ])
275
+ parentsHierarchy .update (hierarchyMap [targetClass ])
273
276
274
- return parentsHierarchy
277
+ parentsHierarchy .discard ("Ljava/lang/Object;" )
278
+ return list (parentsHierarchy )
275
279
276
280
@property
277
281
def fullName (self ) -> str :
@@ -713,6 +717,7 @@ def checkMethodCalls(
713
717
for candidate in checkMethods :
714
718
checkMethodSet .update (quark .apkinfo .find_method (* candidate ))
715
719
716
- targetLowerFuncSet = {i for i , _ in quark .apkinfo .lowerfunc (targetMethodSet .pop ())}
720
+ targetLowerFuncSet = {
721
+ i for i , _ in quark .apkinfo .lowerfunc (targetMethodSet .pop ())}
717
722
718
723
return any (checkMethodSet .intersection (targetLowerFuncSet ))
0 commit comments