From 4389d3b86fb548f0f1db1367be9723cac2ef2f73 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Sun, 27 Aug 2023 13:22:12 -0400 Subject: [PATCH] fix: only mark as sparse if intended application --- .../src/main/java/brut/androlib/res/decoder/ARSCDecoder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/ARSCDecoder.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/ARSCDecoder.java index 16a3395145..4d61d3c050 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/ARSCDecoder.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/ARSCDecoder.java @@ -270,7 +270,9 @@ private ResType readTableType() throws IOException, AndrolibException { mHeader.checkForUnreadHeader(mIn); - if ((typeFlags & 0x01) != 0) { + // Be sure we don't poison mResTable by marking the application as sparse + // When its the framework that might be. + if ((typeFlags & 0x01) != 0 && mPkg.getId() > 2) { mResTable.setSparseResources(true); }