fix: handle duplicate res entries during a complex resource (#3347)

This commit is contained in:
Connor Tumbleson 2023-09-30 07:21:58 -04:00 committed by GitHub
parent aea1d68dbc
commit f63bbc0be2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -415,6 +415,12 @@ public class ARSCDecoder {
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());
}