refactor: extract nextChunk() out of readLibraryType (#3126)

This commit is contained in:
Connor Tumbleson 2023-07-04 12:28:49 -04:00 committed by GitHub
parent 79cfdd179c
commit 0e3e165d4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,9 +128,11 @@ public class ARSCDecoder {
mPkg = new ResPackage(mResTable, id, name);
nextChunk();
boolean flag = true;
while (flag) {
chunkLoop:
for (;;) {
switch (mHeader.type) {
case ARSCHeader.XML_TYPE_TYPE:
case ARSCHeader.XML_TYPE_SPEC_TYPE:
readTableTypeSpec();
break;
@ -147,8 +149,7 @@ public class ARSCDecoder {
readStagedAliasSpec();
break;
default:
flag = false;
break;
break chunkLoop;
}
}
@ -168,9 +169,7 @@ public class ARSCDecoder {
LOGGER.info(String.format("Decoding Shared Library (%s), pkgId: %d", packageName, packageId));
}
while(nextChunk().type == ARSCHeader.XML_TYPE_TYPE) {
readTableTypeSpec();
}
nextChunk();
}
private void readStagedAliasSpec() throws IOException {