mirror of
https://github.com/revanced/Apktool.git
synced 2025-04-30 22:24:25 +02:00
fix: support alignment towards resTable_entry start (#3452)
This commit is contained in:
parent
bea15e6f12
commit
a375717ade
@ -275,7 +275,7 @@ public class ARSCDecoder {
|
|||||||
int typeFlags = mIn.readByte();
|
int typeFlags = mIn.readByte();
|
||||||
mIn.skipBytes(2); // reserved
|
mIn.skipBytes(2); // reserved
|
||||||
int entryCount = mIn.readInt();
|
int entryCount = mIn.readInt();
|
||||||
mIn.skipInt(); // entriesStart
|
int entriesStart = mIn.readInt();
|
||||||
|
|
||||||
ResConfigFlags flags = readConfigFlags();
|
ResConfigFlags flags = readConfigFlags();
|
||||||
|
|
||||||
@ -313,6 +313,13 @@ public class ARSCDecoder {
|
|||||||
mType = flags.isInvalid && !mKeepBroken ? null : mPkg.getOrCreateConfig(flags);
|
mType = flags.isInvalid && !mKeepBroken ? null : mPkg.getOrCreateConfig(flags);
|
||||||
int noEntry = isOffset16 ? NO_ENTRY_OFFSET16 : NO_ENTRY;
|
int noEntry = isOffset16 ? NO_ENTRY_OFFSET16 : NO_ENTRY;
|
||||||
|
|
||||||
|
// #3428 - In some applications the res entries are padded for alignment.
|
||||||
|
int entriesStartAligned = mHeader.startPosition + entriesStart;
|
||||||
|
if (mIn.position() < entriesStartAligned) {
|
||||||
|
long bytesSkipped = mIn.skip(entriesStartAligned - mIn.position());
|
||||||
|
LOGGER.fine("Skipping: " + bytesSkipped + " byte(s) to align with ResTable_entry start.");
|
||||||
|
}
|
||||||
|
|
||||||
for (int i : entryOffsetMap.keySet()) {
|
for (int i : entryOffsetMap.keySet()) {
|
||||||
mResId = (mResId & 0xffff0000) | i;
|
mResId = (mResId & 0xffff0000) | i;
|
||||||
int offset = entryOffsetMap.get(i);
|
int offset = entryOffsetMap.get(i);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user