mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-23 10:17:33 +01:00
fix: support decoding application with duplicate res entries (#3252)
This commit is contained in:
parent
342ff67a4c
commit
50226e50c1
@ -328,7 +328,6 @@ public class ARSCDecoder {
|
|||||||
return mType;
|
return mType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private EntryData readEntryData() throws IOException, AndrolibException {
|
private EntryData readEntryData() throws IOException, AndrolibException {
|
||||||
short size = mIn.readShort();
|
short size = mIn.readShort();
|
||||||
if (size < 0) {
|
if (size < 0) {
|
||||||
@ -342,6 +341,12 @@ public class ARSCDecoder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ResValue value = (flags & ENTRY_FLAG_COMPLEX) == 0 ? readValue() : readComplexEntry();
|
ResValue value = (flags & ENTRY_FLAG_COMPLEX) == 0 ? readValue() : readComplexEntry();
|
||||||
|
// #2824 - In some applications the res entries are duplicated with the 2nd being malformed.
|
||||||
|
// AOSP skips this, so we will do the same.
|
||||||
|
if (value == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
EntryData entryData = new EntryData();
|
EntryData entryData = new EntryData();
|
||||||
entryData.mFlags = flags;
|
entryData.mFlags = flags;
|
||||||
entryData.mSpecNamesId = specNamesId;
|
entryData.mSpecNamesId = specNamesId;
|
||||||
@ -416,7 +421,11 @@ public class ARSCDecoder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ResIntBasedValue readValue() throws IOException, AndrolibException {
|
private ResIntBasedValue readValue() throws IOException, AndrolibException {
|
||||||
mIn.skipCheckShort((short) 8); // size
|
int size = mIn.readShort();
|
||||||
|
if (size < 8) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
mIn.skipCheckByte((byte) 0); // zero
|
mIn.skipCheckByte((byte) 0); // zero
|
||||||
byte type = mIn.readByte();
|
byte type = mIn.readByte();
|
||||||
int data = mIn.readInt();
|
int data = mIn.readInt();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user