mirror of
https://github.com/revanced/Apktool.git
synced 2024-11-11 06:59:24 +01:00
fix: patch aapt2 to not run custom commands on passed aapt2 binary
This commit is contained in:
parent
d6f38e38cd
commit
b05f19b80d
@ -341,7 +341,7 @@ final public class AndrolibResources {
|
||||
}
|
||||
|
||||
private void aapt2Package(File apkFile, File manifest, File resDir, File rawDir, File assetDir, File[] include,
|
||||
List<String> cmd)
|
||||
List<String> cmd, boolean customAapt)
|
||||
throws AndrolibException {
|
||||
|
||||
List<String> compileCommand = new ArrayList<>(cmd);
|
||||
@ -448,10 +448,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) {
|
||||
@ -627,7 +634,7 @@ final public class AndrolibResources {
|
||||
}
|
||||
|
||||
if (apkOptions.isAapt2()) {
|
||||
aapt2Package(apkFile, manifest, resDir, rawDir, assetDir, include, cmd);
|
||||
aapt2Package(apkFile, manifest, resDir, rawDir, assetDir, include, cmd, customAapt);
|
||||
return;
|
||||
}
|
||||
aapt1Package(apkFile, manifest, resDir, rawDir, assetDir, include, cmd, customAapt);
|
||||
|
Loading…
Reference in New Issue
Block a user