mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-22 01:37:34 +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;
|
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];
|
block.m_strings = new byte[size];
|
||||||
reader.readFully(block.m_strings);
|
reader.readFully(block.m_strings);
|
||||||
}
|
}
|
||||||
if (stylesOffset != 0) {
|
if (stylesOffset != 0) {
|
||||||
int size = (chunkSize - stylesOffset);
|
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);
|
block.m_styles = reader.readIntArray(size / 4);
|
||||||
|
|
||||||
|
// read remaining bytes
|
||||||
|
int remaining = size % 4;
|
||||||
|
if (remaining >= 1) {
|
||||||
|
while (remaining-- > 0) {
|
||||||
|
reader.readByte();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return block;
|
return block;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user