diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java index b4c3d44a..89ea0a92 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java @@ -924,17 +924,6 @@ final public class AndrolibResources { } else { path = parentPath.getAbsolutePath() + String.format("%1$s.local%1$sshare%1$sapktool%1$sframework", File.separatorChar); } - - File fullPath = new File(path); - - if (! fullPath.canWrite()) { - LOGGER.severe(String.format("WARNING: Could not write to (%1$s), using %2$s instead...", - fullPath.getAbsolutePath(), System.getProperty("java.io.tmpdir"))); - LOGGER.severe("Please be aware this is a volatile directory and frameworks could go missing, " + - "please utilize --frame-path if the default storage directory is unavailable"); - - path = new File(System.getProperty("java.io.tmpdir")).getAbsolutePath(); - } } File dir = new File(path); @@ -956,6 +945,17 @@ final public class AndrolibResources { } } + if (apkOptions.frameworkFolderLocation == null) { + if (! dir.canWrite()) { + LOGGER.severe(String.format("WARNING: Could not write to (%1$s), using %2$s instead...", + dir.getAbsolutePath(), System.getProperty("java.io.tmpdir"))); + LOGGER.severe("Please be aware this is a volatile directory and frameworks could go missing, " + + "please utilize --frame-path if the default storage directory is unavailable"); + + dir = new File(System.getProperty("java.io.tmpdir")); + } + } + mFrameworkDirectory = dir; return dir; }