diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/BuildAndDecodeTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/BuildAndDecodeTest.java index eb6c2cac..4a53ec25 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/BuildAndDecodeTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/BuildAndDecodeTest.java @@ -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"); diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt2/BuildAndDecodeTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt2/BuildAndDecodeTest.java index c15ab9ee..3906f4e1 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt2/BuildAndDecodeTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt2/BuildAndDecodeTest.java @@ -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"); diff --git a/brut.apktool/apktool-lib/src/test/resources/aapt1/testapp/assets/0byte_file.empty b/brut.apktool/apktool-lib/src/test/resources/aapt1/testapp/assets/0byte_file.empty new file mode 100644 index 00000000..e69de29b diff --git a/brut.apktool/apktool-lib/src/test/resources/aapt2/testapp/assets/0byte_file.empty b/brut.apktool/apktool-lib/src/test/resources/aapt2/testapp/assets/0byte_file.empty new file mode 100644 index 00000000..e69de29b