mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-21 09:17:35 +01:00
JEB - Fix decompressor when string arrays aren't 4-byte aligned
This commit is contained in:
parent
a7d8ca9086
commit
9b1c7d22ef
@ -62,18 +62,20 @@ public class StringBlock {
|
||||
}
|
||||
{
|
||||
int size = ((stylesOffset == 0) ? chunkSize : stylesOffset) - stringsOffset;
|
||||
if ((size % 4) != 0) {
|
||||
throw new IOException("String data size is not multiple of 4 (" + size + ").");
|
||||
}
|
||||
block.m_strings = new byte[size];
|
||||
reader.readFully(block.m_strings);
|
||||
}
|
||||
if (stylesOffset != 0) {
|
||||
int size = (chunkSize - stylesOffset);
|
||||
if ((size % 4) != 0) {
|
||||
throw new IOException("Style data size is not multiple of 4 (" + size + ").");
|
||||
}
|
||||
block.m_styles = reader.readIntArray(size / 4);
|
||||
|
||||
// read remaining bytes
|
||||
int remaining = size % 4;
|
||||
if (remaining >= 1) {
|
||||
while (remaining-- > 0) {
|
||||
reader.readByte();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return block;
|
||||
|
Loading…
x
Reference in New Issue
Block a user