mirror of
https://github.com/revanced/Apktool.git
synced 2025-02-01 06:37:34 +01:00
optimizations to ApkDecoder regarding reading compression of resources.arsc
This commit is contained in:
parent
cb5bad5555
commit
c836995ead
@ -99,13 +99,9 @@ public class ApkDecoder {
|
|||||||
// read the resources.arsc checking for STORED vs DEFLATE compression
|
// read the resources.arsc checking for STORED vs DEFLATE compression
|
||||||
// this will determine whether we compress on rebuild or not.
|
// this will determine whether we compress on rebuild or not.
|
||||||
JarFile jf = new JarFile(mApkFile.getAbsoluteFile());
|
JarFile jf = new JarFile(mApkFile.getAbsoluteFile());
|
||||||
Enumeration<?> e = jf.entries();
|
JarEntry je = jf.getJarEntry("resources.arsc");
|
||||||
while(e.hasMoreElements()) {
|
if (je != null) {
|
||||||
JarEntry je = (JarEntry) e.nextElement();
|
setCompressionType(je.getMethod());
|
||||||
if (je.getName().equalsIgnoreCase("resources.arsc")) {
|
|
||||||
setCompressionType(je.getMethod());
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
jf.close();
|
jf.close();
|
||||||
|
|
||||||
@ -302,13 +298,7 @@ public class ApkDecoder {
|
|||||||
private void setCompressionType(int compression) {
|
private void setCompressionType(int compression) {
|
||||||
|
|
||||||
// check for deflate vs stored
|
// check for deflate vs stored
|
||||||
if (compression == ZipEntry.STORED) {
|
mCompressResources = (compression == ZipEntry.STORED) ? false : (compression == ZipEntry.DEFLATED);
|
||||||
mCompressResources = false;
|
|
||||||
} else if (compression == ZipEntry.DEFLATED) {
|
|
||||||
mCompressResources = true;
|
|
||||||
} else {
|
|
||||||
mCompressResources = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private final Androlib mAndrolib;
|
private final Androlib mAndrolib;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user