test: add aapt1/aapt2 tests for "0byte" files

This commit is contained in:
Connor Tumbleson 2018-07-20 15:21:44 -04:00
parent 4bda4674f9
commit abdd536a18
4 changed files with 17 additions and 0 deletions

View File

@ -20,6 +20,7 @@ import brut.androlib.Androlib;
import brut.androlib.ApkDecoder;
import brut.androlib.BaseTest;
import brut.androlib.TestUtils;
import brut.androlib.meta.MetaInfo;
import brut.directory.ExtFile;
import brut.common.BrutException;
import brut.util.OS;
@ -481,6 +482,15 @@ public class BuildAndDecodeTest extends BaseTest {
}
}
@Test
public void confirmZeroByteFileIsNotStored() throws BrutException {
MetaInfo metaInfo = new Androlib().readMetaFile(sTestNewDir);
for (String item : metaInfo.doNotCompress) {
assertNotSame(item, "empty");
}
}
@Test
public void drawableXxhdpiTest() throws BrutException, IOException {
compareResFolder("drawable-xxhdpi");

View File

@ -17,6 +17,7 @@
package brut.androlib.aapt2;
import brut.androlib.*;
import brut.androlib.meta.MetaInfo;
import brut.common.BrutException;
import brut.directory.ExtFile;
import brut.util.OS;
@ -72,6 +73,12 @@ public class BuildAndDecodeTest extends BaseTest {
compareValuesFiles("values/strings.xml");
}
@Test
public void confirmZeroByteFileIsNotStored() throws BrutException {
MetaInfo metaInfo = new Androlib().readMetaFile(sTestNewDir);
assertNull(metaInfo.doNotCompress);
}
@Test
public void navigationResourceTest() throws BrutException {
compareXmlFiles("res/navigation/nav_graph.xml");