mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-21 01:07:34 +01:00
Added possibility to choose output location when building.
This commit is contained in:
parent
0ea7744625
commit
2748ef833a
@ -142,20 +142,22 @@ public class Androlib {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void build(File appDir, boolean forceBuildAll, boolean debug)
|
public void build(File appDir, File outFile, boolean forceBuildAll,
|
||||||
throws AndrolibException {
|
boolean debug) throws AndrolibException {
|
||||||
build(new ExtFile(appDir), forceBuildAll, debug);
|
build(new ExtFile(appDir), outFile, forceBuildAll, debug);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void build(ExtFile appDir, boolean forceBuildAll, boolean debug)
|
public void build(ExtFile appDir, File outFile, boolean forceBuildAll,
|
||||||
throws AndrolibException {
|
boolean debug) throws AndrolibException {
|
||||||
Map<String, Object> meta = readMetaFile(appDir);
|
Map<String, Object> meta = readMetaFile(appDir);
|
||||||
Object t1 = meta.get("isFrameworkApk");
|
Object t1 = meta.get("isFrameworkApk");
|
||||||
boolean framework = t1 == null ? false : (Boolean) t1;
|
boolean framework = t1 == null ? false : (Boolean) t1;
|
||||||
|
|
||||||
String outFileName = (String) meta.get("apkFileName");
|
if (outFile == null) {
|
||||||
File outFile = new File(appDir, "dist" + File.separator +
|
String outFileName = (String) meta.get("apkFileName");
|
||||||
(outFileName == null ? "out" : outFileName));
|
outFile = new File(appDir, "dist" + File.separator +
|
||||||
|
(outFileName == null ? "out" : outFileName));
|
||||||
|
}
|
||||||
|
|
||||||
new File(appDir, APK_DIRNAME).mkdirs();
|
new File(appDir, APK_DIRNAME).mkdirs();
|
||||||
buildSources(appDir, forceBuildAll, debug);
|
buildSources(appDir, forceBuildAll, debug);
|
||||||
@ -335,7 +337,7 @@ public class Androlib {
|
|||||||
outApk.delete();
|
outApk.delete();
|
||||||
} else {
|
} else {
|
||||||
File outDir = outApk.getParentFile();
|
File outDir = outApk.getParentFile();
|
||||||
if (! outDir.exists()) {
|
if (outDir != null && ! outDir.exists()) {
|
||||||
outDir.mkdirs();
|
outDir.mkdirs();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user