diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java index 5a695e66..a896bd39 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java @@ -563,10 +563,17 @@ final public class AndrolibResources { 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(); cmd.add("-e"); cmd.add(extensionsFilePath); + } else if (apkOptions.doNotCompress != null) { + for (String file : apkOptions.doNotCompress) { + cmd.add("-0"); + cmd.add(file); + } } if (!apkOptions.resourcesAreCompressed) {