From 5798c9200f26ce05c9fc5ad423021b3911542ab7 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Fri, 2 Dec 2016 14:28:06 -0500 Subject: [PATCH] Add unit-test (no unicode) - #1369 --- .../java/brut/androlib/BuildAndDecodeTest.java | 14 ++++++++++++++ .../brut/apktool/testapp/assets/txt/no-unicode.txt | 1 + 2 files changed, 15 insertions(+) create mode 100644 brut.apktool/apktool-lib/src/test/resources/brut/apktool/testapp/assets/txt/no-unicode.txt diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/BuildAndDecodeTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/BuildAndDecodeTest.java index 5c5395eb..6a4dace5 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/BuildAndDecodeTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/BuildAndDecodeTest.java @@ -373,6 +373,16 @@ public class BuildAndDecodeTest { compareUnknownFiles(); } + @Test + public void fileAssetTest() throws BrutException, IOException { + compareAssetsFolder("txt"); + } + + @Test + public void unicodeAssetTest() throws BrutException, IOException { + // failure using ∂ (unicode) + } + @Test public void multipleDexTest() throws BrutException, IOException { compareBinaryFolder("/smali_classes2", false); @@ -434,6 +444,10 @@ public class BuildAndDecodeTest { compareBinaryFolder(File.separatorChar + path, false); } + private void compareAssetsFolder(String path) throws BrutException, IOException { + compareBinaryFolder(File.separatorChar + "assets" + File.separatorChar + path, false); + } + private void compareValuesFiles(String path) throws BrutException { compareXmlFiles("res/" + path, new ElementNameAndAttributeQualifier("name")); } diff --git a/brut.apktool/apktool-lib/src/test/resources/brut/apktool/testapp/assets/txt/no-unicode.txt b/brut.apktool/apktool-lib/src/test/resources/brut/apktool/testapp/assets/txt/no-unicode.txt new file mode 100644 index 00000000..3306f918 --- /dev/null +++ b/brut.apktool/apktool-lib/src/test/resources/brut/apktool/testapp/assets/txt/no-unicode.txt @@ -0,0 +1 @@ +This is an empty file. \ No newline at end of file