Class DefaultCallbackAnalyzer
java.lang.Object
soot.jimple.infoflow.android.callbacks.AbstractCallbackAnalyzer
soot.jimple.infoflow.android.callbacks.DefaultCallbackAnalyzer
- All Implemented Interfaces:
IMemoryBoundedSolver
public class DefaultCallbackAnalyzer
extends AbstractCallbackAnalyzer
implements IMemoryBoundedSolver
Default implementation of the callback analyzer class. This implementation
aims for precision. It tries to rule out callbacks registered in unreachable
code. The mapping between components and callbacks is as precise as possible.
- Author:
- Steven Arzt
-
Nested Class Summary
Nested classes/interfaces inherited from interface soot.jimple.infoflow.memory.IMemoryBoundedSolver
IMemoryBoundedSolver.IMemoryBoundedSolverStatusNotification -
Field Summary
Fields inherited from class soot.jimple.infoflow.android.callbacks.AbstractCallbackAnalyzer
androidCallbacks, arrayToContentTypes, callbackFilters, callbackMethods, config, dynamicManifestComponents, entryPointClasses, excludedEntryPoints, fragmentClasses, fragmentClassesRev, fragmentIDs, layoutClasses, logger, scAndroidXFragment, scAndroidXFragmentPagerAdapter, scAndroidXFragmentStatePagerAdapter, scAndroidXFragmentTransaction, scAndroidXViewPager, scBroadcastReceiver, scContext, scFragment, scFragmentPagerAdapter, scFragmentStatePagerAdapter, scFragmentTransaction, scServiceConnection, scSupportFragment, scSupportFragmentTransaction, scSupportViewPager, valueProvider -
Constructor Summary
ConstructorsConstructorDescriptionDefaultCallbackAnalyzer(InfoflowAndroidConfiguration config, Set<soot.SootClass> entryPointClasses) DefaultCallbackAnalyzer(InfoflowAndroidConfiguration config, Set<soot.SootClass> entryPointClasses, soot.util.MultiMap<soot.SootClass, AndroidCallbackDefinition> viewCallbacks, String callbackFile) DefaultCallbackAnalyzer(InfoflowAndroidConfiguration config, Set<soot.SootClass> entryPointClasses, soot.util.MultiMap<soot.SootClass, AndroidCallbackDefinition> viewCallbacks, Set<String> androidCallbacks) -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidcheckAndAddFragment(soot.SootClass componentClass, soot.SootClass fragmentClass) Registers a fragment that belongs to a given componentprotected booleancheckAndAddMethod(soot.SootMethod method, soot.SootMethod parentMethod, soot.SootClass lifecycleClass, AndroidCallbackDefinition.CallbackType callbackType) Checks whether the given Soot method comes from a system class.voidCollects the callback methods for all Android default handlers implemented in the source code.voidexcludeEntryPoint(soot.SootClass entryPoint) Excludes an entry point from all further processing.voidbooleanisKilled()booleanvoidreset()Methods inherited from class soot.jimple.infoflow.android.callbacks.AbstractCallbackAnalyzer
addCallbackFilter, analyzeClassInterfaceCallbacks, analyzeMethodForCallbackRegistrations, analyzeMethodForDynamicBroadcastReceiver, analyzeMethodForFragmentTransaction, analyzeMethodForJavascriptInterfaces, analyzeMethodForServiceConnection, analyzeMethodForViewPagers, analyzeMethodOverrideCallbacks, checkAndAddCallback, getCallbackMethods, getDynamicManifestComponents, getFragmentClasses, getJavaScriptInterfaces, getLayoutClasses, invokesInflate, invokesSetContentView, isExcludedEntryPoint, isInheritedMethod, loadAndroidCallbacks, setValueProvider
-
Constructor Details
-
DefaultCallbackAnalyzer
public DefaultCallbackAnalyzer(InfoflowAndroidConfiguration config, Set<soot.SootClass> entryPointClasses) throws IOException - Throws:
IOException
-
DefaultCallbackAnalyzer
public DefaultCallbackAnalyzer(InfoflowAndroidConfiguration config, Set<soot.SootClass> entryPointClasses, soot.util.MultiMap<soot.SootClass, AndroidCallbackDefinition> viewCallbacks, String callbackFile) throws IOException- Throws:
IOException
-
DefaultCallbackAnalyzer
public DefaultCallbackAnalyzer(InfoflowAndroidConfiguration config, Set<soot.SootClass> entryPointClasses, soot.util.MultiMap<soot.SootClass, AndroidCallbackDefinition> viewCallbacks, Set<String> androidCallbacks) throws IOException- Throws:
IOException
-
-
Method Details
-
collectCallbackMethods
public void collectCallbackMethods()Collects the callback methods for all Android default handlers implemented in the source code. Note that this operation runs inside Soot, so this method only registers a new phase that will be executed when Soot is next run- Overrides:
collectCallbackMethodsin classAbstractCallbackAnalyzer
-
checkAndAddMethod
protected boolean checkAndAddMethod(soot.SootMethod method, soot.SootMethod parentMethod, soot.SootClass lifecycleClass, AndroidCallbackDefinition.CallbackType callbackType) Description copied from class:AbstractCallbackAnalyzerChecks whether the given Soot method comes from a system class. If not, it is added to the list of callback methods.- Overrides:
checkAndAddMethodin classAbstractCallbackAnalyzer- Parameters:
method- The method to check and addparentMethod- The original method in the Android framework that declared the callback. This can, for example, be the method in the interface.lifecycleClass- The base class (activity, service, etc.) to which this callback method belongscallbackType- The type of callback to be registered- Returns:
- True if the method is new, i.e., has not been seen before, otherwise false
-
checkAndAddFragment
protected void checkAndAddFragment(soot.SootClass componentClass, soot.SootClass fragmentClass) Description copied from class:AbstractCallbackAnalyzerRegisters a fragment that belongs to a given component- Overrides:
checkAndAddFragmentin classAbstractCallbackAnalyzer- Parameters:
componentClass- The component (usually an activity) to which the fragment belongsfragmentClass- The fragment class
-
forceTerminate
- Specified by:
forceTerminatein interfaceIMemoryBoundedSolver
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceIMemoryBoundedSolver
-
isKilled
public boolean isKilled()- Specified by:
isKilledin interfaceIMemoryBoundedSolver
-
reset
public void reset()- Specified by:
resetin interfaceIMemoryBoundedSolver
-
addStatusListener
- Specified by:
addStatusListenerin interfaceIMemoryBoundedSolver
-
excludeEntryPoint
public void excludeEntryPoint(soot.SootClass entryPoint) Description copied from class:AbstractCallbackAnalyzerExcludes an entry point from all further processing. No more callbacks will be collected for the given entry point- Overrides:
excludeEntryPointin classAbstractCallbackAnalyzer- Parameters:
entryPoint- The entry point to exclude
-
getTerminationReason
- Specified by:
getTerminationReasonin interfaceIMemoryBoundedSolver
-