Skip to content

Commit f63bbc0

Browse files
authored
fix: handle duplicate res entries during a complex resource (#3347)
1 parent aea1d68 commit f63bbc0

File tree

1 file changed

+6
-0
lines changed
  • brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder

1 file changed

+6
-0
lines changed

brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/ARSCDecoder.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,12 @@ private ResBagValue readComplexEntry() throws IOException, AndrolibException {
415415
resId = mIn.readInt();
416416
resValue = readValue();
417417

418+
// #2824 - In some applications the res entries are duplicated with the 2nd being malformed.
419+
// AOSP skips this, so we will do the same.
420+
if (resValue == null) {
421+
continue;
422+
}
423+
418424
if (!(resValue instanceof ResScalarValue)) {
419425
resValue = new ResStringValue(resValue.toString(), resValue.getRawIntValue());
420426
}

0 commit comments

Comments
 (0)