mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-07 10:35:52 +01:00
fix: support skipping entries with NO_ENTRY (-1) flag (#3209)
This commit is contained in:
parent
79f57b070c
commit
03c198c1e4
@ -308,7 +308,7 @@ public class ARSCDecoder {
|
|||||||
|
|
||||||
for (int i : entryOffsetMap.keySet()) {
|
for (int i : entryOffsetMap.keySet()) {
|
||||||
int offset = entryOffsetMap.get(i);
|
int offset = entryOffsetMap.get(i);
|
||||||
if (offset == -1) {
|
if (offset == NO_ENTRY) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
mMissingResSpecMap.put(i, false);
|
mMissingResSpecMap.put(i, false);
|
||||||
@ -318,12 +318,15 @@ public class ARSCDecoder {
|
|||||||
if (mCountIn.getCount() == mHeader.endPosition) {
|
if (mCountIn.getCount() == mHeader.endPosition) {
|
||||||
int remainingEntries = entryCount - i;
|
int remainingEntries = entryCount - i;
|
||||||
LOGGER.warning(String.format("End of chunk hit. Skipping remaining entries (%d) in type: %s",
|
LOGGER.warning(String.format("End of chunk hit. Skipping remaining entries (%d) in type: %s",
|
||||||
remainingEntries, mTypeSpec.getName())
|
remainingEntries, mTypeSpec.getName()
|
||||||
);
|
));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
readEntry(readEntryData());
|
EntryData entryData = readEntryData();
|
||||||
|
if (entryData != null) {
|
||||||
|
readEntry(entryData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// skip "TYPE 8 chunks" and/or padding data at the end of this chunk
|
// skip "TYPE 8 chunks" and/or padding data at the end of this chunk
|
||||||
@ -344,6 +347,10 @@ public class ARSCDecoder {
|
|||||||
|
|
||||||
short flags = mIn.readShort();
|
short flags = mIn.readShort();
|
||||||
int specNamesId = mIn.readInt();
|
int specNamesId = mIn.readInt();
|
||||||
|
if (specNamesId == NO_ENTRY) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
ResValue value = (flags & ENTRY_FLAG_COMPLEX) == 0 ? readValue() : readComplexEntry();
|
ResValue value = (flags & ENTRY_FLAG_COMPLEX) == 0 ? readValue() : readComplexEntry();
|
||||||
EntryData entryData = new EntryData();
|
EntryData entryData = new EntryData();
|
||||||
entryData.mFlags = flags;
|
entryData.mFlags = flags;
|
||||||
@ -662,5 +669,7 @@ public class ARSCDecoder {
|
|||||||
|
|
||||||
private static final int KNOWN_CONFIG_BYTES = 64;
|
private static final int KNOWN_CONFIG_BYTES = 64;
|
||||||
|
|
||||||
|
private static final int NO_ENTRY = 0xFFFFFFFF;
|
||||||
|
|
||||||
private static final Logger LOGGER = Logger.getLogger(ARSCDecoder.class.getName());
|
private static final Logger LOGGER = Logger.getLogger(ARSCDecoder.class.getName());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user