added ability to use --frame-path during install of frameworks

This commit is contained in:
Connor Tumbleson
2013-01-18 08:19:19 -06:00
parent 5a4ffe6ca0
commit cb5bad5555
4 changed files with 25 additions and 8 deletions

View File

@ -493,8 +493,9 @@ public class Androlib {
mAndRes.publicizeResources(arscFile);
}
public void installFramework(File frameFile, String tag)
public void installFramework(File frameFile, String tag, String frame_path)
throws AndrolibException {
mAndRes.setFrameworkFolder(frame_path);
mAndRes.installFramework(frameFile, tag);
}

View File

@ -648,11 +648,11 @@ final public class AndrolibResources {
private File getFrameworkDir() throws AndrolibException {
String path;
/* if a framework path was specified on the command line, use it */
// if a framework path was specified on the command line, use it
if (sFrameworkFolder != null) {
path = sFrameworkFolder;
} else if (System.getProperty("os.name").equals("Mac OS X")) {
/* store in user-home, for Mac OS X */
// store in user-home, for Mac OS X
path = System.getProperty("user.home") + File.separatorChar
+ "Library/apktool/framework";
} else {
@ -663,8 +663,7 @@ final public class AndrolibResources {
if (!dir.exists()) {
if (!dir.mkdirs()) {
if (sFrameworkFolder != null) {
System.out.println("Can't create Framework directory: "
+ dir);
System.out.println("Can't create Framework directory: " + dir);
}
throw new AndrolibException("Can't create directory: " + dir);
}
@ -680,6 +679,10 @@ final public class AndrolibResources {
throw new AndrolibException(ex);
}
}
public void setFrameworkFolder(String path) {
sFrameworkFolder = path;
}
// TODO: dirty static hack. I have to refactor decoding mechanisms.
public static boolean sKeepBroken = false;