Class AndroidEntryPointUtils
java.lang.Object
soot.jimple.infoflow.android.entryPointCreators.AndroidEntryPointUtils
Class containing common utility methods for dealing with Android entry points
- Author:
- Steven Arzt
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumArray containing all types of components supported in Android lifecycles -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetComponentType(soot.SootClass currentClass) Gets the type of component represented by the given Soot classstatic Collection<? extends soot.MethodOrMethodContext>getLifecycleMethods(AndroidEntryPointUtils.ComponentType componentType, soot.SootClass sc) Gets all lifecycle methods in the given entry point classCollection<? extends soot.MethodOrMethodContext>getLifecycleMethods(soot.SootClass sc) Gets all lifecycle methods in the given entry point classbooleanisApplicationClass(soot.SootClass clazz) Checks whether the given class is derived from android.app.Applicationstatic booleanisCallableFromJS(soot.SootMethod m) Checks whether a method is potentially callable from JavaScriptbooleanisEntryPointMethod(soot.SootMethod method) Checks whether the given method is an Android entry point, i.e., a lifecycle method
-
Constructor Details
-
AndroidEntryPointUtils
public AndroidEntryPointUtils()Creates a new instance of theAndroidEntryPointUtilsclass. Soot must already be running when this constructor is invoked.
-
-
Method Details
-
getComponentType
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
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 typesc- 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
-