mirror of
https://github.com/revanced/ARSCLib.git
synced 2025-04-30 06:14:25 +02:00
compress framework zip entries
This commit is contained in:
parent
4ba43a6b5e
commit
c244c37dc8
@ -30,6 +30,7 @@ import com.reandroid.arsc.value.*;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.zip.ZipEntry;
|
||||||
|
|
||||||
public class FrameworkOptimizer {
|
public class FrameworkOptimizer {
|
||||||
private final ApkModule frameworkApk;
|
private final ApkModule frameworkApk;
|
||||||
@ -57,6 +58,9 @@ public class FrameworkOptimizer {
|
|||||||
manifestBlock = frameworkApk.getAndroidManifestBlock();
|
manifestBlock = frameworkApk.getAndroidManifestBlock();
|
||||||
}
|
}
|
||||||
optimizeTable(frameworkTable, manifestBlock);
|
optimizeTable(frameworkTable, manifestBlock);
|
||||||
|
UncompressedFiles uncompressedFiles = frameworkApk.getUncompressedFiles();
|
||||||
|
uncompressedFiles.clearExtensions();
|
||||||
|
uncompressedFiles.clearPaths();
|
||||||
clearFiles(frameworkApk.getApkArchive());
|
clearFiles(frameworkApk.getApkArchive());
|
||||||
logMessage("Optimized");
|
logMessage("Optimized");
|
||||||
}
|
}
|
||||||
@ -69,6 +73,12 @@ public class FrameworkOptimizer {
|
|||||||
InputSource tableSource = archive.getInputSource(TableBlock.FILE_NAME);
|
InputSource tableSource = archive.getInputSource(TableBlock.FILE_NAME);
|
||||||
InputSource manifestSource = archive.getInputSource(AndroidManifestBlock.FILE_NAME);
|
InputSource manifestSource = archive.getInputSource(AndroidManifestBlock.FILE_NAME);
|
||||||
archive.clear();
|
archive.clear();
|
||||||
|
if(tableSource!=null){
|
||||||
|
tableSource.setMethod(ZipEntry.DEFLATED);
|
||||||
|
}
|
||||||
|
if(manifestSource!=null){
|
||||||
|
manifestSource.setMethod(ZipEntry.DEFLATED);
|
||||||
|
}
|
||||||
archive.add(tableSource);
|
archive.add(tableSource);
|
||||||
archive.add(manifestSource);
|
archive.add(manifestSource);
|
||||||
count = count - archive.entriesCount();
|
count = count - archive.entriesCount();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user