mirror of
https://github.com/revanced/Apktool.git
synced 2025-05-03 15:24:26 +02: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);
|
mPkg = new ResPackage(mResTable, id, name);
|
||||||
|
|
||||||
nextChunk();
|
nextChunk();
|
||||||
while (mHeader.type == Header.TYPE_LIBRARY) {
|
boolean flag = true;
|
||||||
readLibraryType();
|
while (flag) {
|
||||||
}
|
switch (mHeader.type) {
|
||||||
|
case Header.TYPE_LIBRARY:
|
||||||
while (mHeader.type == Header.TYPE_SPEC_TYPE) {
|
readLibraryType();
|
||||||
readTableTypeSpec();
|
break;
|
||||||
|
case Header.TYPE_SPEC_TYPE:
|
||||||
|
readTableTypeSpec();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
flag = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return mPkg;
|
return mPkg;
|
||||||
|
@ -302,8 +302,8 @@ public class StringBlock {
|
|||||||
try {
|
try {
|
||||||
return (m_isUTF8 ? UTF8_DECODER : UTF16LE_DECODER).decode(wrappedBuffer).toString();
|
return (m_isUTF8 ? UTF8_DECODER : UTF16LE_DECODER).decode(wrappedBuffer).toString();
|
||||||
} catch (CharacterCodingException ex) {
|
} catch (CharacterCodingException ex) {
|
||||||
LOGGER.warning("Failed to decode a string at offset " + offset + " of length " + length);
|
|
||||||
if (!m_isUTF8) {
|
if (!m_isUTF8) {
|
||||||
|
LOGGER.warning("Failed to decode a string at offset " + offset + " of length " + length);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user