soot
Class Scene

java.lang.Object
  extended bysoot.Scene

public class Scene
extends Object

Manages the SootClasses of the application being analyzed.


Field Summary
 ArrayList cfgList
           
 
Constructor Summary
Scene(soot.Singletons.Global g)
           
 
Method Summary
 void addBasicClass(String name)
           
 void addBasicClass(String name, int level)
           
 void addClass(SootClass c)
           
 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 doneResolving()
           
 Collection dynamicClasses()
           
 Hierarchy getActiveHierarchy()
          Retrieves the active hierarchy
 Chain getApplicationClasses()
          Returns a chain of the application classes in this scene.
 CallGraph getCallGraph()
           
 Chain getClasses()
          Returns an backed chain of the classes in this manager.
 List getClasses(int desiredLevel)
          Returns the list of SootClasses that have been resolved at least to the level specified.
 ArrayNumberer getClassNumberer()
           
 Numberer getContextNumberer()
           
 ContextSensitiveCallGraph getContextSensitiveCallGraph()
           
 ThrowAnalysis getDefaultThrowAnalysis()
          Returns the ThrowAnalysis to be used by default when constructing CFGs which include exceptional control flow.
 List 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)
           
 ArrayNumberer getFieldNumberer()
           
 Chain getLibraryClasses()
          Returns a chain of the library classes in this scene.
 ArrayNumberer getLocalNumberer()
           
 SootClass getMainClass()
           
 SootMethod getMethod(String methodSignature)
           
 ArrayNumberer getMethodNumberer()
           
 FastHierarchy getOrMakeFastHierarchy()
          Makes a new fast hierarchy is none is active, and returns the active fast hierarchy.
 Chain getPhantomClasses()
          Returns a chain of the phantom classes in this scene.
 boolean getPhantomRefs()
           
 ArrayList getPkgList()
           
 PointsToAnalysis getPointsToAnalysis()
          Retrieves the active pointer analysis
 ReachableMethods getReachableMethods()
           
 RefType getRefType(String className)
          Returns the RefType with the given className.
 Set 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()
           
 int getState()
           
 StringNumberer getSubSigNumberer()
           
 ArrayNumberer getTypeNumberer()
           
 Numberer getUnitNumberer()
           
 boolean hasActiveHierarchy()
           
 boolean hasCallGraph()
           
 boolean hasFastHierarchy()
           
 boolean hasPointsToAnalysis()
           
 boolean hasReachableMethods()
           
 boolean hasSideEffectAnalysis()
           
 Numberer 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 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 parameterTypes, Type returnType, boolean isStatic)
          Create an unresolved reference to a method.
 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 releaseFastHierarchy()
           
 void releasePointsToAnalysis()
           
 void releaseReachableMethods()
           
 void releaseSideEffectAnalysis()
           
 void removeClass(SootClass c)
           
 void setActiveHierarchy(Hierarchy hierarchy)
          Sets the active hierarchy
 void setCallGraph(CallGraph cg)
           
 void setContextNumberer(Numberer 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 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(ArrayList 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.
static Scene v()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cfgList

public ArrayList cfgList
Constructor Detail

Scene

public Scene(soot.Singletons.Global g)
Method Detail

v

public static Scene v()

setMainClass

public void setMainClass(SootClass m)

getReservedNames

public Set getReservedNames()
Returns a set of tokens which are reserved. Any field, class, method, or local variable with such a name will be quoted.


quotedNameOf

public String quotedNameOf(String s)
If this name is in the set of reserved names, then return a quoted version of it. Else pass it through.


getMainClass

public SootClass getMainClass()

setSootClassPath

public void setSootClassPath(String p)

getSootClassPath

public String getSootClassPath()

getState

public int getState()

addClass

public void addClass(SootClass c)

removeClass

public void removeClass(SootClass c)

containsClass

public boolean containsClass(String className)

signatureToClass

public String signatureToClass(String sig)

signatureToSubsignature

public String signatureToSubsignature(String sig)

containsField

public boolean containsField(String fieldSignature)

containsMethod

public boolean containsMethod(String methodSignature)

getField

public SootField getField(String fieldSignature)

getMethod

public SootMethod getMethod(String methodSignature)

tryLoadClass

public SootClass tryLoadClass(String className,
                              int desiredLevel)
Attempts to load the given class and all of the required support classes. Returns the original class if it was loaded, or null otherwise.


loadClassAndSupport

public SootClass loadClassAndSupport(String className)
Loads the given class and all of the required support classes. Returns the first class.


loadClass

public SootClass loadClass(String className,
                           int desiredLevel)

getRefType

public RefType getRefType(String className)
Returns the RefType with the given className.


addRefType

public void addRefType(RefType type)
Returns the RefType with the given className.


getSootClass

public SootClass getSootClass(String className)
Returns the SootClass with the given className.


getClasses

public Chain getClasses()
Returns an backed chain of the classes in this manager.


getApplicationClasses

public Chain getApplicationClasses()
Returns a chain of the application classes in this scene. These classes are the ones which can be freely analysed & modified.


getLibraryClasses

public Chain getLibraryClasses()
Returns a chain of the library classes in this scene. These classes can be analysed but not modified.


getPhantomClasses

public Chain getPhantomClasses()
Returns a chain of the phantom classes in this scene. These classes are referred to by other classes, but cannot be loaded.


getSideEffectAnalysis

public SideEffectAnalysis getSideEffectAnalysis()
Retrieves the active side-effect analysis


setSideEffectAnalysis

public void setSideEffectAnalysis(SideEffectAnalysis sea)
Sets the active side-effect analysis


hasSideEffectAnalysis

public boolean hasSideEffectAnalysis()

releaseSideEffectAnalysis

public void releaseSideEffectAnalysis()

getPointsToAnalysis

public PointsToAnalysis getPointsToAnalysis()
Retrieves the active pointer analysis


setPointsToAnalysis

public void setPointsToAnalysis(PointsToAnalysis pa)
Sets the active pointer analysis


hasPointsToAnalysis

public boolean hasPointsToAnalysis()

releasePointsToAnalysis

public void releasePointsToAnalysis()

getOrMakeFastHierarchy

public FastHierarchy getOrMakeFastHierarchy()
Makes a new fast hierarchy is none is active, and returns the active fast hierarchy.


getFastHierarchy

public FastHierarchy getFastHierarchy()
Retrieves the active fast hierarchy


setFastHierarchy

public void setFastHierarchy(FastHierarchy hierarchy)
Sets the active hierarchy


hasFastHierarchy

public boolean hasFastHierarchy()

releaseFastHierarchy

public void releaseFastHierarchy()

getActiveHierarchy

public Hierarchy getActiveHierarchy()
Retrieves the active hierarchy


setActiveHierarchy

public void setActiveHierarchy(Hierarchy hierarchy)
Sets the active hierarchy


hasActiveHierarchy

public boolean hasActiveHierarchy()

releaseActiveHierarchy

public void releaseActiveHierarchy()

getEntryPoints

public List getEntryPoints()
Get the set of entry points that are used to build the call graph.


setEntryPoints

public void setEntryPoints(List entryPoints)
Change the set of entry point methods used to build the call graph.


getContextSensitiveCallGraph

public ContextSensitiveCallGraph getContextSensitiveCallGraph()

setContextSensitiveCallGraph

public void setContextSensitiveCallGraph(ContextSensitiveCallGraph cscg)

getCallGraph

public CallGraph getCallGraph()

setCallGraph

public void setCallGraph(CallGraph cg)

hasCallGraph

public boolean hasCallGraph()

releaseCallGraph

public void releaseCallGraph()

getReachableMethods

public ReachableMethods getReachableMethods()

setReachableMethods

public void setReachableMethods(ReachableMethods rm)

hasReachableMethods

public boolean hasReachableMethods()

releaseReachableMethods

public void releaseReachableMethods()

getPhantomRefs

public boolean getPhantomRefs()

setPhantomRefs

public void setPhantomRefs(boolean value)

allowsPhantomRefs

public boolean allowsPhantomRefs()

kindNumberer

public Numberer kindNumberer()

getTypeNumberer

public ArrayNumberer getTypeNumberer()

getMethodNumberer

public ArrayNumberer getMethodNumberer()

getContextNumberer

public Numberer getContextNumberer()

getUnitNumberer

public Numberer getUnitNumberer()

getFieldNumberer

public ArrayNumberer getFieldNumberer()

getClassNumberer

public ArrayNumberer getClassNumberer()

getSubSigNumberer

public StringNumberer getSubSigNumberer()

getLocalNumberer

public ArrayNumberer getLocalNumberer()

setContextNumberer

public void setContextNumberer(Numberer n)

getDefaultThrowAnalysis

public ThrowAnalysis getDefaultThrowAnalysis()
Returns the ThrowAnalysis to be used by default when constructing CFGs which include exceptional control flow.

Returns:
the default ThrowAnalysis

setDefaultThrowAnalysis

public void setDefaultThrowAnalysis(ThrowAnalysis ta)
Sets the ThrowAnalysis to be used by default when constructing CFGs which include exceptional control flow.


addBasicClass

public void addBasicClass(String name)

addBasicClass

public void addBasicClass(String name,
                          int level)

loadBasicClasses

public void loadBasicClasses()
Load just the set of basic classes soot needs, ignoring those specified on the command-line. You don't need to use both this and loadNecessaryClasses, though it will only waste time.


dynamicClasses

public Collection dynamicClasses()

loadNecessaryClasses

public void loadNecessaryClasses()
Load the set of classes that soot needs, including those specified on the command-line. This is the standard way of initialising the list of classes soot should use.


loadDynamicClasses

public void loadDynamicClasses()

setPkgList

public void setPkgList(ArrayList list)

getPkgList

public ArrayList getPkgList()

makeMethodRef

public SootMethodRef makeMethodRef(SootClass declaringClass,
                                   String name,
                                   List parameterTypes,
                                   Type returnType,
                                   boolean isStatic)
Create an unresolved reference to a method.


makeConstructorRef

public SootMethodRef makeConstructorRef(SootClass declaringClass,
                                        List parameterTypes)
Create an unresolved reference to a constructor.


makeFieldRef

public SootFieldRef makeFieldRef(SootClass declaringClass,
                                 String name,
                                 Type type,
                                 boolean isStatic)
Create an unresolved reference to a field.


getClasses

public List getClasses(int desiredLevel)
Returns the list of SootClasses that have been resolved at least to the level specified.


doneResolving

public boolean doneResolving()

setDoneResolving

public void setDoneResolving()

setMainClassFromOptions

public void setMainClassFromOptions()