From 0dfa6c4656e4672de5f78058f63ca3d5c99eb05d Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Thu, 3 Jan 2019 16:56:25 -0500 Subject: [PATCH] test: add test to ensure empty ids.xml are generated for aapt1/aapt2 --- .../test/java/brut/androlib/aapt1/BuildAndDecodeTest.java | 5 +++++ .../test/java/brut/androlib/aapt2/BuildAndDecodeTest.java | 5 +++++ .../src/test/resources/aapt1/testapp/res/values/ids.xml | 4 ++++ .../src/test/resources/aapt2/testapp/res/values/attrs.xml | 4 ++++ .../src/test/resources/aapt2/testapp/res/values/ids.xml | 4 ++++ 5 files changed, 22 insertions(+) create mode 100644 brut.apktool/apktool-lib/src/test/resources/aapt1/testapp/res/values/ids.xml create mode 100644 brut.apktool/apktool-lib/src/test/resources/aapt2/testapp/res/values/attrs.xml create mode 100644 brut.apktool/apktool-lib/src/test/resources/aapt2/testapp/res/values/ids.xml 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 4a53ec25..e2992018 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 @@ -198,6 +198,11 @@ public class BuildAndDecodeTest extends BaseTest { compareXmlFiles("res/xml/references.xml"); } + @Test + public void xmlIdsEmptyTest() throws BrutException { + compareXmlFiles("res/values/ids.xml"); + } + @Test public void xmlReferenceAttributeTest() throws BrutException { compareXmlFiles("res/layout/issue1040.xml"); 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 fd1054e5..bd4785de 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 @@ -84,6 +84,11 @@ public class BuildAndDecodeTest extends BaseTest { compareXmlFiles("res/navigation/nav_graph.xml"); } + @Test + public void xmlIdsEmptyTest() throws BrutException { + compareXmlFiles("res/values/ids.xml"); + } + @Test public void leadingDollarSignResourceNameTest() throws BrutException { compareXmlFiles("res/drawable/$avd_hide_password__0.xml"); diff --git a/brut.apktool/apktool-lib/src/test/resources/aapt1/testapp/res/values/ids.xml b/brut.apktool/apktool-lib/src/test/resources/aapt1/testapp/res/values/ids.xml new file mode 100644 index 00000000..de166285 --- /dev/null +++ b/brut.apktool/apktool-lib/src/test/resources/aapt1/testapp/res/values/ids.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/brut.apktool/apktool-lib/src/test/resources/aapt2/testapp/res/values/attrs.xml b/brut.apktool/apktool-lib/src/test/resources/aapt2/testapp/res/values/attrs.xml new file mode 100644 index 00000000..91ded550 --- /dev/null +++ b/brut.apktool/apktool-lib/src/test/resources/aapt2/testapp/res/values/attrs.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/brut.apktool/apktool-lib/src/test/resources/aapt2/testapp/res/values/ids.xml b/brut.apktool/apktool-lib/src/test/resources/aapt2/testapp/res/values/ids.xml new file mode 100644 index 00000000..de166285 --- /dev/null +++ b/brut.apktool/apktool-lib/src/test/resources/aapt2/testapp/res/values/ids.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file