From f8df056a2c6707b95348313ab71098858d3e3a10 Mon Sep 17 00:00:00 2001 From: Dominic Lemire Date: Wed, 2 Nov 2022 03:56:49 -0700 Subject: [PATCH] fix: overlay spec parsing (#2805) (#2917) --- .../brut/androlib/res/decoder/ARSCDecoder.java | 14 +++++++++++++- 1 file changed, 13 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 a650ec19..351470a8 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 @@ -178,7 +178,19 @@ public class ARSCDecoder { nextChunk(); } - private void readOverlaySpec() throws IOException { + private void readOverlaySpec() throws AndrolibException, IOException { + checkChunkType(Header.XML_TYPE_OVERLAY); + String name = mIn.readNullEndedString(128, true); + String actor = mIn.readNullEndedString(128, true); + LOGGER.fine(String.format("Overlay name: \"%s\", actor: \"%s\")", name, actor)); + + while(nextChunk().type == Header.XML_TYPE_OVERLAY_POLICY) { + readOverlayPolicySpec(); + } + } + + private void readOverlayPolicySpec() throws AndrolibException, IOException { + checkChunkType(Header.XML_TYPE_OVERLAY_POLICY); /* policyFlags */mIn.skipInt(); int count = mIn.readInt();