mirror of
https://github.com/revanced/Apktool.git
synced 2024-12-11 21:37:47 +01:00
added --verbose option to output response from aapt. Used for debugging
This commit is contained in:
parent
5a056e3f9c
commit
617437a5cc
@ -152,6 +152,7 @@ public class Main {
|
||||
AndrolibException {
|
||||
boolean forceBuildAll = false;
|
||||
boolean debug = false;
|
||||
boolean verbose = false;
|
||||
int i;
|
||||
for (i = 0; i < args.length; i++) {
|
||||
String opt = args[i];
|
||||
@ -162,6 +163,8 @@ public class Main {
|
||||
forceBuildAll = true;
|
||||
} else if ("-d".equals(opt) || "--debug".equals(opt)) {
|
||||
debug = true;
|
||||
} else if ("-v".equals(opt) || "--verbose".equals(opt)) {
|
||||
verbose = true;
|
||||
} else {
|
||||
throw new InvalidArgsError();
|
||||
}
|
||||
@ -183,7 +186,7 @@ public class Main {
|
||||
}
|
||||
|
||||
new Androlib().build(new File(appDirName), outFile, forceBuildAll,
|
||||
debug);
|
||||
debug, verbose);
|
||||
}
|
||||
|
||||
private static void cmdInstallFramework(String[] args)
|
||||
|
@ -170,12 +170,12 @@ public class Androlib {
|
||||
}
|
||||
|
||||
public void build(File appDir, File outFile, boolean forceBuildAll,
|
||||
boolean debug) throws AndrolibException {
|
||||
build(new ExtFile(appDir), outFile, forceBuildAll, debug);
|
||||
boolean debug, boolean verbose) throws AndrolibException {
|
||||
build(new ExtFile(appDir), outFile, forceBuildAll, debug, verbose);
|
||||
}
|
||||
|
||||
public void build(ExtFile appDir, File outFile, boolean forceBuildAll,
|
||||
boolean debug) throws AndrolibException {
|
||||
boolean debug, boolean verbose) throws AndrolibException {
|
||||
Map<String, Object> meta = readMetaFile(appDir);
|
||||
Object t1 = meta.get("isFrameworkApk");
|
||||
boolean framework = t1 == null ? false : (Boolean) t1;
|
||||
@ -192,7 +192,7 @@ public class Androlib {
|
||||
buildResources(appDir, forceBuildAll, framework,
|
||||
(Map<String, Object>) meta.get("usesFramework"));
|
||||
buildLib(appDir, forceBuildAll);
|
||||
buildApk(appDir, outFile, framework);
|
||||
buildApk(appDir, outFile, framework, verbose);
|
||||
}
|
||||
|
||||
public void buildSources(File appDir, boolean forceBuildAll, boolean debug)
|
||||
@ -326,7 +326,7 @@ public class Androlib {
|
||||
new File(appDir, "AndroidManifest.xml"),
|
||||
new File(appDir, "res"),
|
||||
ninePatch, null, parseUsesFramework(usesFramework),
|
||||
false, framework
|
||||
false, framework, false
|
||||
);
|
||||
|
||||
Directory tmpDir = new ExtFile(apkFile).getDirectory();
|
||||
@ -384,7 +384,7 @@ public class Androlib {
|
||||
new File(appDir, "AndroidManifest.xml"),
|
||||
null,
|
||||
ninePatch, null, parseUsesFramework(usesFramework),
|
||||
false, framework
|
||||
false, framework, false
|
||||
);
|
||||
|
||||
Directory tmpDir = new ExtFile(apkFile).getDirectory();
|
||||
@ -419,7 +419,7 @@ public class Androlib {
|
||||
}
|
||||
}
|
||||
|
||||
public void buildApk(File appDir, File outApk, boolean framework)
|
||||
public void buildApk(File appDir, File outApk, boolean framework, boolean verbose)
|
||||
throws AndrolibException {
|
||||
LOGGER.info("Building apk file...");
|
||||
if (outApk.exists()) {
|
||||
@ -435,7 +435,7 @@ public class Androlib {
|
||||
assetDir = null;
|
||||
}
|
||||
mAndRes.aaptPackage(outApk, null, null,
|
||||
new File(appDir, APK_DIRNAME), assetDir, null, false, framework);
|
||||
new File(appDir, APK_DIRNAME), assetDir, null, false, framework, verbose);
|
||||
}
|
||||
|
||||
public void publicizeResources(File arscFile) throws AndrolibException {
|
||||
|
@ -193,12 +193,15 @@ final public class AndrolibResources {
|
||||
|
||||
public void aaptPackage(File apkFile, File manifest, File resDir,
|
||||
File rawDir, File assetDir, File[] include,
|
||||
boolean update, boolean framework) throws AndrolibException {
|
||||
boolean update, boolean framework, boolean verbose) throws AndrolibException {
|
||||
List<String> cmd = new ArrayList<String>();
|
||||
|
||||
cmd.add("aapt");
|
||||
cmd.add("p");
|
||||
cmd.add("-v"); //mega debug mode.@todo REMOVE ON FINAL
|
||||
|
||||
if (verbose) {
|
||||
cmd.add("-v");
|
||||
}
|
||||
|
||||
if (update) {
|
||||
cmd.add("-u");
|
||||
|
@ -44,7 +44,7 @@ public class BuildAndDecodeTest {
|
||||
"brut/apktool/testapp/", sTestOrigDir);
|
||||
|
||||
LOGGER.info("Building testapp.apk...");
|
||||
new Androlib().build(sTestOrigDir, testApk, false, false);
|
||||
new Androlib().build(sTestOrigDir, testApk, false, false, false);
|
||||
|
||||
LOGGER.info("Decoding testapp.apk...");
|
||||
ApkDecoder apkDecoder = new ApkDecoder(testApk);
|
||||
|
Loading…
Reference in New Issue
Block a user