feat: Expose the aapt --no-crunch option

- Add a --no-crunch/-nc flag to apktool which gets passed through to aapt
- This allows apktool to make a byte-for-byte copy of resource files
- refs: #1232
This commit is contained in:
Seb Patane
2018-07-24 13:54:37 +10:00
parent 6231edfcfd
commit b0fd764df4
3 changed files with 18 additions and 0 deletions

View File

@ -218,6 +218,9 @@ public class Main {
if (cli.hasOption("p") || cli.hasOption("frame-path")) {
apkOptions.frameworkFolderLocation = cli.getOptionValue("p");
}
if (cli.hasOption("nc") || cli.hasOption("no-crunch")) {
apkOptions.noCrunch = true;
}
// Temporary flag to enable the use of aapt2. This will tranform in time to a use-aapt1 flag, which will be
// legacy and eventually removed.
@ -397,6 +400,11 @@ public class Main {
.desc("Copies original AndroidManifest.xml and META-INF. See project page for more info.")
.build();
Option noCrunchOption = Option.builder("nc")
.longOpt("no-crunch")
.desc("Disable crunching of resource files during the build step.")
.build();
Option tagOption = Option.builder("t")
.longOpt("tag")
.desc("Tag frameworks using <tag>.")
@ -439,6 +447,7 @@ public class Main {
BuildOptions.addOption(aaptOption);
BuildOptions.addOption(originalOption);
BuildOptions.addOption(aapt2Option);
BuildOptions.addOption(noCrunchOption);
}
// add global options
@ -492,6 +501,7 @@ public class Main {
allOptions.addOption(verboseOption);
allOptions.addOption(quietOption);
allOptions.addOption(aapt2Option);
allOptions.addOption(noCrunchOption);
}
private static String verbosityHelp() {