Skip to content

Commit

Permalink
fix: handle duplicate res entries during a complex resource (#3347)
Browse files Browse the repository at this point in the history
  • Loading branch information
iBotPeaches committed Sep 30, 2023
1 parent aea1d68 commit f63bbc0
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,12 @@ private ResBagValue readComplexEntry() throws IOException, AndrolibException {
resId = mIn.readInt();
resValue = readValue();

// #2824 - In some applications the res entries are duplicated with the 2nd being malformed.
// AOSP skips this, so we will do the same.
if (resValue == null) {
continue;
}

if (!(resValue instanceof ResScalarValue)) {
resValue = new ResStringValue(resValue.toString(), resValue.getRawIntValue());
}
Expand Down

0 comments on commit f63bbc0

Please sign in to comment.