From 1422293b71b99806ef0afdf6ae9b8abdfb3087ac Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Sat, 28 Nov 2020 08:02:20 -0500 Subject: [PATCH] fix: set dummy attributes to same type (@null) --- .../main/java/brut/androlib/res/decoder/ARSCDecoder.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 c2a947c859..9bd1727819 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 @@ -516,9 +516,11 @@ private void addMissingResSpecs() throws AndrolibException { mType = mPkg.getOrCreateConfig(new ResConfigFlags()); } - ResValue value = new ResBoolValue(false, 0, null); - ResResource res = new ResResource(mType, spec, value); + // We are going to make dummy attributes a null reference (@null) now instead of a boolean false. + // This is because aapt2 is much more strict when it comes to what we can put in an application. + ResValue value = new ResReferenceValue(mPkg, 0, ""); + ResResource res = new ResResource(mType, spec, value); mPkg.addResource(res); mType.addResource(res); spec.addResource(res);