From bc9f465f3ec2cf02466dcd2004cbd436439ceed6 Mon Sep 17 00:00:00 2001 From: Igor Eisberg Date: Sun, 3 Mar 2019 15:08:28 +0200 Subject: [PATCH] Fix the massive list of uncompressed 9.png that prevents recompile on Windows Windows has its limits, even Windows 10, at least on older versions before the max path length restriction was removed. Because apktool failed to recognize the .9.png extension as a variety of the .png extension, those .9.png files were piling up in apktool.yml and then passed to aapt, which would fail to run on Windows because of an immense command length. This fix makes a special exception for the .png exception and will allow the .9.png one to pass as another .png extension. Before: http://dpaste.com/2BC3RRB After: http://dpaste.com/177CVZQ --- .../src/main/java/brut/androlib/Androlib.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/Androlib.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/Androlib.java index 302800be..43117961 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/Androlib.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/Androlib.java @@ -172,15 +172,10 @@ public class Androlib { unk.getCompressionLevel(file) == 0 && unk.getSize(file) != 0) { - if (StringUtils.countMatches(file, ".") > 1) { + ext = FilenameUtils.getExtension(file); + if (ext.isEmpty() || (!ext.equals("png") && StringUtils.countMatches(file, ".") > 1)) { ext = file; - } else { - ext = FilenameUtils.getExtension(file); - if (ext.isEmpty()) { - ext = file; - } } - if (!uncompressedFilesOrExts.contains(ext)) { uncompressedFilesOrExts.add(ext); }