support lib/specType chunk out-of-order reading

This commit is contained in:
wangyilei 2021-03-06 21:58:23 +08:00
parent a8f87a8b16
commit 5a66b2c42d

View File

@ -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;