mirror of
https://github.com/revanced/Apktool.git
synced 2025-05-05 08:14:26 +02:00
fix: only mark as sparse if intended application (#3299)
This commit is contained in:
parent
06c5f462e0
commit
81a7e1e434
@ -270,7 +270,9 @@ public class ARSCDecoder {
|
||||
|
||||
mHeader.checkForUnreadHeader(mIn);
|
||||
|
||||
if ((typeFlags & 0x01) != 0) {
|
||||
// Be sure we don't poison mResTable by marking the application as sparse
|
||||
// Only flag the ResTable as sparse if the main package is not loaded.
|
||||
if ((typeFlags & 0x01) != 0 && !mResTable.isMainPkgLoaded()) {
|
||||
mResTable.setSparseResources(true);
|
||||
}
|
||||
|
||||
|
@ -54,6 +54,7 @@ public class SparseFlagTest extends BaseTest {
|
||||
|
||||
LOGGER.info("Decoding sparse.apk...");
|
||||
Config config = Config.getDefaultConfig();
|
||||
config.frameworkTag = "issue-3298";
|
||||
|
||||
ApkDecoder apkDecoder = new ApkDecoder(config, testApk);
|
||||
ApkInfo apkInfo = apkDecoder.decode(sTestNewDir);
|
||||
@ -70,6 +71,7 @@ public class SparseFlagTest extends BaseTest {
|
||||
|
||||
LOGGER.info("Decoding not-sparse.apk...");
|
||||
Config config = Config.getDefaultConfig();
|
||||
config.frameworkTag = "issue-3298";
|
||||
|
||||
ApkDecoder apkDecoder = new ApkDecoder(config, testApk);
|
||||
ApkInfo apkInfo = apkDecoder.decode(sTestNewDir);
|
||||
|
Loading…
x
Reference in New Issue
Block a user