Class AndroidEntryPointUtils

java.lang.Object
soot.jimple.infoflow.android.entryPointCreators.AndroidEntryPointUtils

public class AndroidEntryPointUtils extends Object
Class containing common utility methods for dealing with Android entry points
Author:
Steven Arzt
  • Constructor Details

    • AndroidEntryPointUtils

      public AndroidEntryPointUtils()
      Creates a new instance of the AndroidEntryPointUtils class. Soot must already be running when this constructor is invoked.
  • Method Details

    • getComponentType

      public AndroidEntryPointUtils.ComponentType getComponentType(soot.SootClass currentClass)
      Gets the type of component represented by the given Soot class
      Parameters:
      currentClass - The class for which to get the component type
      Returns:
      The component type of the given class
    • isApplicationClass

      public boolean isApplicationClass(soot.SootClass clazz)
      Checks whether the given class is derived from android.app.Application
      Parameters:
      clazz - The class to check
      Returns:
      True if the given class is derived from android.app.Application, otherwise false
    • isEntryPointMethod

      public boolean isEntryPointMethod(soot.SootMethod method)
      Checks whether the given method is an Android entry point, i.e., a lifecycle method
      Parameters:
      method - The method to check
      Returns:
      True if the given method is a lifecycle method, otherwise false
    • getLifecycleMethods

      public Collection<? extends soot.MethodOrMethodContext> getLifecycleMethods(soot.SootClass sc)
      Gets all lifecycle methods in the given entry point class
      Parameters:
      sc - The class in which to look for lifecycle methods
      Returns:
      The set of lifecycle methods in the given class
    • getLifecycleMethods

      public static Collection<? extends soot.MethodOrMethodContext> getLifecycleMethods(AndroidEntryPointUtils.ComponentType componentType, soot.SootClass sc)
      Gets all lifecycle methods in the given entry point class
      Parameters:
      componentType - the component type
      sc - The class in which to look for lifecycle methods
      Returns:
      The set of lifecycle methods in the given class
    • isCallableFromJS

      public static boolean isCallableFromJS(soot.SootMethod m)
      Checks whether a method is potentially callable from JavaScript
      Parameters:
      m - the method
      Returns:
      true if the method is pot. callable from JS