public class Scene extends 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 boolean |
allowsPhantomRefs |
protected ArrayNumberer<SootClass> |
classNumberer |
protected Numberer<Context> |
contextNumberer |
protected List<SootMethod> |
entryPoints |
protected LinkedList<String> |
excludedPackages |
protected Numberer<SparkField> |
fieldNumberer |
protected ArrayNumberer<Kind> |
kindNumberer |
protected ArrayNumberer<Local> |
localNumberer |
protected SootClass |
mainClass |
protected ArrayNumberer<SootMethod> |
methodNumberer |
protected ReachableMethods |
reachableMethods |
protected String |
sootClassPath |
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(String name) |
void |
addBasicClass(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(String className) |
boolean |
containsField(String fieldSignature) |
boolean |
containsMethod(String methodSignature) |
boolean |
containsType(String className) |
String |
defaultClassPath() |
boolean |
doneResolving() |
Collection<SootClass> |
dynamicClasses() |
void |
extendSootClassPath(String newPathElement) |
SootClass |
forceResolve(String className,
int level) |
Hierarchy |
getActiveHierarchy()
Retrieves the active hierarchy
|
int |
getAndroidAPIVersion() |
String |
getAndroidJarPath(String jars,
String apk) |
Chain<SootClass> |
getApplicationClasses()
Returns a chain of the application classes in this scene.
|
Set<String> |
getBasicClasses() |
CallGraph |
getCallGraph() |
Chain<SootClass> |
getClasses()
Returns an backed chain of the classes in this manager.
|
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. |
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(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(String methodSignature) |
ArrayNumberer<SootMethod> |
getMethodNumberer() |
RefType |
getObjectType()
|
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() |
List<String> |
getPkgList() |
PointsToAnalysis |
getPointsToAnalysis()
Retrieves the active pointer analysis
|
ReachableMethods |
getReachableMethods() |
RefType |
getRefType(String className)
Returns the RefType with the given className.
|
RefType |
getRefTypeUnsafe(String className)
Returns the RefType with the given className.
|
Set<String> |
getReservedNames()
Returns a set of tokens which are reserved.
|
SideEffectAnalysis |
getSideEffectAnalysis()
Retrieves the active side-effect analysis
|
SootClass |
getSootClass(String className)
Returns the SootClass with the given className.
|
String |
getSootClassPath() |
SootClass |
getSootClassUnsafe(String className)
Returns the SootClass with the given className.
|
SootClass |
getSootClassUnsafe(String className,
boolean phantomNonExist)
Returns the SootClass with the given className.
|
int |
getState() |
StringNumberer |
getSubSigNumberer() |
Type |
getType(String arg)
Returns the RefType with the given class name or primitive type.
|
ArrayNumberer<Type> |
getTypeNumberer() |
Type |
getTypeUnsafe(String arg)
Returns a Type object representing the given type string.
|
Type |
getTypeUnsafe(String arg,
boolean phantomNonExist)
Returns a Type object representing the given type string.
|
Numberer<Unit> |
getUnitNumberer() |
SootField |
grabField(String fieldSignature) |
SootMethod |
grabMethod(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!
|
static boolean |
isApk(String file) |
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(String className,
int desiredLevel) |
SootClass |
loadClassAndSupport(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,
List<Type> parameterTypes)
Create an unresolved reference to a constructor.
|
SootFieldRef |
makeFieldRef(SootClass declaringClass,
String name,
Type type,
boolean isStatic)
Create an unresolved reference to a field.
|
SootMethodRef |
makeMethodRef(SootClass declaringClass,
String name,
List<Type> parameterTypes,
Type returnType,
boolean isStatic)
Create an unresolved reference to a method.
|
SootClass |
makeSootClass(String name) |
SootClass |
makeSootClass(String name,
int modifiers) |
SootField |
makeSootField(String name,
Type type) |
SootField |
makeSootField(String name,
Type type,
int modifiers) |
SootMethod |
makeSootMethod(String name,
List<Type> parameterTypes,
Type returnType) |
SootMethod |
makeSootMethod(String name,
List<Type> parameterTypes,
Type returnType,
int modifiers) |
SootMethod |
makeSootMethod(String name,
List<Type> parameterTypes,
Type returnType,
int modifiers,
List<SootClass> thrownExceptions) |
protected void |
modifyHierarchy() |
String |
quotedNameOf(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(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(List<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(String p) |
String |
signatureToClass(String sig) |
String |
signatureToSubsignature(String sig) |
SootClass |
tryLoadClass(String className,
int desiredLevel)
Attempts to load the given class and all of the required support classes.
|
String |
unescapeName(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 List<SootMethod> entryPoints
protected ClientAccessibilityOracle accessibilityOracle
protected boolean allowsPhantomRefs
protected SootClass mainClass
protected String sootClassPath
protected LinkedList<String> excludedPackages
public Scene(Singletons.Global g)
public static Scene v()
public void setMainClass(SootClass m)
public Set<String> getReservedNames()
public String quotedNameOf(String s)
public String unescapeName(String s)
s
- The possibly escaped namepublic boolean hasMainClass()
public SootClass getMainClass()
public SootMethod getMainMethod()
public void setSootClassPath(String p)
public void extendSootClassPath(String newPathElement)
public String getSootClassPath()
public int getAndroidAPIVersion()
public String defaultClassPath()
public static boolean isApk(String file)
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(String className)
public boolean containsType(String className)
public boolean containsField(String fieldSignature)
public SootMethod grabMethod(String methodSignature)
public boolean containsMethod(String methodSignature)
public SootMethod getMethod(String methodSignature)
public SootClass tryLoadClass(String className, int desiredLevel)
public SootClass loadClassAndSupport(String className)
public Type getType(String arg)
RuntimeException
- if the Type for this name cannot be found. Use getRefTypeUnsafe(String)
to check if type is an
registered RefType.public Type getTypeUnsafe(String arg)
arg
- A string description of the typepublic Type getTypeUnsafe(String arg, boolean phantomNonExist)
arg
- A string description of the typephantomNonExist
- Indicates that a phantom class should be created for the given type string and a Type object should be created
based on the phantom class if a class matching the type name does not exists in the scene and phantom refs are
allowedpublic RefType getRefType(String className)
IllegalStateException
- if the RefType for this class cannot be found. Use containsType(String)
to check if type is
registeredpublic RefType getRefTypeUnsafe(String className)
public RefType getObjectType()
public void addRefType(RefType type)
public SootClass getSootClassUnsafe(String className)
className
- The name of the class to getpublic SootClass getSootClassUnsafe(String className, boolean phantomNonExist)
className
- The name of the class to getphantomNonExist
- Indicates that a phantom class should be created if a class with the given name does not exist and phantom refs
are allowedpublic SootClass getSootClass(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 List<SootMethod> getEntryPoints()
public void setEntryPoints(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(String name)
public void addBasicClass(String name, int level)
public void loadBasicClasses()
public Collection<SootClass> dynamicClasses()
public void loadNecessaryClasses()
public void loadDynamicClasses()
public boolean isExcluded(SootClass sc)
public boolean isIncluded(SootClass sc)
public SootMethodRef makeMethodRef(SootClass declaringClass, String name, List<Type> parameterTypes, Type returnType, boolean isStatic)
public SootMethodRef makeConstructorRef(SootClass declaringClass, List<Type> parameterTypes)
public SootFieldRef makeFieldRef(SootClass declaringClass, String name, Type type, boolean isStatic)
public List<SootClass> getClasses(int desiredLevel)
public boolean doneResolving()
public void setDoneResolving()
public void setMainClassFromOptions()
public boolean isIncrementalBuild()
public void initiateIncrementalBuild()
public void incrementalBuildFinished()
public SootMethod makeSootMethod(String name, List<Type> parameterTypes, Type returnType)
public SootMethod makeSootMethod(String name, List<Type> parameterTypes, Type returnType, int modifiers)
public SootMethod makeSootMethod(String name, List<Type> parameterTypes, Type returnType, int modifiers, 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
Copyright © 2019 Sable. All rights reserved.