Fix improper handling of MNC_ZERO

- add test
 - patch ResConfigFlags
This commit is contained in:
Connor Tumbleson 2014-12-30 06:08:23 -06:00
parent 4ed8d23c57
commit 20504d1338
4 changed files with 15 additions and 3 deletions

View File

@ -55,6 +55,7 @@ v2.0.0 (TBA)
-Fixed (issue #329) - Fixed issue with incorrectly identifying similarly named strings as ResFileValues. -Fixed (issue #329) - Fixed issue with incorrectly identifying similarly named strings as ResFileValues.
-Fixed (issue #590) - Fixed issue with segfaulting aapt with certain apks. -Fixed (issue #590) - Fixed issue with segfaulting aapt with certain apks.
-Fixed (issue #545) - Fixed issue with undefined attrs w/ updated internal frameworks -Fixed (issue #545) - Fixed issue with undefined attrs w/ updated internal frameworks
-Fixed (issue #702) - Fixed improper handling of MNC_ZERO which caused dupe`d resources
-Fixed issue with APKs with multiple dex files. -Fixed issue with APKs with multiple dex files.
-Fixed issue with using Apktool without smali/baksmali for ApktoolProperties (Thanks teprrr) -Fixed issue with using Apktool without smali/baksmali for ApktoolProperties (Thanks teprrr)
-Fixed issue with non-URI standard characters in apk name (Thanks rover12421) -Fixed issue with non-URI standard characters in apk name (Thanks rover12421)

View File

@ -142,8 +142,8 @@ public class ResConfigFlags {
StringBuilder ret = new StringBuilder(); StringBuilder ret = new StringBuilder();
if (mcc != 0) { if (mcc != 0) {
ret.append("-mcc").append(String.format("%03d", mcc)); ret.append("-mcc").append(String.format("%03d", mcc));
if (mcc != MNC_ZERO) { if (mnc != MNC_ZERO) {
if (mnc != 0 && mnc != -1) { if (mnc != 0) {
ret.append("-mnc"); ret.append("-mnc");
if (mnc > 0 && mnc < 10) { if (mnc > 0 && mnc < 10) {
ret.append(String.format("%02d", mnc)); ret.append(String.format("%02d", mnc));
@ -151,6 +151,8 @@ public class ResConfigFlags {
ret.append(String.format("%03d", mnc)); ret.append(String.format("%03d", mnc));
} }
} }
} else {
ret.append("-mnc00");
} }
} }
if (language[0] != '\00') { if (language[0] != '\00') {
@ -438,7 +440,7 @@ public class ResConfigFlags {
public final static int DENSITY_ANY = 0xFFFE; public final static int DENSITY_ANY = 0xFFFE;
public final static int DENSITY_NONE = 0xFFFF; 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 MASK_LAYOUTDIR = 0xc0;
public final static short SCREENLAYOUT_LAYOUTDIR_ANY = 0x00; public final static short SCREENLAYOUT_LAYOUTDIR_ANY = 0x00;

View File

@ -93,6 +93,11 @@ public class BuildAndDecodeTest {
compareValuesFiles("values-mcc001/colors.xml"); compareValuesFiles("values-mcc001/colors.xml");
} }
@Test
public void bug702Test() throws BrutException {
compareValuesFiles("values-mcc001-mnc00/strings.xml");
}
@Test @Test
public void valuesDimensTest() throws BrutException { public void valuesDimensTest() throws BrutException {
compareValuesFiles("values-mcc001/dimens.xml"); compareValuesFiles("values-mcc001/dimens.xml");

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="test1">test1</string>
</resources>