public class SourceLocator extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SourceLocator.FoundFile |
Modifier and Type | Field and Description |
---|---|
protected Set<ClassLoader> |
additionalClassLoaders |
protected Set<String> |
classesToLoad |
Constructor and Description |
---|
SourceLocator(Singletons.Global g) |
Modifier and Type | Method and Description |
---|---|
void |
additionalClassLoader(ClassLoader c) |
Set<String> |
classesInDynamicPackage(String str) |
List<String> |
classPath() |
void |
clearDexClassPathExtensions()
Clears the set of dex or apk files that still need to be indexed
|
Map<String,File> |
dexClassIndex()
Return the dex class index that maps class names to files
|
static void |
ensureDirectoryExists(File dir)
Create the given directory and all parent directories if
dir is
non-null. |
static List<String> |
explodeClassPath(String classPath)
Explodes a class path into a list of individual class path entries.
|
void |
extendClassPath(String newPathElement) |
List<String> |
getClassesUnder(String aPath) |
ClassSource |
getClassSource(String className)
Given a class name, uses the soot-class-path to return a ClassSource for the given class.
|
Set<String> |
getDexClassPathExtensions()
Gets all files that were added to the classpath later on and that have
not yet been processed for the dexClassIndex mapping
|
String |
getExtensionFor(int rep) |
String |
getFileNameFor(SootClass c,
int rep) |
String |
getOutputDir()
Returns the output directory given by
Options or a default if not
set. |
String |
getOutputJarName()
If
Options#v()#output_jar() is set, returns the name of the jar
file to which the output will be written. |
String |
getSourceForClass(String className)
Returns the name of the class in which the (possibly inner) class
className appears.
|
void |
invalidateClassPath() |
SourceLocator.FoundFile |
lookupInClassPath(String fileName)
Searches for a file with the given name in the exploded classPath.
|
void |
setClassProviders(List<ClassProvider> classProviders) |
void |
setDexClassIndex(Map<String,File> index)
Set the dex class index
|
List<String> |
sourcePath() |
static SourceLocator |
v() |
protected Set<ClassLoader> additionalClassLoaders
public SourceLocator(Singletons.Global g)
public static SourceLocator v()
public ClassSource getClassSource(String className)
public void additionalClassLoader(ClassLoader c)
public void setClassProviders(List<ClassProvider> classProviders)
public void invalidateClassPath()
public String getExtensionFor(int rep)
public static void ensureDirectoryExists(File dir)
dir
is
non-null.dir
- public String getOutputDir()
Options
or a default if not
set. Also ensures that all directories in the path exist.Options
or a default if not setpublic String getOutputJarName()
Options#v()#output_jar()
is set, returns the name of the jar
file to which the output will be written. The name of the jar file can be
given with the -output-dir option or a default will be used. Also ensures
that all directories in the path exist.public static List<String> explodeClassPath(String classPath)
public SourceLocator.FoundFile lookupInClassPath(String fileName)
public String getSourceForClass(String className)
public Map<String,File> dexClassIndex()
public void setDexClassIndex(Map<String,File> index)
index
- the indexpublic void extendClassPath(String newPathElement)
public Set<String> getDexClassPathExtensions()
public void clearDexClassPathExtensions()