Skip split apks when possible
When the split apks are loaded by appComponentFactory, we skip patching them to reduce the file size.
This commit is contained in:
parent
89b71ebe0a
commit
69438162cd
|
|
@ -233,6 +233,18 @@ public class LSPatch {
|
|||
logger.d("original minSdkVersion: " + minSdkVersion);
|
||||
}
|
||||
|
||||
final boolean skipSplit = apkPaths.size() > 1 && srcApkFile.getName().startsWith("split_") && appComponentFactory == null;
|
||||
if (skipSplit) {
|
||||
logger.i("Packing split apk...");
|
||||
for (StoredEntry entry : srcZFile.entries()) {
|
||||
String name = entry.getCentralDirectoryHeader().getName();
|
||||
if (dstZFile.get(name) != null) continue;
|
||||
if (name.startsWith("META-INF") && (name.endsWith(".SF") || name.endsWith(".MF") || name.endsWith(".RSA"))) continue;
|
||||
srcZFile.addFileLink(name, name);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
logger.i("Patching apk...");
|
||||
// modify manifest
|
||||
final var config = new PatchConfig(useManager, debuggableFlag, overrideVersionCode, sigbypassLevel, originalSignature, appComponentFactory);
|
||||
|
|
|
|||
Loading…
Reference in New Issue