MNC, noticed recently in API 23, is no longer 0 padded. So mnc001 is now mnc1

- Frameworks between froyo and honeycomb have mnc001, etc
 - A size check of ResConfig header for less than 32 (honeycomb) uses old decode method
 - Greater than 32 bytes moves to new decode method of mnc# vs mnc###
This commit is contained in:
Connor Tumbleson
2015-12-01 08:48:31 -06:00
parent 0649d5a638
commit 8374839427
8 changed files with 35 additions and 7 deletions

View File

@ -177,14 +177,14 @@ public class BuildAndDecodeTest {
@Test
public void qualifiersTest() throws BrutException {
compareValuesFiles("values-mcc004-mnc04-en-rUS-ldrtl-sw100dp-w200dp-h300dp"
compareValuesFiles("values-mcc004-mnc4-en-rUS-ldrtl-sw100dp-w200dp-h300dp"
+ "-xlarge-long-round-land-desk-night-xhdpi-finger-keyssoft-12key"
+ "-navhidden-dpad/strings.xml");
}
@Test
public void shortendedMncTest() throws BrutException {
compareValuesFiles("values-mcc001-mnc01/strings.xml");
compareValuesFiles("values-mcc001-mnc1/strings.xml");
}
@Test
@ -192,6 +192,16 @@ public class BuildAndDecodeTest {
compareValuesFiles("values-mnc1/strings.xml");
}
@Test
public void shortMncv2Test() throws BrutException {
compareValuesFiles("values-mcc238-mnc6/strings.xml");
}
@Test
public void longMncTest() throws BrutException {
compareValuesFiles("values-mcc238-mnc870/strings.xml");
}
@Test
public void anyDpiTest() throws BrutException, IOException {
compareValuesFiles("values-watch/strings.xml");

View File

@ -16,11 +16,13 @@
package brut.androlib;
import brut.androlib.res.AndrolibResources;
import brut.common.BrutException;
import brut.directory.*;
import java.io.*;
import java.net.URL;
import java.net.URLDecoder;
import java.nio.file.Files;
import java.util.HashMap;
import java.util.Map;
import org.custommonkey.xmlunit.ElementQualifier;

View File

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

View File

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