public class AndroidModel extends Object implements IClassHierarchyDweller
Between the calls to the AndroidEntryPoints special behavior is inserted. You can change that behavior by implementing an AbstractAndroidModel or set one of the existing ones in the AnalysisOptions. Additionally care of how types are instantiated is taken. You can change this behavior by setting the IInstanciationBehavior in the AnalysisOptions. Smaller Models exist: * MiniModel calls all components of a specific type (for example all Activities) * MicroModel calls a single specific component * ExternalModel doesn't call anything but fiddles with the data on its own All these Models are added to a synthetic AndroidModelClass.
Modifier and Type | Field and Description |
---|---|
protected VolatileMethodSummary |
body |
protected boolean |
built |
protected AnalysisCache |
cache |
protected IClassHierarchy |
cha |
protected static boolean |
doBoot |
protected IClass |
klass |
protected SummarizedMethod |
model |
MethodReference |
mRef |
protected AnalysisOptions |
options |
protected AnalysisScope |
scope |
Constructor and Description |
---|
AndroidModel(IClassHierarchy cha,
AnalysisOptions options,
AnalysisCache cache) |
Modifier and Type | Method and Description |
---|---|
protected void |
build(Atom name)
Generates the model on a sub-set of Entrypoints.
|
protected void |
build(Atom name,
Collection<? extends AndroidEntryPoint> entrypoints)
Generate the SummarizedMethod for the model (in this.model).
|
IClassHierarchy |
getClassHierarchy() |
IClass |
getDeclaringClass()
The class the Method representing this Model resides in.
|
Descriptor |
getDescriptor() |
SummarizedMethod |
getMethod()
Building the SummarizedMethod is delayed upon the first class to this method.
|
SummarizedMethod |
getMethodAs(MethodReference asMethod,
TypeReference caller,
IntentStarters.StartInfo info,
CGNode callerNd)
Get method of the Model in an other Signature.
|
IMethod |
getMethodEncap()
Creates an "encapsulated" version of the model.
|
Atom |
getName() |
TypeName |
getReturnType() |
boolean |
isStatic() |
protected boolean |
selectEntryPoint(AndroidEntryPoint ep)
Overridden by models to restraint Entrypoints.
|
String |
toString() |
public MethodReference mRef
protected IClassHierarchy cha
protected AnalysisOptions options
protected AnalysisCache cache
protected final AnalysisScope scope
protected VolatileMethodSummary body
protected static boolean doBoot
protected IClass klass
protected boolean built
protected SummarizedMethod model
public AndroidModel(IClassHierarchy cha, AnalysisOptions options, AnalysisCache cache)
protected void build(Atom name) throws CancelException
selectEntryPoint(AndroidEntryPoint)
for each EntryPoint known to the AndroidEntryPointManager,
if the EntryPoint should be included in the model. Then calls #build(Atom, Iterable extends Entrypoint>)
on these.name
- The name the generated method will be known asCancelException
public Atom getName()
public boolean isStatic()
public TypeName getReturnType()
public Descriptor getDescriptor() throws CancelException
CancelException
protected void build(Atom name, Collection<? extends AndroidEntryPoint> entrypoints) throws CancelException
getMethod()
to retrieve the method generated here or getMethodAs to get a version
which is wrapped to another signature.name
- The name the generated method will be known asentrypoints
- The functions to call additionally to boot-code and XXXCancelException
public SummarizedMethod getMethod() throws CancelException
CancelException
public IClass getDeclaringClass()
protected boolean selectEntryPoint(AndroidEntryPoint ep)
ep
- The EntryPoint in questionpublic SummarizedMethod getMethodAs(MethodReference asMethod, TypeReference caller, IntentStarters.StartInfo info, CGNode callerNd) throws CancelException
asMethod
- The signature to generateflags
- Control the behavior of the wrapper, may be nullcaller
- The class of the caller; only needed depending on the flagsinfo
- The IntentSterter usedcallerNd
- CGNoodle of the caller - may be nullCancelException
IntentContextInterpreter
,
IntentStarters
public IMethod getMethodEncap() throws CancelException
CancelException
public IClassHierarchy getClassHierarchy()
getClassHierarchy
in interface IClassHierarchyDweller