Add support for specifying a base dir for the BOOTCLASSPATH files

git-svn-id: https://smali.googlecode.com/svn/trunk@629 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
JesusFreke@JesusFreke.com
2010-02-15 02:00:58 +00:00
parent 2e2a187734
commit 3f7739cd09
3 changed files with 25 additions and 11 deletions

View File

@ -17,23 +17,23 @@ public class ClassPath {
private final HashMap<String, ClassDef> classDefs;
protected ClassDef javaLangObjectClassDef; //Ljava/lang/Object;
public static void InitializeClassPath(String[] bootClassPath, DexFile dexFile) {
public static void InitializeClassPath(String bootClassPathDir, String[] bootClassPath, DexFile dexFile) {
if (theClassPath != null) {
throw new ExceptionWithContext("Cannot initialize ClassPath multiple times");
}
theClassPath = new ClassPath();
theClassPath.initClassPath(bootClassPath, dexFile);
theClassPath.initClassPath(bootClassPathDir, bootClassPath, dexFile);
}
private ClassPath() {
classDefs = new HashMap<String, ClassDef>();
}
private void initClassPath(String[] bootClassPath, DexFile dexFile) {
private void initClassPath(String bootClassPathDir, String[] bootClassPath, DexFile dexFile) {
if (bootClassPath != null) {
for (String bootClassPathEntry: bootClassPath) {
loadBootClassPath(bootClassPathEntry);
loadBootClassPath(bootClassPathDir, bootClassPathEntry);
}
}
@ -45,8 +45,8 @@ public class ClassPath {
}
}
private void loadBootClassPath(String bootClassPathEntry) {
File file = new File(bootClassPathEntry);
private void loadBootClassPath(String bootClassPathDir, String bootClassPathEntry) {
File file = new File(bootClassPathDir, bootClassPathEntry);
if (!file.exists()) {
throw new ExceptionWithContext("ClassPath entry \"" + bootClassPathEntry + "\" does not exist.");