mirror of
https://github.com/revanced/Apktool.git
synced 2025-06-12 13:17:43 +02:00
Fix improper handling of MNC_ZERO
- add test - patch ResConfigFlags
This commit is contained in:
@ -142,8 +142,8 @@ public class ResConfigFlags {
|
||||
StringBuilder ret = new StringBuilder();
|
||||
if (mcc != 0) {
|
||||
ret.append("-mcc").append(String.format("%03d", mcc));
|
||||
if (mcc != MNC_ZERO) {
|
||||
if (mnc != 0 && mnc != -1) {
|
||||
if (mnc != MNC_ZERO) {
|
||||
if (mnc != 0) {
|
||||
ret.append("-mnc");
|
||||
if (mnc > 0 && mnc < 10) {
|
||||
ret.append(String.format("%02d", mnc));
|
||||
@ -151,6 +151,8 @@ public class ResConfigFlags {
|
||||
ret.append(String.format("%03d", mnc));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ret.append("-mnc00");
|
||||
}
|
||||
}
|
||||
if (language[0] != '\00') {
|
||||
@ -438,7 +440,7 @@ public class ResConfigFlags {
|
||||
public final static int DENSITY_ANY = 0xFFFE;
|
||||
public final static int DENSITY_NONE = 0xFFFF;
|
||||
|
||||
public final static int MNC_ZERO = 0xFFFF;
|
||||
public final static int MNC_ZERO = -1;
|
||||
|
||||
public final static short MASK_LAYOUTDIR = 0xc0;
|
||||
public final static short SCREENLAYOUT_LAYOUTDIR_ANY = 0x00;
|
||||
|
@ -93,6 +93,11 @@ public class BuildAndDecodeTest {
|
||||
compareValuesFiles("values-mcc001/colors.xml");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void bug702Test() throws BrutException {
|
||||
compareValuesFiles("values-mcc001-mnc00/strings.xml");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void valuesDimensTest() throws BrutException {
|
||||
compareValuesFiles("values-mcc001/dimens.xml");
|
||||
|
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="test1">test1</string>
|
||||
</resources>
|
Reference in New Issue
Block a user