mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-08 11:05:52 +01:00
ARSCDecoder.readConfigFlags(): better handling of exceeding flags data.
This commit is contained in:
parent
26f39d622a
commit
3c34705798
@ -260,14 +260,22 @@ public class ARSCDecoder {
|
|||||||
mIn.skipBytes(2);
|
mIn.skipBytes(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
int unknownBytes = size - KNOWN_CONFIG_BYTES;
|
int exceedingSize = size - KNOWN_CONFIG_BYTES;
|
||||||
if (unknownBytes > 0) {
|
if (exceedingSize > 0) {
|
||||||
byte[] buf = new byte[unknownBytes];
|
byte[] buf = new byte[exceedingSize];
|
||||||
mIn.readFully(buf);
|
mIn.readFully(buf);
|
||||||
LOGGER.warning(String.format(
|
BigInteger exceedingBI = new BigInteger(buf);
|
||||||
"Config size > %d. Omitting exceeding bytes: %0" + (unknownBytes * 2) + "X.",
|
|
||||||
KNOWN_CONFIG_BYTES, new BigInteger(buf)));
|
|
||||||
|
|
||||||
|
if (exceedingBI.equals(BigInteger.ZERO)) {
|
||||||
|
LOGGER.fine(String.format(
|
||||||
|
"Config flags size > %d, but exceeding bytes are all zero, so it should be ok.",
|
||||||
|
KNOWN_CONFIG_BYTES));
|
||||||
|
} else {
|
||||||
|
LOGGER.warning(String.format(
|
||||||
|
"Config flags size > %d. Exceeding bytes: %0" + (exceedingSize * 2) + "X.",
|
||||||
|
KNOWN_CONFIG_BYTES, exceedingBI));
|
||||||
|
isInvalid = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ResConfigFlags(mcc, mnc, language, country, orientation,
|
return new ResConfigFlags(mcc, mnc, language, country, orientation,
|
||||||
|
Loading…
Reference in New Issue
Block a user