Class AbstractComponentEntryPointCreator
java.lang.Object
soot.jimple.infoflow.entryPointCreators.BaseEntryPointCreator
soot.jimple.infoflow.android.entryPointCreators.AbstractAndroidEntryPointCreator
soot.jimple.infoflow.android.entryPointCreators.components.AbstractComponentEntryPointCreator
- All Implemented Interfaces:
IEntryPointCreator
- Direct Known Subclasses:
ActivityEntryPointCreator,BroadcastReceiverEntryPointCreator,ContentProviderEntryPointCreator,FragmentEntryPointCreator,ServiceConnectionEntryPointCreator,ServiceEntryPointCreator
Class for generating a dummy main method that represents the lifecycle of a
single component
- Author:
- Steven Arzt
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final soot.SootClassprotected Set<soot.SootMethod>protected final soot.SootClassprotected soot.SootFieldprotected soot.Localprotected soot.LocalFields 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
ConstructorsConstructorDescriptionAbstractComponentEntryPointCreator(soot.SootClass component, soot.SootClass applicationClass, IManifestHandler manifest) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanGenerates invocation statements for all callback methods which need to be invoked during the given class' run cycle.protected booleanaddCallbackMethods(Set<soot.SootClass> referenceClasses, String callbackSignature) Generates invocation statements for all callback methods which need to be invoked during the given class' run cycle.voidassignIntent(soot.SootClass hostComponent, soot.SootMethod method, int indexOfArgs) Method used in instrumentDummyMainMethod() to transfer Intent Code adapted from FlowDroid v2.0.protected voidprotected soot.SootMethodprotected voidprotected voidCreates an implementation of getIntent() that returns the intent from our ICC modelprotected abstract voidGenerates the component-specific portion of the lifecycleCollection<soot.SootField>protected List<soot.Type>Derived classes can overwrite this method to add further parameters to the dummy main methodCollection<soot.SootMethod>Gets the data object that describes the generated entry pointprotected final List<soot.Type>Gets the default parameter types that every component main method shall haveprotected voidTransfer Intent for such components that take an Intent as a parameter and do not leverage getIntent() method for retrieving the received Intent.protected voidreset()voidsetCallbacks(Set<soot.SootMethod> callbacks) Methods 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, createAdditionalMethods, 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, setWarnOnConstructorLoop
-
Field Details
-
component
protected final soot.SootClass component -
applicationClass
protected final soot.SootClass applicationClass -
callbacks
-
thisLocal
protected soot.Local thisLocal -
intentLocal
protected soot.Local intentLocal -
intentField
protected soot.SootField intentField
-
-
Constructor Details
-
AbstractComponentEntryPointCreator
public AbstractComponentEntryPointCreator(soot.SootClass component, soot.SootClass applicationClass, IManifestHandler manifest)
-
-
Method Details
-
setCallbacks
-
createAdditionalFields
protected void createAdditionalFields()- Overrides:
createAdditionalFieldsin classBaseEntryPointCreator
-
createEmptyMainMethod
protected void createEmptyMainMethod()- Overrides:
createEmptyMainMethodin classBaseEntryPointCreator
-
getDefaultMainMethodParams
Gets the default parameter types that every component main method shall have- Returns:
- The default parameter types that all component main methods have in common
-
getAdditionalMainMethodParams
Derived classes can overwrite this method to add further parameters to the dummy main method- Returns:
- A list with the parameter types to be added to the component's dummy main method, or null, if no additional parameters shall be added
-
getRequiredClasses
-
createDummyMainInternal
protected soot.SootMethod createDummyMainInternal()- Specified by:
createDummyMainInternalin classBaseEntryPointCreator
-
instrumentDummyMainMethod
protected void instrumentDummyMainMethod()Transfer Intent for such components that take an Intent as a parameter and do not leverage getIntent() method for retrieving the received Intent. Code adapted from FlowDroid v2.0. -
assignIntent
public void assignIntent(soot.SootClass hostComponent, soot.SootMethod method, int indexOfArgs) Method used in instrumentDummyMainMethod() to transfer Intent Code adapted from FlowDroid v2.0. -
generateComponentLifecycle
protected abstract void generateComponentLifecycle()Generates the component-specific portion of the lifecycle -
getAdditionalMethods
-
getAdditionalFields
-
addCallbackMethods
protected boolean addCallbackMethods()Generates invocation statements for all callback methods which need to be invoked during the given class' run cycle.- Returns:
- True if a matching callback has been found, otherwise false.
-
addCallbackMethods
protected boolean addCallbackMethods(Set<soot.SootClass> referenceClasses, String callbackSignature) Generates invocation statements for all callback methods which need to be invoked during the given class' run cycle.- Parameters:
referenceClasses- The classes for which no new instances shall be created, but rather existing ones shall be used.callbackSignature- An empty string if calls to all callback methods for the given class shall be generated, otherwise the subsignature of the only callback method to generate.- Returns:
- True if a matching callback has been found, otherwise false.
-
reset
protected void reset()- Overrides:
resetin classBaseEntryPointCreator
-
getComponentInfo
Gets the data object that describes the generated entry point- Returns:
- The data object that describes the generated entry point
-
createGetIntentMethod
protected void createGetIntentMethod()Creates an implementation of getIntent() that returns the intent from our ICC model
-