mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-07 18:45:58 +01:00
Merge branch 'fix/uncompressed_files_bug' of https://github.com/realityJie/Apktool into realityJie-fix/uncompressed_files_bug
This commit is contained in:
commit
7910802648
@ -169,14 +169,12 @@ public class Androlib {
|
|||||||
|
|
||||||
for (String file : files) {
|
for (String file : files) {
|
||||||
if (isAPKFileNames(file) &&
|
if (isAPKFileNames(file) &&
|
||||||
unk.getCompressionLevel(file) == 0 &&
|
unk.getCompressionLevel(file) == 0 &&
|
||||||
unk.getSize(file) != 0) {
|
unk.getSize(file) != 0) {
|
||||||
|
|
||||||
ext = FilenameUtils.getExtension(file);
|
ext = FilenameUtils.getExtension(file);
|
||||||
|
|
||||||
// If we don't have a png extension, but we have multiple "dots", we may have another iteration
|
if (ext.isEmpty() || !NO_COMPRESS_PATTERN.matcher(ext).find()) {
|
||||||
// of OEM specific 9patch files. We need to record full path for these.
|
|
||||||
if (ext.isEmpty() || (!ext.equals("png") && StringUtils.countMatches(file, ".") > 1)) {
|
|
||||||
ext = file;
|
ext = file;
|
||||||
}
|
}
|
||||||
if (!uncompressedFilesOrExts.contains(ext)) {
|
if (!uncompressedFilesOrExts.contains(ext)) {
|
||||||
@ -485,7 +483,7 @@ public class Androlib {
|
|||||||
ninePatch = null;
|
ninePatch = null;
|
||||||
}
|
}
|
||||||
mAndRes.aaptPackage(apkFile, new File(appDir,
|
mAndRes.aaptPackage(apkFile, new File(appDir,
|
||||||
"AndroidManifest.xml"), new File(appDir, "res"),
|
"AndroidManifest.xml"), new File(appDir, "res"),
|
||||||
ninePatch, null, parseUsesFramework(usesFramework));
|
ninePatch, null, parseUsesFramework(usesFramework));
|
||||||
|
|
||||||
Directory tmpDir = new ExtFile(apkFile).getDirectory();
|
Directory tmpDir = new ExtFile(apkFile).getDirectory();
|
||||||
@ -547,7 +545,7 @@ public class Androlib {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mAndRes.aaptPackage(apkFile, new File(appDir,
|
mAndRes.aaptPackage(apkFile, new File(appDir,
|
||||||
"AndroidManifest.xml"), null, ninePatch, null,
|
"AndroidManifest.xml"), null, ninePatch, null,
|
||||||
parseUsesFramework(usesFramework));
|
parseUsesFramework(usesFramework));
|
||||||
|
|
||||||
Directory tmpDir = new ExtFile(apkFile).getDirectory();
|
Directory tmpDir = new ExtFile(apkFile).getDirectory();
|
||||||
@ -796,4 +794,7 @@ 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" };
|
||||||
|
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)$");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user