mirror of
https://github.com/revanced/Apktool.git
synced 2024-11-06 12:47:03 +01:00
Merge pull request #2527 from LoyieKing/master
support lib/specType out-of-order reading - fix "Invalid chunk type: expected=0x00000200, got=0x00000203"
This commit is contained in:
commit
323935b995
@ -123,12 +123,19 @@ public class ARSCDecoder {
|
||||
mPkg = new ResPackage(mResTable, id, name);
|
||||
|
||||
nextChunk();
|
||||
while (mHeader.type == Header.TYPE_LIBRARY) {
|
||||
readLibraryType();
|
||||
}
|
||||
|
||||
while (mHeader.type == Header.TYPE_SPEC_TYPE) {
|
||||
readTableTypeSpec();
|
||||
boolean flag = true;
|
||||
while (flag) {
|
||||
switch (mHeader.type) {
|
||||
case Header.TYPE_LIBRARY:
|
||||
readLibraryType();
|
||||
break;
|
||||
case Header.TYPE_SPEC_TYPE:
|
||||
readTableTypeSpec();
|
||||
break;
|
||||
default:
|
||||
flag = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return mPkg;
|
||||
|
@ -302,8 +302,8 @@ public class StringBlock {
|
||||
try {
|
||||
return (m_isUTF8 ? UTF8_DECODER : UTF16LE_DECODER).decode(wrappedBuffer).toString();
|
||||
} catch (CharacterCodingException ex) {
|
||||
LOGGER.warning("Failed to decode a string at offset " + offset + " of length " + length);
|
||||
if (!m_isUTF8) {
|
||||
LOGGER.warning("Failed to decode a string at offset " + offset + " of length " + length);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user