From 17042a499fe6be91ffa10e41fbe4544e5bb4465d Mon Sep 17 00:00:00 2001 From: REAndroid Date: Tue, 28 Mar 2023 07:32:41 -0400 Subject: [PATCH] fix: load default framework for no resource table apk --- src/main/java/com/reandroid/arsc/decoder/Decoder.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/reandroid/arsc/decoder/Decoder.java b/src/main/java/com/reandroid/arsc/decoder/Decoder.java index 016a5c8..15396a5 100644 --- a/src/main/java/com/reandroid/arsc/decoder/Decoder.java +++ b/src/main/java/com/reandroid/arsc/decoder/Decoder.java @@ -24,6 +24,7 @@ import com.reandroid.arsc.chunk.TableBlock; import com.reandroid.arsc.chunk.xml.AndroidManifestBlock; import com.reandroid.arsc.chunk.xml.ResXmlDocument; import com.reandroid.arsc.group.EntryGroup; +import com.reandroid.arsc.util.FrameworkTable; import com.reandroid.arsc.value.AttributeValue; import com.reandroid.arsc.value.Value; import com.reandroid.arsc.value.ValueType; @@ -141,7 +142,8 @@ public class Decoder { return frameworkApk.getTableBlock(); } catch (IOException ignored) { } - return null; + // Should not reach here but to be safe return dummy + return new FrameworkTable(); } public static Decoder getNullEntryStoreDecoder(){ @@ -149,8 +151,7 @@ public class Decoder { return NULL_ENTRY_STORE_DECODER; } synchronized (Decoder.class){ - TableBlock tableBlock = new TableBlock(); - Decoder decoder = new Decoder(tableBlock, 0x7f); + Decoder decoder = new Decoder(getFramework(), 0x7f); NULL_ENTRY_STORE_DECODER = decoder; return decoder; }