Only attempt to use -e option when the packaged aapt binary is used.

This commit is contained in:
Peter Retzlaff 2019-10-18 10:57:52 +02:00 committed by Connor Tumbleson
parent 5d488e5f22
commit d6f38e38cd

View File

@ -563,10 +563,17 @@ final public class AndrolibResources {
cmd.add("-x"); cmd.add("-x");
} }
if (apkOptions.doNotCompress != null) { if (apkOptions.doNotCompress != null && !customAapt) {
// Use custom -e option to avoid limits on commandline length.
// Can only be used when custom aapt binary is not used.
String extensionsFilePath = createDoNotCompressExtensionsFile(apkOptions).getAbsolutePath(); String extensionsFilePath = createDoNotCompressExtensionsFile(apkOptions).getAbsolutePath();
cmd.add("-e"); cmd.add("-e");
cmd.add(extensionsFilePath); cmd.add(extensionsFilePath);
} else if (apkOptions.doNotCompress != null) {
for (String file : apkOptions.doNotCompress) {
cmd.add("-0");
cmd.add(file);
}
} }
if (!apkOptions.resourcesAreCompressed) { if (!apkOptions.resourcesAreCompressed) {