public class Scene
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected ClientAccessibilityOracle |
accessibilityOracle |
protected CallGraph |
activeCallGraph |
protected FastHierarchy |
activeFastHierarchy |
protected Hierarchy |
activeHierarchy |
protected PointsToAnalysis |
activePointsToAnalysis |
protected SideEffectAnalysis |
activeSideEffectAnalysis |
protected ArrayNumberer<SootClass> |
classNumberer |
protected Numberer<Context> |
contextNumberer |
protected java.util.List<SootMethod> |
entryPoints |
protected java.util.LinkedList<java.lang.String> |
excludedPackages |
protected Numberer<SparkField> |
fieldNumberer |
protected ArrayNumberer<Kind> |
kindNumberer |
protected ArrayNumberer<Local> |
localNumberer |
protected ArrayNumberer<SootMethod> |
methodNumberer |
protected ReachableMethods |
reachableMethods |
protected StringNumberer |
subSigNumberer |
protected ArrayNumberer<Type> |
typeNumberer |
protected Numberer<Unit> |
unitNumberer |
Constructor and Description |
---|
Scene(Singletons.Global g) |
Modifier and Type | Method and Description |
---|---|
void |
addBasicClass(java.lang.String name) |
void |
addBasicClass(java.lang.String name,
int level) |
void |
addClass(SootClass c)
Adds the given class to the Scene.
|
protected void |
addClassSilent(SootClass c)
Adds the given class to the Scene.
|
void |
addRefType(RefType type)
Returns the RefType with the given className.
|
boolean |
allowsPhantomRefs() |
boolean |
containsClass(java.lang.String className) |
boolean |
containsField(java.lang.String fieldSignature) |
boolean |
containsMethod(java.lang.String methodSignature) |
boolean |
containsType(java.lang.String className) |
java.lang.String |
defaultClassPath() |
boolean |
doneResolving() |
java.util.Collection<SootClass> |
dynamicClasses() |
void |
extendSootClassPath(java.lang.String newPathElement) |
SootClass |
forceResolve(java.lang.String className,
int level) |
Hierarchy |
getActiveHierarchy()
Retrieves the active hierarchy
|
int |
getAndroidAPIVersion() |
java.lang.String |
getAndroidJarPath(java.lang.String jars,
java.lang.String apk) |
Chain<SootClass> |
getApplicationClasses()
Returns a chain of the application classes in this scene.
|
java.util.Set<java.lang.String> |
getBasicClasses() |
CallGraph |
getCallGraph() |
Chain<SootClass> |
getClasses()
Returns an backed chain of the classes in this manager.
|
java.util.List<SootClass> |
getClasses(int desiredLevel)
Returns the list of SootClasses that have been resolved at least to the level
specified.
|
ArrayNumberer<SootClass> |
getClassNumberer() |
ClientAccessibilityOracle |
getClientAccessibilityOracle()
Retrieves the active client accessibility oracle
|
Numberer<Context> |
getContextNumberer() |
ContextSensitiveCallGraph |
getContextSensitiveCallGraph() |
ThrowAnalysis |
getDefaultThrowAnalysis()
Returns the
ThrowAnalysis to be used by default when constructing
CFGs which include exceptional control flow. |
java.util.List<SootMethod> |
getEntryPoints()
Get the set of entry points that are used to build the call graph.
|
FastHierarchy |
getFastHierarchy()
Retrieves the active fast hierarchy
|
SootField |
getField(java.lang.String fieldSignature) |
Numberer<SparkField> |
getFieldNumberer() |
Chain<SootClass> |
getLibraryClasses()
Returns a chain of the library classes in this scene.
|
ArrayNumberer<Local> |
getLocalNumberer() |
SootClass |
getMainClass() |
SootMethod |
getMainMethod() |
SootMethod |
getMethod(java.lang.String methodSignature) |
ArrayNumberer<SootMethod> |
getMethodNumberer() |
RefType |
getObjectType()
Returns the
RefType for Object . |
RefType |
getOrAddRefType(RefType tp) |
FastHierarchy |
getOrMakeFastHierarchy()
Makes a new fast hierarchy is none is active, and returns the active fast
hierarchy.
|
Chain<SootClass> |
getPhantomClasses()
Returns a chain of the phantom classes in this scene.
|
boolean |
getPhantomRefs() |
java.util.List<java.lang.String> |
getPkgList() |
PointsToAnalysis |
getPointsToAnalysis()
Retrieves the active pointer analysis
|
ReachableMethods |
getReachableMethods() |
RefType |
getRefType(java.lang.String className)
Returns the RefType with the given className.
|
RefType |
getRefTypeUnsafe(java.lang.String className)
Returns the RefType with the given className.
|
java.util.Set<java.lang.String> |
getReservedNames()
Returns a set of tokens which are reserved.
|
SideEffectAnalysis |
getSideEffectAnalysis()
Retrieves the active side-effect analysis
|
SootClass |
getSootClass(java.lang.String className)
Returns the SootClass with the given className.
|
java.lang.String |
getSootClassPath() |
SootClass |
getSootClassUnsafe(java.lang.String className)
Returns the SootClass with the given className.
|
int |
getState() |
StringNumberer |
getSubSigNumberer() |
Type |
getType(java.lang.String arg)
Returns the RefType with the given class name or primitive type.
|
ArrayNumberer<Type> |
getTypeNumberer() |
Numberer<Unit> |
getUnitNumberer() |
SootField |
grabField(java.lang.String fieldSignature) |
SootMethod |
grabMethod(java.lang.String methodSignature) |
boolean |
hasActiveHierarchy() |
boolean |
hasCallGraph() |
boolean |
hasClientAccessibilityOracle() |
boolean |
hasCustomEntryPoints() |
boolean |
hasFastHierarchy() |
boolean |
hasMainClass() |
boolean |
hasPointsToAnalysis() |
boolean |
hasReachableMethods() |
boolean |
hasSideEffectAnalysis() |
void |
incrementalBuildFinished() |
void |
initiateIncrementalBuild() |
CallGraph |
internalMakeCallGraph()
SOOT USERS: DO NOT CALL THIS METHOD!
|
boolean |
isExcluded(SootClass sc) |
boolean |
isIncluded(SootClass sc) |
boolean |
isIncrementalBuild()
This method returns true when in incremental build mode.
|
Numberer<Kind> |
kindNumberer() |
void |
loadBasicClasses()
Load just the set of basic classes soot needs, ignoring those specified on
the command-line.
|
SootClass |
loadClass(java.lang.String className,
int desiredLevel) |
SootClass |
loadClassAndSupport(java.lang.String className)
Loads the given class and all of the required support classes.
|
void |
loadDynamicClasses() |
void |
loadNecessaryClasses()
Load the set of classes that soot needs, including those specified on the
command-line.
|
SootMethodRef |
makeConstructorRef(SootClass declaringClass,
java.util.List<Type> parameterTypes)
Create an unresolved reference to a constructor.
|
SootFieldRef |
makeFieldRef(SootClass declaringClass,
java.lang.String name,
Type type,
boolean isStatic)
Create an unresolved reference to a field.
|
SootMethodRef |
makeMethodRef(SootClass declaringClass,
java.lang.String name,
java.util.List<Type> parameterTypes,
Type returnType,
boolean isStatic)
Create an unresolved reference to a method.
|
SootClass |
makeSootClass(java.lang.String name) |
SootClass |
makeSootClass(java.lang.String name,
int modifiers) |
SootField |
makeSootField(java.lang.String name,
Type type) |
SootField |
makeSootField(java.lang.String name,
Type type,
int modifiers) |
SootMethod |
makeSootMethod(java.lang.String name,
java.util.List<Type> parameterTypes,
Type returnType) |
SootMethod |
makeSootMethod(java.lang.String name,
java.util.List<Type> parameterTypes,
Type returnType,
int modifiers) |
SootMethod |
makeSootMethod(java.lang.String name,
java.util.List<Type> parameterTypes,
Type returnType,
int modifiers,
java.util.List<SootClass> thrownExceptions) |
protected void |
modifyHierarchy() |
java.lang.String |
quotedNameOf(java.lang.String s)
If this name is in the set of reserved names, then return a quoted version of
it.
|
void |
releaseActiveHierarchy() |
void |
releaseCallGraph() |
void |
releaseClientAccessibilityOracle() |
void |
releaseFastHierarchy() |
void |
releasePointsToAnalysis() |
void |
releaseReachableMethods() |
void |
releaseSideEffectAnalysis() |
void |
removeClass(SootClass c) |
void |
setActiveHierarchy(Hierarchy hierarchy)
Sets the active hierarchy
|
void |
setCallGraph(CallGraph cg) |
void |
setClientAccessibilityOracle(ClientAccessibilityOracle oracle) |
void |
setContextNumberer(Numberer<Context> n) |
void |
setContextSensitiveCallGraph(ContextSensitiveCallGraph cscg) |
void |
setDefaultThrowAnalysis(ThrowAnalysis ta)
Sets the
ThrowAnalysis to be used by default when constructing CFGs
which include exceptional control flow. |
void |
setDoneResolving() |
void |
setEntryPoints(java.util.List<SootMethod> entryPoints)
Change the set of entry point methods used to build the call graph.
|
void |
setFastHierarchy(FastHierarchy hierarchy)
Sets the active hierarchy
|
void |
setMainClass(SootClass m) |
void |
setMainClassFromOptions() |
void |
setPhantomRefs(boolean value) |
void |
setPkgList(java.util.List<java.lang.String> list) |
void |
setPointsToAnalysis(PointsToAnalysis pa)
Sets the active pointer analysis
|
void |
setReachableMethods(ReachableMethods rm) |
void |
setSideEffectAnalysis(SideEffectAnalysis sea)
Sets the active side-effect analysis
|
void |
setSootClassPath(java.lang.String p) |
java.lang.String |
signatureToClass(java.lang.String sig) |
java.lang.String |
signatureToSubsignature(java.lang.String sig) |
SootClass |
tryLoadClass(java.lang.String className,
int desiredLevel)
Attempts to load the given class and all of the required support classes.
|
java.lang.String |
unescapeName(java.lang.String s)
This method is the inverse of quotedNameOf().
|
static Scene |
v() |
protected final ArrayNumberer<Kind> kindNumberer
protected ArrayNumberer<Type> typeNumberer
protected ArrayNumberer<SootMethod> methodNumberer
protected Numberer<SparkField> fieldNumberer
protected ArrayNumberer<SootClass> classNumberer
protected StringNumberer subSigNumberer
protected ArrayNumberer<Local> localNumberer
protected Hierarchy activeHierarchy
protected FastHierarchy activeFastHierarchy
protected CallGraph activeCallGraph
protected ReachableMethods reachableMethods
protected PointsToAnalysis activePointsToAnalysis
protected SideEffectAnalysis activeSideEffectAnalysis
protected java.util.List<SootMethod> entryPoints
protected ClientAccessibilityOracle accessibilityOracle
protected java.util.LinkedList<java.lang.String> excludedPackages
public static Scene v()
public void setMainClass(SootClass m)
public java.util.Set<java.lang.String> getReservedNames()
public java.lang.String quotedNameOf(java.lang.String s)
public java.lang.String unescapeName(java.lang.String s)
s
- The possibly escaped namepublic boolean hasMainClass()
public SootClass getMainClass()
public SootMethod getMainMethod()
public void setSootClassPath(java.lang.String p)
public void extendSootClassPath(java.lang.String newPathElement)
public java.lang.String getSootClassPath()
public java.lang.String getAndroidJarPath(java.lang.String jars, java.lang.String apk)
public int getAndroidAPIVersion()
public java.lang.String defaultClassPath()
public int getState()
protected void modifyHierarchy()
public void addClass(SootClass c)
c
- The class to addprotected void addClassSilent(SootClass c)
c
- The class to addpublic void removeClass(SootClass c)
public boolean containsClass(java.lang.String className)
public boolean containsType(java.lang.String className)
public java.lang.String signatureToClass(java.lang.String sig)
public java.lang.String signatureToSubsignature(java.lang.String sig)
public SootField grabField(java.lang.String fieldSignature)
public boolean containsField(java.lang.String fieldSignature)
public SootMethod grabMethod(java.lang.String methodSignature)
public boolean containsMethod(java.lang.String methodSignature)
public SootField getField(java.lang.String fieldSignature)
public SootMethod getMethod(java.lang.String methodSignature)
public SootClass tryLoadClass(java.lang.String className, int desiredLevel)
public SootClass loadClassAndSupport(java.lang.String className)
public SootClass loadClass(java.lang.String className, int desiredLevel)
public Type getType(java.lang.String arg)
java.lang.RuntimeException
- if the Type for this name cannot be found. Use
getRefTypeUnsafe(String)
to check if type is an
registered RefType.public RefType getRefType(java.lang.String className)
java.lang.IllegalStateException
- if the RefType for this class cannot be found. Use
containsType(String)
to check if type is registeredpublic RefType getRefTypeUnsafe(java.lang.String className)
public void addRefType(RefType type)
public SootClass getSootClassUnsafe(java.lang.String className)
className
- The name of the class to getpublic SootClass getSootClass(java.lang.String className)
public Chain<SootClass> getClasses()
public Chain<SootClass> getApplicationClasses()
public Chain<SootClass> getLibraryClasses()
public Chain<SootClass> getPhantomClasses()
public SideEffectAnalysis getSideEffectAnalysis()
public void setSideEffectAnalysis(SideEffectAnalysis sea)
public boolean hasSideEffectAnalysis()
public void releaseSideEffectAnalysis()
public PointsToAnalysis getPointsToAnalysis()
public void setPointsToAnalysis(PointsToAnalysis pa)
public boolean hasPointsToAnalysis()
public void releasePointsToAnalysis()
public ClientAccessibilityOracle getClientAccessibilityOracle()
public boolean hasClientAccessibilityOracle()
public void setClientAccessibilityOracle(ClientAccessibilityOracle oracle)
public void releaseClientAccessibilityOracle()
public FastHierarchy getOrMakeFastHierarchy()
public FastHierarchy getFastHierarchy()
public void setFastHierarchy(FastHierarchy hierarchy)
public boolean hasFastHierarchy()
public void releaseFastHierarchy()
public Hierarchy getActiveHierarchy()
public void setActiveHierarchy(Hierarchy hierarchy)
public boolean hasActiveHierarchy()
public void releaseActiveHierarchy()
public boolean hasCustomEntryPoints()
public java.util.List<SootMethod> getEntryPoints()
public void setEntryPoints(java.util.List<SootMethod> entryPoints)
public ContextSensitiveCallGraph getContextSensitiveCallGraph()
public void setContextSensitiveCallGraph(ContextSensitiveCallGraph cscg)
public CallGraph getCallGraph()
public void setCallGraph(CallGraph cg)
public boolean hasCallGraph()
public void releaseCallGraph()
public ReachableMethods getReachableMethods()
public void setReachableMethods(ReachableMethods rm)
public boolean hasReachableMethods()
public void releaseReachableMethods()
public boolean getPhantomRefs()
public void setPhantomRefs(boolean value)
public boolean allowsPhantomRefs()
public ArrayNumberer<Type> getTypeNumberer()
public ArrayNumberer<SootMethod> getMethodNumberer()
public Numberer<SparkField> getFieldNumberer()
public ArrayNumberer<SootClass> getClassNumberer()
public StringNumberer getSubSigNumberer()
public ArrayNumberer<Local> getLocalNumberer()
public ThrowAnalysis getDefaultThrowAnalysis()
ThrowAnalysis
to be used by default when constructing
CFGs which include exceptional control flow.ThrowAnalysis
public void setDefaultThrowAnalysis(ThrowAnalysis ta)
ThrowAnalysis
to be used by default when constructing CFGs
which include exceptional control flow.ta
- the default ThrowAnalysis
.public void addBasicClass(java.lang.String name)
public void addBasicClass(java.lang.String name, int level)
public void loadBasicClasses()
public java.util.Set<java.lang.String> getBasicClasses()
public java.util.Collection<SootClass> dynamicClasses()
public void loadNecessaryClasses()
public void loadDynamicClasses()
public boolean isExcluded(SootClass sc)
public boolean isIncluded(SootClass sc)
public void setPkgList(java.util.List<java.lang.String> list)
public java.util.List<java.lang.String> getPkgList()
public SootMethodRef makeMethodRef(SootClass declaringClass, java.lang.String name, java.util.List<Type> parameterTypes, Type returnType, boolean isStatic)
public SootMethodRef makeConstructorRef(SootClass declaringClass, java.util.List<Type> parameterTypes)
public SootFieldRef makeFieldRef(SootClass declaringClass, java.lang.String name, Type type, boolean isStatic)
public java.util.List<SootClass> getClasses(int desiredLevel)
public boolean doneResolving()
public void setDoneResolving()
public void setMainClassFromOptions()
public boolean isIncrementalBuild()
public void initiateIncrementalBuild()
public void incrementalBuildFinished()
public SootClass forceResolve(java.lang.String className, int level)
public SootClass makeSootClass(java.lang.String name)
public SootClass makeSootClass(java.lang.String name, int modifiers)
public SootMethod makeSootMethod(java.lang.String name, java.util.List<Type> parameterTypes, Type returnType)
public SootMethod makeSootMethod(java.lang.String name, java.util.List<Type> parameterTypes, Type returnType, int modifiers)
public SootMethod makeSootMethod(java.lang.String name, java.util.List<Type> parameterTypes, Type returnType, int modifiers, java.util.List<SootClass> thrownExceptions)
public CallGraph internalMakeCallGraph()
SOOT USERS: DO NOT CALL THIS METHOD!
This method is a Soot-internal factory method for generating callgraph objects. It creates non-initialized object that must then be initialized by a callgraph algorithm