mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-07 10:35:52 +01:00
Merge branch 'no-crunch-aapt-option' of https://github.com/Novex/Apktool
This commit is contained in:
commit
e82537e340
@ -218,6 +218,9 @@ public class Main {
|
|||||||
if (cli.hasOption("p") || cli.hasOption("frame-path")) {
|
if (cli.hasOption("p") || cli.hasOption("frame-path")) {
|
||||||
apkOptions.frameworkFolderLocation = cli.getOptionValue("p");
|
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
|
// 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.
|
// 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.")
|
.desc("Copies original AndroidManifest.xml and META-INF. See project page for more info.")
|
||||||
.build();
|
.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")
|
Option tagOption = Option.builder("t")
|
||||||
.longOpt("tag")
|
.longOpt("tag")
|
||||||
.desc("Tag frameworks using <tag>.")
|
.desc("Tag frameworks using <tag>.")
|
||||||
@ -439,6 +447,7 @@ public class Main {
|
|||||||
BuildOptions.addOption(aaptOption);
|
BuildOptions.addOption(aaptOption);
|
||||||
BuildOptions.addOption(originalOption);
|
BuildOptions.addOption(originalOption);
|
||||||
BuildOptions.addOption(aapt2Option);
|
BuildOptions.addOption(aapt2Option);
|
||||||
|
BuildOptions.addOption(noCrunchOption);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add global options
|
// add global options
|
||||||
@ -492,6 +501,7 @@ public class Main {
|
|||||||
allOptions.addOption(verboseOption);
|
allOptions.addOption(verboseOption);
|
||||||
allOptions.addOption(quietOption);
|
allOptions.addOption(quietOption);
|
||||||
allOptions.addOption(aapt2Option);
|
allOptions.addOption(aapt2Option);
|
||||||
|
allOptions.addOption(noCrunchOption);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String verbosityHelp() {
|
private static String verbosityHelp() {
|
||||||
|
@ -28,6 +28,7 @@ public class ApkOptions {
|
|||||||
public boolean isFramework = false;
|
public boolean isFramework = false;
|
||||||
public boolean resourcesAreCompressed = false;
|
public boolean resourcesAreCompressed = false;
|
||||||
public boolean useAapt2 = false;
|
public boolean useAapt2 = false;
|
||||||
|
public boolean noCrunch = false;
|
||||||
public Collection<String> doNotCompress;
|
public Collection<String> doNotCompress;
|
||||||
|
|
||||||
public String frameworkFolderLocation = null;
|
public String frameworkFolderLocation = null;
|
||||||
|
@ -350,6 +350,10 @@ final public class AndrolibResources {
|
|||||||
cmd.add("-v");
|
cmd.add("-v");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (apkOptions.noCrunch) {
|
||||||
|
cmd.add("--no-crunch");
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
OS.exec(cmd.toArray(new String[0]));
|
OS.exec(cmd.toArray(new String[0]));
|
||||||
LOGGER.fine("aapt2 compile command ran: ");
|
LOGGER.fine("aapt2 compile command ran: ");
|
||||||
@ -485,6 +489,9 @@ final public class AndrolibResources {
|
|||||||
if (apkOptions.debugMode) { // inject debuggable="true" into manifest
|
if (apkOptions.debugMode) { // inject debuggable="true" into manifest
|
||||||
cmd.add("--debug-mode");
|
cmd.add("--debug-mode");
|
||||||
}
|
}
|
||||||
|
if (apkOptions.noCrunch) {
|
||||||
|
cmd.add("--no-crunch");
|
||||||
|
}
|
||||||
// force package id so that some frameworks build with correct id
|
// force package id so that some frameworks build with correct id
|
||||||
// disable if user adds own aapt (can't know if they have this feature)
|
// disable if user adds own aapt (can't know if they have this feature)
|
||||||
if (mPackageId != null && ! customAapt && ! mSharedLibrary) {
|
if (mPackageId != null && ! customAapt && ! mSharedLibrary) {
|
||||||
|
Loading…
Reference in New Issue
Block a user