0

I can get the superclass of a class by SootClass.getSuperclass(), but I don't know how to get its subclass.

Have I need to load the subclass first? There is no getSubclass() function. Thanks!

2 Answers2

4

You need to use Scene.v().getHierarchy() or Scene.v().getFastHierarchy()

Eric
  • 1,343
  • 1
  • 11
  • 19
1

You cannot simply get "the subclass", because there can be many such classes, subclassing one specific class or implementing a certain interface.

I suppose, you would have to iterate over all classes in the scene and for each such class check if its superclass is the given class/interface.

Randy
  • 36
  • 3