Class 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 Details

    • callbackFunctions

      protected soot.util.MultiMap<soot.SootClass,soot.SootMethod> callbackFunctions
  • Constructor Details

    • AndroidEntryPointCreator

      public AndroidEntryPointCreator(IManifestHandler manifest, Collection<soot.SootClass> components)
      Creates a new instance of the AndroidEntryPointCreator class 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:
      createDummyMainInternal in class BaseEntryPointCreator
    • 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

      protected soot.SootField createField(soot.Type type, String baseName)
    • getRequiredClasses

      public Collection<String> getRequiredClasses()
      Specified by:
      getRequiredClasses in interface IEntryPointCreator
    • setFragments

      public void setFragments(soot.util.MultiMap<soot.SootClass,soot.SootClass> fragments)
    • getAdditionalMethods

      public Collection<soot.SootMethod> getAdditionalMethods()
      Specified by:
      getAdditionalMethods in interface IEntryPointCreator
    • getAdditionalFields

      public Collection<soot.SootField> getAdditionalFields()
      Specified by:
      getAdditionalFields in interface IEntryPointCreator
    • getComponentToEntryPointInfo

      public ComponentEntryPointCollection 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:
      reset in class BaseEntryPointCreator
    • setComponents

      public void setComponents(Collection<soot.SootClass> components)
      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)