Skip additional payload data of TYPE chunk

Some APKs' arsc has additional payload data (like TYPE 8 chunks and/or padding) in the TYPE chunk. After the ARSCDecoder read such kind of chunk, it acts erratically. Most of the time, it just stops parsing the ARSC, therefore, some resources are not decoded because they are not in the apktool's resources' spec table.
This commit is contained in:
jamestut 2016-09-18 00:13:19 +07:00 committed by GitHub
parent 64644a1242
commit 52a44776df

View File

@ -154,6 +154,12 @@ public class ARSCDecoder {
while (type == Header.TYPE_TYPE) {
readTableType();
// skip "TYPE 8 chunks" and/or padding data at the end of this chunk
if(mCountIn.getCount() < mHeader.endPosition) {
mCountIn.skip(mHeader.endPosition - mCountIn.getCount());
}
type = nextChunk().type;
addMissingResSpecs();