mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-06 10:05:54 +01:00
Read res header completely
This commit is contained in:
parent
ba9b4af973
commit
3cdd8243c7
@ -248,6 +248,8 @@ public class ARSCDecoder {
|
||||
private ResConfigFlags readConfigFlags() throws IOException,
|
||||
AndrolibException {
|
||||
int size = mIn.readInt();
|
||||
int read = 0;
|
||||
|
||||
if (size < 28) {
|
||||
throw new AndrolibException("Config size < 28");
|
||||
}
|
||||
@ -283,6 +285,7 @@ public class ARSCDecoder {
|
||||
screenLayout = mIn.readByte();
|
||||
uiMode = mIn.readByte();
|
||||
smallestScreenWidthDp = mIn.readShort();
|
||||
read = 32;
|
||||
}
|
||||
|
||||
short screenWidthDp = 0;
|
||||
@ -290,6 +293,7 @@ public class ARSCDecoder {
|
||||
if (size >= 36) {
|
||||
screenWidthDp = mIn.readShort();
|
||||
screenHeightDp = mIn.readShort();
|
||||
read = 36;
|
||||
}
|
||||
|
||||
char[] localeScript = null;
|
||||
@ -297,6 +301,7 @@ public class ARSCDecoder {
|
||||
if (size >= 48) {
|
||||
localeScript = readScriptOrVariantChar(4).toCharArray();
|
||||
localeVariant = readScriptOrVariantChar(8).toCharArray();
|
||||
read = 48;
|
||||
}
|
||||
|
||||
int exceedingSize = size - KNOWN_CONFIG_BYTES;
|
||||
@ -316,6 +321,11 @@ public class ARSCDecoder {
|
||||
}
|
||||
}
|
||||
|
||||
int remainingSize = size - read;
|
||||
if (remainingSize > 0) {
|
||||
mIn.skipBytes(remainingSize);
|
||||
}
|
||||
|
||||
return new ResConfigFlags(mcc, mnc, language, country,
|
||||
orientation, touchscreen, density, keyboard, navigation,
|
||||
inputFlags, screenWidth, screenHeight, sdkVersion,
|
||||
|
Loading…
Reference in New Issue
Block a user