Correctly add version qualifier when decoding

- fixes #928
This commit is contained in:
Connor Tumbleson 2015-04-29 07:49:02 -05:00
parent e407fe839b
commit c659df9dce
3 changed files with 10 additions and 8 deletions

View File

@ -359,7 +359,7 @@ public class ResConfigFlags {
ret.append(String.format("-%dx%d", screenHeight, screenWidth)); ret.append(String.format("-%dx%d", screenHeight, screenWidth));
} }
} }
if (sdkVersion > getNaturalSdkVersionRequirement()) { if (sdkVersion > 0 && sdkVersion >= getNaturalSdkVersionRequirement()) {
ret.append("-v").append(sdkVersion); ret.append("-v").append(sdkVersion);
} }
if (isInvalid) { if (isInvalid) {

View File

@ -277,6 +277,11 @@ public class BuildAndDecodeTest {
compareResFolder("drawable-xxhdpi"); compareResFolder("drawable-xxhdpi");
} }
@Test
public void drawableQualifierXxhdpiTest() throws BrutException, IOException {
compareResFolder("drawable-xxhdpi-v4");
}
@Test @Test
public void drawableXxxhdpiTest() throws BrutException, IOException { public void drawableXxxhdpiTest() throws BrutException, IOException {
compareResFolder("drawable-xxxhdpi"); compareResFolder("drawable-xxxhdpi");
@ -308,8 +313,7 @@ public class BuildAndDecodeTest {
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private void compareUnknownFiles() private void compareUnknownFiles() throws BrutException, IOException {
throws BrutException, IOException {
Map<String, Object> control = new Androlib().readMetaFile(sTestOrigDir); Map<String, Object> control = new Androlib().readMetaFile(sTestOrigDir);
Map<String, Object> test = new Androlib().readMetaFile(sTestNewDir); Map<String, Object> test = new Androlib().readMetaFile(sTestNewDir);
assertTrue(control.containsKey("unknownFiles")); assertTrue(control.containsKey("unknownFiles"));
@ -320,13 +324,12 @@ public class BuildAndDecodeTest {
assertTrue(control_files.size() == test_files.size()); assertTrue(control_files.size() == test_files.size());
// Make sure that the compression methods are still the same // Make sure that the compression methods are still the same
for(Map.Entry<String, String> controlEntry : control_files.entrySet()) { for (Map.Entry<String, String> controlEntry : control_files.entrySet()) {
assertTrue(controlEntry.getValue().equals(test_files.get(controlEntry.getKey()))); assertTrue(controlEntry.getValue().equals(test_files.get(controlEntry.getKey())));
} }
} }
private void compareBinaryFolder(String path, boolean res) private void compareBinaryFolder(String path, boolean res) throws BrutException, IOException {
throws BrutException, IOException {
Boolean exists = true; Boolean exists = true;
String tmp = ""; String tmp = "";
@ -374,8 +377,7 @@ public class BuildAndDecodeTest {
assertTrue(f.isDirectory()); assertTrue(f.isDirectory());
} }
private void compareXmlFiles(String path, ElementQualifier qualifier) private void compareXmlFiles(String path, ElementQualifier qualifier) throws BrutException {
throws BrutException {
DetailedDiff diff; DetailedDiff diff;
try { try {
Reader control = new FileReader(new File(sTestOrigDir, path)); Reader control = new FileReader(new File(sTestOrigDir, path));

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB