Class IntentContextInterpreter
java.lang.Object
com.ibm.wala.dalvik.ipa.callgraph.propagation.cfa.IntentContextInterpreter
- All Implemented Interfaces:
CHAContextInterpreter
,RTAContextInterpreter
,SSAContextInterpreter
An
SSAContextInterpreter
that redirects functions that start Android-Components.
The Starter-Functions (listed in IntentStarters) are replaced by a Model that emulates Android Lifecycle based on their Target (Internal, External, ...): A wrapper around the single models is generated dynamically (by the models themselves) to resemble the signature of the replaced function.
Methods are replacement by generating a adapted Intermediate Representation of this function on every occurrence of a call to it.
- Since:
- 2013-10-14
- Author:
- Tobias Blaschke <code@tobiasblaschke.de>
- See Also:
-
Constructor Summary
ConstructorDescriptionIntentContextInterpreter
(IClassHierarchy cha, AnalysisOptions options, IAnalysisCacheView cache) -
Method Summary
Modifier and TypeMethodDescriptionGenerates an adapted IR of the managed functions on each call.int
getNumberOfStatements
(CGNode node) iterateCallSites
(CGNode node) iterateFieldsRead
(CGNode node) iterateFieldsWritten
(CGNode node) iterateNewSites
(CGNode node) boolean
recordFactoryType
(CGNode node, IClass klass) record that the "factory" method of a node should be interpreted to allocate a particular class.boolean
understands
(CGNode node) If the function associated with the node is handled by this class.
-
Constructor Details
-
IntentContextInterpreter
public IntentContextInterpreter(IClassHierarchy cha, AnalysisOptions options, IAnalysisCacheView cache)
-
-
Method Details
-
getIR
Generates an adapted IR of the managed functions on each call.- Specified by:
getIR
in interfaceSSAContextInterpreter
- Parameters:
node
- The function to create the IR of- Returns:
- the IR that models the method context, or null if it's an unmodelled native method
- Throws:
IllegalArgumentException
- on a node of null
-
getIRView
- Specified by:
getIRView
in interfaceSSAContextInterpreter
-
understands
If the function associated with the node is handled by this class.- Specified by:
understands
in interfaceCHAContextInterpreter
- Throws:
IllegalArgumentException
- if the given node is null
-
iterateNewSites
- Specified by:
iterateNewSites
in interfaceCHAContextInterpreter
- Specified by:
iterateNewSites
in interfaceRTAContextInterpreter
- Returns:
- an Iterator of the types that may be allocated by a given method in a given context.
-
iterateCallSites
- Specified by:
iterateCallSites
in interfaceCHAContextInterpreter
- Returns:
- an Iterator of the call statements that may execute in a given method for a given context
-
getCFG
- Specified by:
getCFG
in interfaceSSAContextInterpreter
-
getNumberOfStatements
- Specified by:
getNumberOfStatements
in interfaceSSAContextInterpreter
- Returns:
- the number of the statements in the IR, or -1 if it's an unmodelled native method.
-
getDU
- Specified by:
getDU
in interfaceSSAContextInterpreter
- Returns:
- DefUse for the IR that models the method context, or null if it's an unmodelled native method
-
recordFactoryType
Description copied from interface:RTAContextInterpreter
record that the "factory" method of a node should be interpreted to allocate a particular class.TODO: this is a little ugly, is there a better place to move this?
- Specified by:
recordFactoryType
in interfaceRTAContextInterpreter
- Returns:
- true iff a NEW type was recorded, false if the type was previously recorded.
-
iterateFieldsWritten
- Specified by:
iterateFieldsWritten
in interfaceRTAContextInterpreter
- Returns:
- iterator of FieldReference
-
iterateFieldsRead
- Specified by:
iterateFieldsRead
in interfaceRTAContextInterpreter
- Returns:
- iterator of FieldReference
-