Handle APKs with NULL padding on StringPools

- issue 664
This commit is contained in:
Connor Tumbleson
2014-10-05 12:05:08 -05:00
parent 76bf5ead25
commit 62db52fe7b
2 changed files with 19 additions and 6 deletions

View File

@ -62,7 +62,17 @@ public class ExtDataInput extends DataInputDelegate {
byte got = readByte();
if (got != expected) {
throw new IOException(String.format(
"Expected: 0x%08x, got: 0x%08x", expected, got));
"Expected: 0x%08x, got: 0x%08x", expected, got));
}
}
public void skipCheckChunkTypeInt(int expected, int possible) throws IOException {
int got = readInt();
if (got == possible) {
skipCheckChunkTypeInt(expected, -1);
} else if (got != expected) {
throw new IOException(String.format("Expected: 0x%08x, got: 0x%08x", expected, got));
}
}