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