fix: remove hardcoded list of no-compressed assets

- We no longer use aapt for building assets, so this code is never ran
 in aapt1/2. So we can no longer skip these assets.
This commit is contained in:
Connor Tumbleson 2018-04-12 11:45:29 -04:00
parent d984948412
commit 061ddb8ee6

View File

@ -168,8 +168,7 @@ public class Androlib {
String ext; String ext;
for (String file : files) { for (String file : files) {
if (isAPKFileNames(file) && !NO_COMPRESS_PATTERN.matcher(file).find()) { if (isAPKFileNames(file) && unk.getCompressionLevel(file) == 0) {
if (unk.getCompressionLevel(file) == 0) {
if (StringUtils.countMatches(file, ".") > 1) { if (StringUtils.countMatches(file, ".") > 1) {
ext = file; ext = file;
@ -185,7 +184,6 @@ public class Androlib {
} }
} }
} }
}
} catch (DirectoryException ex) { } catch (DirectoryException ex) {
throw new AndrolibException(ex); throw new AndrolibException(ex);
} }
@ -789,9 +787,4 @@ public class Androlib {
private final static String[] APK_STANDARD_ALL_FILENAMES = new String[] { private final static String[] APK_STANDARD_ALL_FILENAMES = new String[] {
"classes.dex", "AndroidManifest.xml", "resources.arsc", "res", "r", "R", "classes.dex", "AndroidManifest.xml", "resources.arsc", "res", "r", "R",
"lib", "libs", "assets", "META-INF", "kotlin" }; "lib", "libs", "assets", "META-INF", "kotlin" };
// Taken from AOSP's frameworks/base/tools/aapt/Package.cpp
private final static Pattern NO_COMPRESS_PATTERN = Pattern.compile("\\.(" +
"jpg|jpeg|png|gif|wav|mp2|mp3|ogg|aac|mpg|mpeg|mid|midi|smf|jet|rtttl|imy|xmf|mp4|" +
"m4a|m4v|3gp|3gpp|3g2|3gpp2|amr|awb|wma|wmv|webm|mkv)$");
} }