Skip to content

Commit

Permalink
refactor: extract nextChunk() out of readLibraryType (#3126)
Browse files Browse the repository at this point in the history
  • Loading branch information
iBotPeaches authored Jul 4, 2023
1 parent 79cfdd1 commit 0e3e165
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,11 @@ private ResPackage readTablePackage() throws IOException, AndrolibException {
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;
Expand All @@ -147,8 +149,7 @@ private ResPackage readTablePackage() throws IOException, AndrolibException {
readStagedAliasSpec();
break;
default:
flag = false;
break;
break chunkLoop;
}
}

Expand All @@ -168,9 +169,7 @@ private void readLibraryType() throws AndrolibException, IOException {
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 {
Expand Down

0 comments on commit 0e3e165

Please sign in to comment.