Class AndroidEntryPointCreator
java.lang.Object
soot.jimple.infoflow.entryPointCreators.BaseEntryPointCreator
soot.jimple.infoflow.android.entryPointCreators.AbstractAndroidEntryPointCreator
soot.jimple.infoflow.android.entryPointCreators.AndroidEntryPointCreator
- All Implemented Interfaces:
IEntryPointCreator
public class AndroidEntryPointCreator
extends AbstractAndroidEntryPointCreator
implements IEntryPointCreator
class which creates a dummy main method with the entry points according to
the Android lifecycles
based on:
http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle
and http://developer.android.com/reference/android/app/Service.html and
http://developer.android.com/reference/android/content/BroadcastReceiver.html#ReceiverLifecycle
and
http://developer.android.com/reference/android/content/BroadcastReceiver.html
and https://developer.android.com/reference/android/app/Fragment.html
- Author:
- Christian, Steven Arzt
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected soot.util.MultiMap<soot.SootClass,soot.SootMethod> Fields inherited from class soot.jimple.infoflow.android.entryPointCreators.AbstractAndroidEntryPointCreator
entryPointUtils, manifestFields inherited from class soot.jimple.infoflow.entryPointCreators.BaseEntryPointCreator
body, conditionCounter, dummyClassName, dummyMethodName, generator, intCounter, localVarsForClasses, mainMethod, overwriteDummyMainMethod, shallowMode, warnOnConstructorLoop -
Constructor Summary
ConstructorsConstructorDescriptionAndroidEntryPointCreator(IManifestHandler manifest, Collection<soot.SootClass> components) Creates a new instance of theAndroidEntryPointCreatorclass and registers a list of classes to be automatically scanned for Android lifecycle methods -
Method Summary
Modifier and TypeMethodDescriptionprotected soot.SootMethodprotected soot.SootFieldcreateField(soot.Type type, String baseName) Collection<soot.SootField>Collection<soot.SootMethod>soot.util.MultiMap<soot.SootClass,soot.SootMethod> Returns the list of callback functions of the Android lifecycle.voidremoveGeneratedMethods(boolean removeClass) Removes all methods that have been generated by this entry point creatorvoidreset()voidsetCallbackFunctions(soot.util.MultiMap<soot.SootClass, soot.SootMethod> callbackFunctions) Sets the list of callback functions to be integrated into the Android lifecyclevoidsetComponents(Collection<soot.SootClass> components) Sets the Android components for which a dummy main method shall be createdvoidsetFragments(soot.util.MultiMap<soot.SootClass, soot.SootClass> fragments) voidsetJavaScriptInterfaces(soot.util.MultiMap<soot.SootMethod, soot.jimple.Stmt> javascriptInterfaceStmts) protected booleanshouldAddLifecycleCall(soot.SootClass clazz) Checks whether a lifecycle call should be added to the given SootClass, designed to be overridden by different implementationsMethods inherited from class soot.jimple.infoflow.android.entryPointCreators.AbstractAndroidEntryPointCreator
createClassInstances, createDummyMain, createPlainMethodCall, searchAndBuildMethod, searchAndBuildMethod, setEntryPointUtilsMethods inherited from class soot.jimple.infoflow.entryPointCreators.BaseEntryPointCreator
acceptClass, buildMethodCall, buildMethodCall, createAdditionalFields, createAdditionalMethods, createEmptyMainMethod, createIfStmt, eliminateSelfLoops, findMethod, generateClassConstructor, generateClassConstructor, generateClassConstructor, getFailedClasses, getFailedMethods, getGeneratedMainMethod, getNonCollidingFieldName, getOrCreateDummyMainClass, getOverwriteDummyMainMethod, getShallowMode, getSimpleDefaultValue, getValueForType, getValueForType, getWarnOnConstructorLoop, isCompatible, isSimpleType, setAllowNonPublicConstructors, setAllowSelfReferences, setDummyClassName, setDummyMethodName, setIgnoreSystemClassParams, setOverwriteDummyMainMethod, setShallowMode, setSubstituteCallParams, setSubstituteClasses, setWarnOnConstructorLoopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface soot.jimple.infoflow.entryPointCreators.IEntryPointCreator
createDummyMain, getGeneratedMainMethod, setSubstituteCallParams, setSubstituteClasses
-
Field Details
-
callbackFunctions
protected soot.util.MultiMap<soot.SootClass,soot.SootMethod> callbackFunctions
-
-
Constructor Details
-
AndroidEntryPointCreator
Creates a new instance of theAndroidEntryPointCreatorclass and registers a list of classes to be automatically scanned for Android lifecycle methods- Parameters:
components- The list of classes to be automatically scanned for Android lifecycle methods
-
-
Method Details
-
createDummyMainInternal
protected soot.SootMethod createDummyMainInternal()- Specified by:
createDummyMainInternalin classBaseEntryPointCreator
-
shouldAddLifecycleCall
protected boolean shouldAddLifecycleCall(soot.SootClass clazz) Checks whether a lifecycle call should be added to the given SootClass, designed to be overridden by different implementations- Parameters:
clazz- the SootClass in question- Returns:
- True if a lifecycle call should be added in
createDummyMainInternal()
-
createField
-
getRequiredClasses
- Specified by:
getRequiredClassesin interfaceIEntryPointCreator
-
setFragments
public void setFragments(soot.util.MultiMap<soot.SootClass, soot.SootClass> fragments) -
getAdditionalMethods
- Specified by:
getAdditionalMethodsin interfaceIEntryPointCreator
-
getAdditionalFields
- Specified by:
getAdditionalFieldsin interfaceIEntryPointCreator
-
getComponentToEntryPointInfo
-
setCallbackFunctions
public void setCallbackFunctions(soot.util.MultiMap<soot.SootClass, soot.SootMethod> callbackFunctions) Sets the list of callback functions to be integrated into the Android lifecycle- Parameters:
callbackFunctions- The list of callback functions to be integrated into the Android lifecycle. This is a mapping from the Android element class (activity, service, etc.) to the list of callback methods for that element.
-
getCallbackFunctions
public soot.util.MultiMap<soot.SootClass,soot.SootMethod> getCallbackFunctions()Returns the list of callback functions of the Android lifecycle.- Returns:
- callbackFunctions The list of callback functions of the Android lifecycle. This is a mapping from the Android element class (activity, service, etc.) to the list of callback methods for that element.
-
reset
public void reset()- Overrides:
resetin classBaseEntryPointCreator
-
setComponents
Sets the Android components for which a dummy main method shall be created- Parameters:
components- The Android components for which a dummy main method shall be created
-
removeGeneratedMethods
public void removeGeneratedMethods(boolean removeClass) Removes all methods that have been generated by this entry point creator- Parameters:
removeClass- True if the generated class shall also be removed. False to only remove the methods, but keep the class
-
setJavaScriptInterfaces
public void setJavaScriptInterfaces(soot.util.MultiMap<soot.SootMethod, soot.jimple.Stmt> javascriptInterfaceStmts)
-