From 31a23ba493a1920ac2eb331788c094de00be89c8 Mon Sep 17 00:00:00 2001 From: Brian Pak Date: Tue, 12 Nov 2019 13:25:23 +0900 Subject: [PATCH] Fix AXML parser to handle obfuscated attribute names This adds an additional check if the attribute namespace belongs to Android namespace, and if so we try to decode using attribute decoder. Fixes #1576. --- .../java/brut/androlib/res/decoder/AXmlResourceParser.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/AXmlResourceParser.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/AXmlResourceParser.java index dc6fdf30..48b06740 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/AXmlResourceParser.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/AXmlResourceParser.java @@ -339,13 +339,12 @@ public class AXmlResourceParser implements XmlResourceParser { // some attributes will return "", we must rely on the resource_id and refer to the frameworks // to match the resource id to the name. ex: 0x101021C = versionName - if (value.length() != 0) { + if (value.length() != 0 && !android_ns.equals(getAttributeNamespace(index))) { return value; } else { try { value = mAttrDecoder.decodeManifestAttr(getAttributeNameResource(index)); } catch (AndrolibException e) { - value = ""; } return value; }