Class AppOnlyClinitCallResolver

java.lang.Object
sootup.callgraph.scope.AppOnlyClinitCallResolver
All Implemented Interfaces:
VirtualCallResolver

public class AppOnlyClinitCallResolver extends Object implements VirtualCallResolver
A VirtualCallResolver that drops <clinit> candidates declared on a library class (see SootClass.isLibraryClass()) and delegates every other candidate - including <clinit>s of application classes - to a wrapped VirtualCallResolver (default: VirtualCallResolver.all()).

Paired with seedEntryPointClinits=false on AbstractCallGraphAlgorithm, this is equivalent to Soot/Qilin's classic APP static-initializer handling mode: like ON_THE_FLY, every <clinit> triggered during traversal is modeled as it's discovered, except those belonging to library classes.

  • Constructor Details

    • AppOnlyClinitCallResolver

      public AppOnlyClinitCallResolver(@NonNull View view)
    • AppOnlyClinitCallResolver

      public AppOnlyClinitCallResolver(@NonNull View view, @NonNull VirtualCallResolver delegate)
  • Method Details

    • tryAdvanceCall

      public @NonNull ExplorationVerdict tryAdvanceCall(@NonNull SootMethod caller, @NonNull MethodSignature callee, @NonNull InvokableStmt statement)
      Description copied from interface: VirtualCallResolver
      Decides whether a single already-resolved dynamic-dispatch candidate should be admitted as an edge in the call graph, and whether the callee should be expanded via this edge.

      callee is intentionally a bare MethodSignature, not a resolved SootMethod: most implementations only need identity/name/declaring-class information already present on the signature. Implementations that need method-level metadata (e.g. whether the target is abstract or a library class) should resolve it lazily via their own View reference, the same way DefaultCallResolver already holds one — this avoids forcing a lookup for every dynamic-dispatch candidate when most resolvers don't need one.

      Specified by:
      tryAdvanceCall in interface VirtualCallResolver
      Parameters:
      caller - the caller method
      callee - the resolved dynamic-dispatch candidate's signature
      statement - the invokable statement causing the call
      Returns:
      the verdict for this edge