public class SourceLocator extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
SourceLocator.ClassSourceType |
| Modifier and Type | Field and Description |
|---|---|
protected Set<ClassLoader> |
additionalClassLoaders |
protected List<String> |
classPath |
protected List<ClassProvider> |
classProviders |
| 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) |
List<String> |
getClassesUnder(String aPath,
String prefix) |
ClassSource |
getClassSource(String className)
Given a class name, uses the soot-class-path to return a ClassSource for the given class.
|
protected SourceLocator.ClassSourceType |
getClassSourceType(String path) |
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() |
protected FoundFile |
lookupInArchive(String archivePath,
String fileName) |
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
|
protected void |
setupClassProviders() |
List<String> |
sourcePath() |
static SourceLocator |
v() |
protected Set<ClassLoader> additionalClassLoaders
protected List<ClassProvider> classProviders
public SourceLocator(Singletons.Global g)
public static SourceLocator v()
public static void ensureDirectoryExists(File dir)
dir is non-null.dir - public static List<String> explodeClassPath(String classPath)
public ClassSource getClassSource(String className)
public void additionalClassLoader(ClassLoader c)
protected void setupClassProviders()
public void setClassProviders(List<ClassProvider> classProviders)
public void invalidateClassPath()
protected SourceLocator.ClassSourceType getClassSourceType(String path)
public String getExtensionFor(int rep)
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 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()
Copyright © 2020 Soot OSS. All rights reserved.