mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-22 09:47:34 +01:00
Added API 23 qualifier "roundness"
This commit is contained in:
parent
0abaab1173
commit
a29839bab2
@ -51,6 +51,8 @@ public class ResConfigFlags {
|
|||||||
private final char[] localeScript;
|
private final char[] localeScript;
|
||||||
private final char[] localeVariant;
|
private final char[] localeVariant;
|
||||||
|
|
||||||
|
private final byte screenLayout2;
|
||||||
|
|
||||||
public final boolean isInvalid;
|
public final boolean isInvalid;
|
||||||
|
|
||||||
private final String mQualifiers;
|
private final String mQualifiers;
|
||||||
@ -76,6 +78,7 @@ public class ResConfigFlags {
|
|||||||
screenHeightDp = 0;
|
screenHeightDp = 0;
|
||||||
localeScript = null;
|
localeScript = null;
|
||||||
localeVariant = null;
|
localeVariant = null;
|
||||||
|
screenLayout2 = 0;
|
||||||
isInvalid = false;
|
isInvalid = false;
|
||||||
mQualifiers = "";
|
mQualifiers = "";
|
||||||
}
|
}
|
||||||
@ -87,7 +90,7 @@ public class ResConfigFlags {
|
|||||||
short sdkVersion, byte screenLayout, byte uiMode,
|
short sdkVersion, byte screenLayout, byte uiMode,
|
||||||
short smallestScreenWidthDp, short screenWidthDp,
|
short smallestScreenWidthDp, short screenWidthDp,
|
||||||
short screenHeightDp, char[] localeScript, char[] localeVariant,
|
short screenHeightDp, char[] localeScript, char[] localeVariant,
|
||||||
boolean isInvalid) {
|
byte screenLayout2, boolean isInvalid) {
|
||||||
if (orientation < 0 || orientation > 3) {
|
if (orientation < 0 || orientation > 3) {
|
||||||
LOGGER.warning("Invalid orientation value: " + orientation);
|
LOGGER.warning("Invalid orientation value: " + orientation);
|
||||||
orientation = 0;
|
orientation = 0;
|
||||||
@ -150,6 +153,7 @@ public class ResConfigFlags {
|
|||||||
this.screenHeightDp = screenHeightDp;
|
this.screenHeightDp = screenHeightDp;
|
||||||
this.localeScript = localeScript;
|
this.localeScript = localeScript;
|
||||||
this.localeVariant = localeVariant;
|
this.localeVariant = localeVariant;
|
||||||
|
this.screenLayout2 = screenLayout2;
|
||||||
this.isInvalid = isInvalid;
|
this.isInvalid = isInvalid;
|
||||||
mQualifiers = generateQualifiers();
|
mQualifiers = generateQualifiers();
|
||||||
}
|
}
|
||||||
@ -216,6 +220,14 @@ public class ResConfigFlags {
|
|||||||
ret.append("-notlong");
|
ret.append("-notlong");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
switch (screenLayout2 & MASK_SCREENROUND) {
|
||||||
|
case SCREENLAYOUT_ROUND_NO:
|
||||||
|
ret.append("-notround");
|
||||||
|
break;
|
||||||
|
case SCREENLAYOUT_ROUND_YES:
|
||||||
|
ret.append("-round");
|
||||||
|
break;
|
||||||
|
}
|
||||||
switch (orientation) {
|
switch (orientation) {
|
||||||
case ORIENTATION_PORT:
|
case ORIENTATION_PORT:
|
||||||
ret.append("-port");
|
ret.append("-port");
|
||||||
@ -373,6 +385,9 @@ public class ResConfigFlags {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private short getNaturalSdkVersionRequirement() {
|
private short getNaturalSdkVersionRequirement() {
|
||||||
|
if ((screenLayout2 & MASK_SCREENROUND) != 0) {
|
||||||
|
return SDK_MNC;
|
||||||
|
}
|
||||||
if (density == DENSITY_ANY) {
|
if (density == DENSITY_ANY) {
|
||||||
return SDK_LOLLIPOP;
|
return SDK_LOLLIPOP;
|
||||||
}
|
}
|
||||||
@ -479,6 +494,7 @@ public class ResConfigFlags {
|
|||||||
public final static byte SDK_KITKAT = 19;
|
public final static byte SDK_KITKAT = 19;
|
||||||
public final static byte SDK_LOLLIPOP = 21;
|
public final static byte SDK_LOLLIPOP = 21;
|
||||||
public final static byte SDK_LOLLIPOP_MR1 = 22;
|
public final static byte SDK_LOLLIPOP_MR1 = 22;
|
||||||
|
public final static byte SDK_MNC = 23;
|
||||||
|
|
||||||
public final static byte ORIENTATION_ANY = 0;
|
public final static byte ORIENTATION_ANY = 0;
|
||||||
public final static byte ORIENTATION_PORT = 1;
|
public final static byte ORIENTATION_PORT = 1;
|
||||||
@ -510,6 +526,11 @@ public class ResConfigFlags {
|
|||||||
public final static short SCREENLAYOUT_LAYOUTDIR_RTL = 0x80;
|
public final static short SCREENLAYOUT_LAYOUTDIR_RTL = 0x80;
|
||||||
public final static short SCREENLAYOUT_LAYOUTDIR_SHIFT = 0x06;
|
public final static short SCREENLAYOUT_LAYOUTDIR_SHIFT = 0x06;
|
||||||
|
|
||||||
|
public final static short MASK_SCREENROUND = 0x03;
|
||||||
|
public final static short SCREENLAYOUT_ROUND_ANY = 0;
|
||||||
|
public final static short SCREENLAYOUT_ROUND_NO = 0x1;
|
||||||
|
public final static short SCREENLAYOUT_ROUND_YES = 0x2;
|
||||||
|
|
||||||
public final static byte KEYBOARD_ANY = 0;
|
public final static byte KEYBOARD_ANY = 0;
|
||||||
public final static byte KEYBOARD_NOKEYS = 1;
|
public final static byte KEYBOARD_NOKEYS = 1;
|
||||||
public final static byte KEYBOARD_QWERTY = 2;
|
public final static byte KEYBOARD_QWERTY = 2;
|
||||||
|
@ -320,6 +320,13 @@ public class ARSCDecoder {
|
|||||||
read = 48;
|
read = 48;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
byte screenLayout2 = 0;
|
||||||
|
if (size >= 52) {
|
||||||
|
screenLayout2 = mIn.readByte();
|
||||||
|
mIn.skipBytes(3); // reserved padding
|
||||||
|
read = 52;
|
||||||
|
}
|
||||||
|
|
||||||
int exceedingSize = size - KNOWN_CONFIG_BYTES;
|
int exceedingSize = size - KNOWN_CONFIG_BYTES;
|
||||||
if (exceedingSize > 0) {
|
if (exceedingSize > 0) {
|
||||||
byte[] buf = new byte[exceedingSize];
|
byte[] buf = new byte[exceedingSize];
|
||||||
@ -347,7 +354,7 @@ public class ARSCDecoder {
|
|||||||
orientation, touchscreen, density, keyboard, navigation,
|
orientation, touchscreen, density, keyboard, navigation,
|
||||||
inputFlags, screenWidth, screenHeight, sdkVersion,
|
inputFlags, screenWidth, screenHeight, sdkVersion,
|
||||||
screenLayout, uiMode, smallestScreenWidthDp, screenWidthDp,
|
screenLayout, uiMode, smallestScreenWidthDp, screenWidthDp,
|
||||||
screenHeightDp, localeScript, localeVariant, isInvalid);
|
screenHeightDp, localeScript, localeVariant, screenLayout2, isInvalid);
|
||||||
}
|
}
|
||||||
|
|
||||||
private char[] unpackLanguageOrRegion(byte in0, byte in1, char base) throws AndrolibException {
|
private char[] unpackLanguageOrRegion(byte in0, byte in1, char base) throws AndrolibException {
|
||||||
@ -475,7 +482,7 @@ public class ARSCDecoder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static final Logger LOGGER = Logger.getLogger(ARSCDecoder.class.getName());
|
private static final Logger LOGGER = Logger.getLogger(ARSCDecoder.class.getName());
|
||||||
private static final int KNOWN_CONFIG_BYTES = 48;
|
private static final int KNOWN_CONFIG_BYTES = 52;
|
||||||
|
|
||||||
public static class ARSCData {
|
public static class ARSCData {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user