diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/BaseTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/BaseTest.java index 990b170d..07e2bfd6 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/BaseTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/BaseTest.java @@ -20,10 +20,7 @@ import brut.androlib.meta.MetaInfo; import brut.common.BrutException; import brut.directory.ExtFile; import brut.directory.FileDirectory; -import org.custommonkey.xmlunit.DetailedDiff; -import org.custommonkey.xmlunit.Diff; -import org.custommonkey.xmlunit.ElementNameAndAttributeQualifier; -import org.custommonkey.xmlunit.ElementQualifier; +import org.custommonkey.xmlunit.*; import org.xml.sax.SAXException; import java.io.File; @@ -36,10 +33,11 @@ import java.util.logging.Logger; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; +import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual; public class BaseTest { - void compareUnknownFiles() throws BrutException { + protected void compareUnknownFiles() throws BrutException { MetaInfo control = new Androlib().readMetaFile(sTestOrigDir); MetaInfo test = new Androlib().readMetaFile(sTestNewDir); assertNotNull(control.unknownFiles); @@ -55,7 +53,7 @@ public class BaseTest { } } - void compareBinaryFolder(String path, boolean res) throws BrutException, IOException { + protected void compareBinaryFolder(String path, boolean res) throws BrutException, IOException { Boolean exists = true; String prefixPath = ""; @@ -81,33 +79,33 @@ public class BaseTest { assertTrue(exists); } - void compareResFolder(String path) throws BrutException, IOException { + protected void compareResFolder(String path) throws BrutException, IOException { compareBinaryFolder(path, true); } - void compareLibsFolder(String path) throws BrutException, IOException { + protected void compareLibsFolder(String path) throws BrutException, IOException { compareBinaryFolder(File.separatorChar + path, false); } - void compareAssetsFolder(String path) throws BrutException, IOException { + protected void compareAssetsFolder(String path) throws BrutException, IOException { compareBinaryFolder(File.separatorChar + "assets" + File.separatorChar + path, false); } - void compareValuesFiles(String path) throws BrutException { + protected void compareValuesFiles(String path) throws BrutException { compareXmlFiles("res/" + path, new ElementNameAndAttributeQualifier("name")); } - void compareXmlFiles(String path) throws BrutException { + protected void compareXmlFiles(String path) throws BrutException { compareXmlFiles(path, null); } - void checkFolderExists(String path) { + protected void checkFolderExists(String path) { File f = new File(sTestNewDir, path); assertTrue(f.isDirectory()); } - boolean isTransparent(int pixel) { + protected boolean isTransparent(int pixel) { return pixel >> 24 == 0x00; } @@ -117,15 +115,19 @@ public class BaseTest { Reader control = new FileReader(new File(sTestOrigDir, path)); Reader test = new FileReader(new File(sTestNewDir, path)); + XMLUnit.setIgnoreWhitespace(true); + + if (qualifier == null) { + assertXMLEqual(control, test); + return; + } + diff = new DetailedDiff(new Diff(control, test)); } catch (SAXException | IOException ex) { throw new BrutException(ex); } - if (qualifier != null) { - diff.overrideElementQualifier(qualifier); - } - + diff.overrideElementQualifier(qualifier); assertTrue(path + ": " + diff.getAllDifferences().toString(), diff.similar()); } diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/TestUtils.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/TestUtils.java index 14068eed..f87a654c 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/TestUtils.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/TestUtils.java @@ -115,7 +115,7 @@ public abstract class TestUtils { } } - public static void cleanFrameworkFile() throws AndrolibException, BrutException { + public static void cleanFrameworkFile() throws BrutException { File framework = new File(getFrameworkDir(), "1.apk"); if (Files.exists(framework.toPath())) { diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/AndroidOreoNotSparseTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/AndroidOreoNotSparseTest.java similarity index 97% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/AndroidOreoNotSparseTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/AndroidOreoNotSparseTest.java index 89e415d9..3f4c943e 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/AndroidOreoNotSparseTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/AndroidOreoNotSparseTest.java @@ -14,8 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.aapt1; +import brut.androlib.*; import brut.directory.ExtFile; import brut.common.BrutException; import brut.util.OS; diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/AndroidOreoSparseTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/AndroidOreoSparseTest.java similarity index 93% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/AndroidOreoSparseTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/AndroidOreoSparseTest.java index 409aa336..cd94c15c 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/AndroidOreoSparseTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/AndroidOreoSparseTest.java @@ -14,8 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.aapt1; +import brut.androlib.*; import brut.directory.ExtFile; import brut.common.BrutException; import brut.util.OS; @@ -38,7 +39,7 @@ public class AndroidOreoSparseTest extends BaseTest { sTestOrigDir = new ExtFile(sTmpDir, "issue1594-orig"); sTestNewDir = new ExtFile(sTmpDir, "issue1594-new"); LOGGER.info("Unpacking sparse.apk..."); - TestUtils.copyResourceDir(AndroidOreoNotSparseTest.class, "brut/apktool/issue1594", sTestOrigDir); + TestUtils.copyResourceDir(AndroidOreoSparseTest.class, "brut/apktool/issue1594", sTestOrigDir); File testApk = new File(sTestOrigDir, "sparse.apk"); diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/BuildAndDecodeJarTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/BuildAndDecodeJarTest.java similarity index 91% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/BuildAndDecodeJarTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/BuildAndDecodeJarTest.java index 7485167e..193c37a7 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/BuildAndDecodeJarTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/BuildAndDecodeJarTest.java @@ -14,8 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.aapt1; +import brut.androlib.Androlib; +import brut.androlib.ApkDecoder; +import brut.androlib.BaseTest; +import brut.androlib.TestUtils; import brut.directory.ExtFile; import brut.common.BrutException; import brut.util.OS; @@ -57,7 +61,7 @@ public class BuildAndDecodeJarTest extends BaseTest { } @Test - public void buildAndDecodeTest() throws BrutException { + public void buildAndDecodeTest() { assertTrue(sTestNewDir.isDirectory()); } } \ No newline at end of file diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/BuildAndDecodeTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/BuildAndDecodeTest.java similarity index 91% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/BuildAndDecodeTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/BuildAndDecodeTest.java index 2bef848d..d39efa95 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/BuildAndDecodeTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/BuildAndDecodeTest.java @@ -14,8 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.aapt1; +import brut.androlib.Androlib; +import brut.androlib.ApkDecoder; +import brut.androlib.BaseTest; +import brut.androlib.TestUtils; import brut.directory.ExtFile; import brut.common.BrutException; import brut.util.OS; @@ -63,7 +67,7 @@ public class BuildAndDecodeTest extends BaseTest { } @Test - public void buildAndDecodeTest() throws BrutException { + public void buildAndDecodeTest() { assertTrue(sTestNewDir.isDirectory()); } @@ -244,73 +248,73 @@ public class BuildAndDecodeTest extends BaseTest { } @Test - public void anyDpiTest() throws BrutException, IOException { + public void anyDpiTest() throws BrutException { compareValuesFiles("values-watch/strings.xml"); } @Test - public void packed3CharsTest() throws BrutException, IOException { + public void packed3CharsTest() throws BrutException { compareValuesFiles("values-ast-rES/strings.xml"); } @Test - public void rightToLeftTest() throws BrutException, IOException { + public void rightToLeftTest() throws BrutException { compareValuesFiles("values-ldrtl/strings.xml"); } @Test - public void scriptBcp47Test() throws BrutException, IOException { + public void scriptBcp47Test() throws BrutException { compareValuesFiles("values-b+en+Latn+US/strings.xml"); } @Test - public void threeLetterLangBcp47Test() throws BrutException, IOException { + public void threeLetterLangBcp47Test() throws BrutException { compareValuesFiles("values-ast/strings.xml"); } @Test - public void androidOStringTest() throws BrutException, IOException { + public void androidOStringTest() throws BrutException { compareValuesFiles("values-ast/strings.xml"); } @Test - public void twoLetterNotHandledAsBcpTest() throws BrutException, IOException { + public void twoLetterNotHandledAsBcpTest() { checkFolderExists("res/values-fr"); } @Test - public void twoLetterLangBcp47Test() throws BrutException, IOException { + public void twoLetterLangBcp47Test() throws BrutException { compareValuesFiles("values-en-rUS/strings.xml"); } @Test - public void variantBcp47Test() throws BrutException, IOException { + public void variantBcp47Test() throws BrutException { compareValuesFiles("values-b+en+US+POSIX/strings.xml"); } @Test - public void fourpartBcp47Test() throws BrutException, IOException { + public void fourpartBcp47Test() throws BrutException { compareValuesFiles("values-b+ast+Latn+IT+AREVELA/strings.xml"); } @Test - public void RegionLocaleBcp47Test() throws BrutException, IOException { + public void RegionLocaleBcp47Test() throws BrutException { compareValuesFiles("values-b+en+Latn+419/strings.xml"); } @Test - public void numericalRegionBcp47Test() throws BrutException, IOException { + public void numericalRegionBcp47Test() throws BrutException { compareValuesFiles("values-b+eng+419/strings.xml"); } @Test - public void api23ConfigurationsTest() throws BrutException, IOException { + public void api23ConfigurationsTest() throws BrutException { compareValuesFiles("values-round/strings.xml"); compareValuesFiles("values-notround/strings.xml"); } @Test - public void api26ConfigurationsTest() throws BrutException, IOException { + public void api26ConfigurationsTest() throws BrutException { compareValuesFiles("values-widecg-v26/strings.xml"); compareValuesFiles("values-lowdr-v26/strings.xml"); compareValuesFiles("values-nowidecg-v26/strings.xml"); @@ -318,7 +322,7 @@ public class BuildAndDecodeTest extends BaseTest { } @Test - public void fontTest() throws BrutException, IOException { + public void fontTest() throws BrutException { File fontXml = new File((sTestNewDir + "/res/font"), "lobster.xml"); File fontFile = new File((sTestNewDir + "/res/font"), "lobster_regular.otf"); @@ -367,7 +371,7 @@ public class BuildAndDecodeTest extends BaseTest { } @Test - public void ninePatchImageColorTest() throws BrutException, IOException { + public void ninePatchImageColorTest() throws IOException { char slash = File.separatorChar; String location = slash + "res" + slash + "drawable-xhdpi" + slash; @@ -388,7 +392,7 @@ public class BuildAndDecodeTest extends BaseTest { } @Test - public void issue1508Test() throws BrutException, IOException { + public void issue1508Test() throws IOException { char slash = File.separatorChar; String location = slash + "res" + slash + "drawable-xhdpi" + slash; @@ -409,7 +413,7 @@ public class BuildAndDecodeTest extends BaseTest { } @Test - public void issue1511Test() throws BrutException, IOException { + public void issue1511Test() throws IOException { char slash = File.separatorChar; String location = slash + "res" + slash + "drawable-xxhdpi" + slash; @@ -432,7 +436,7 @@ public class BuildAndDecodeTest extends BaseTest { } @Test - public void robust9patchTest() throws BrutException, IOException { + public void robust9patchTest() throws IOException { String[] ninePatches = {"ic_notification_overlay.9.png", "status_background.9.png", "search_bg_transparent.9.png", "screenshot_panel.9.png", "recents_lower_gradient.9.png"}; diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/DebugTagRetainedTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/DebugTagRetainedTest.java similarity index 95% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/DebugTagRetainedTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/DebugTagRetainedTest.java index 5fc1df83..0f8fe6c2 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/DebugTagRetainedTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/DebugTagRetainedTest.java @@ -14,8 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.aapt1; +import brut.androlib.*; import brut.directory.ExtFile; import brut.common.BrutException; import brut.util.OS; @@ -43,7 +44,7 @@ public class DebugTagRetainedTest extends BaseTest { sTestOrigDir = new ExtFile(sTmpDir, "issue1235-orig"); sTestNewDir = new ExtFile(sTmpDir, "issue1235-new"); LOGGER.info("Unpacking issue1235..."); - TestUtils.copyResourceDir(BuildAndDecodeJarTest.class, "brut/apktool/issue1235/", sTestOrigDir); + TestUtils.copyResourceDir(DebugTagRetainedTest.class, "brut/apktool/issue1235/", sTestOrigDir); LOGGER.info("Building issue1235.apk..."); ApkOptions apkOptions = new ApkOptions(); diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/DefaultBaksmaliVariableTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/DefaultBaksmaliVariableTest.java similarity index 96% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/DefaultBaksmaliVariableTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/DefaultBaksmaliVariableTest.java index a31940e0..9a5d7d50 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/DefaultBaksmaliVariableTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/DefaultBaksmaliVariableTest.java @@ -14,8 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.aapt1; +import brut.androlib.Androlib; +import brut.androlib.ApkDecoder; +import brut.androlib.BaseTest; +import brut.androlib.TestUtils; import brut.common.BrutException; import brut.directory.ExtFile; import brut.util.OS; diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/EmptyResourcesArscTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/EmptyResourcesArscTest.java similarity index 92% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/EmptyResourcesArscTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/EmptyResourcesArscTest.java index 337b9e9e..6de32a81 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/EmptyResourcesArscTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/EmptyResourcesArscTest.java @@ -14,8 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.aapt1; +import brut.androlib.Androlib; +import brut.androlib.ApkDecoder; +import brut.androlib.ApkOptions; +import brut.androlib.TestUtils; import brut.directory.ExtFile; import brut.common.BrutException; import brut.util.OS; @@ -59,7 +63,7 @@ public class EmptyResourcesArscTest { } @Test - public void buildAndDecodeTest() throws BrutException { + public void buildAndDecodeTest() { assertTrue(sTestNewDir.isDirectory()); assertTrue(sTestOrigDir.isDirectory()); } diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/LargeIntsInManifestTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/LargeIntsInManifestTest.java similarity index 93% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/LargeIntsInManifestTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/LargeIntsInManifestTest.java index 025f3a46..9b7bf393 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/LargeIntsInManifestTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/LargeIntsInManifestTest.java @@ -14,8 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.aapt1; +import brut.androlib.Androlib; +import brut.androlib.ApkDecoder; +import brut.androlib.BaseTest; +import brut.androlib.TestUtils; import brut.directory.ExtFile; import brut.common.BrutException; import brut.util.OS; diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/ProviderAttributeTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/ProviderAttributeTest.java similarity index 96% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/ProviderAttributeTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/ProviderAttributeTest.java index 1991bef0..fff0e937 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/ProviderAttributeTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/ProviderAttributeTest.java @@ -14,8 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.aapt1; +import brut.androlib.Androlib; +import brut.androlib.ApkDecoder; +import brut.androlib.BaseTest; +import brut.androlib.TestUtils; import brut.directory.ExtFile; import brut.common.BrutException; import brut.util.OS; diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/ReferenceVersionCodeTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/ReferenceVersionCodeTest.java similarity index 93% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/ReferenceVersionCodeTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/ReferenceVersionCodeTest.java index 1cbe78f5..139f5c2d 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/ReferenceVersionCodeTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/ReferenceVersionCodeTest.java @@ -14,8 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.aapt1; +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; diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/SharedLibraryTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/SharedLibraryTest.java similarity index 98% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/SharedLibraryTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/SharedLibraryTest.java index d7b3a292..9842d7ea 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/SharedLibraryTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/SharedLibraryTest.java @@ -14,8 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.aapt1; +import brut.androlib.*; import brut.directory.ExtFile; import brut.common.BrutException; import brut.util.OS; diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/SkipAssetTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/SkipAssetTest.java similarity index 96% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/SkipAssetTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/SkipAssetTest.java index ec8c4e5e..6762a18b 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/SkipAssetTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/SkipAssetTest.java @@ -14,8 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.aapt1; +import brut.androlib.ApkDecoder; +import brut.androlib.BaseTest; +import brut.androlib.TestUtils; import brut.directory.ExtFile; import brut.common.BrutException; import brut.util.OS; diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/UnknownCompressionTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/UnknownCompressionTest.java similarity index 98% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/UnknownCompressionTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/UnknownCompressionTest.java index be1cf693..c591b997 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/UnknownCompressionTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/aapt1/UnknownCompressionTest.java @@ -14,8 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.aapt1; +import brut.androlib.*; import brut.directory.ExtFile; import brut.common.BrutException; import brut.util.OS; diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/InvalidSdkBoundingTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/androlib/InvalidSdkBoundingTest.java similarity index 97% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/InvalidSdkBoundingTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/androlib/InvalidSdkBoundingTest.java index 5fc16991..c5f888b2 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/InvalidSdkBoundingTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/androlib/InvalidSdkBoundingTest.java @@ -14,8 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.androlib; +import brut.androlib.BaseTest; import brut.androlib.res.AndrolibResources; import java.util.LinkedHashMap; import java.util.Map; diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/AndResGuardTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/AndResGuardTest.java similarity index 93% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/AndResGuardTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/AndResGuardTest.java index e4ffd699..83a34815 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/AndResGuardTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/AndResGuardTest.java @@ -14,8 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.decode; +import brut.androlib.ApkDecoder; +import brut.androlib.BaseTest; +import brut.androlib.TestUtils; import brut.directory.ExtFile; import brut.common.BrutException; import brut.util.OS; diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/DecodeKotlinTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/DecodeKotlinTest.java similarity index 94% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/DecodeKotlinTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/DecodeKotlinTest.java index 4e71e9c8..2eea47bd 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/DecodeKotlinTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/DecodeKotlinTest.java @@ -14,8 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.decode; +import brut.androlib.ApkDecoder; +import brut.androlib.BaseTest; +import brut.androlib.TestUtils; import brut.directory.ExtFile; import brut.common.BrutException; import brut.util.OS; @@ -26,7 +29,6 @@ import org.junit.Test; import java.io.File; import java.io.IOException; -import java.util.logging.Logger; import static org.junit.Assert.assertTrue; diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/DoubleExtensionUnknownFileTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/DoubleExtensionUnknownFileTest.java similarity index 93% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/DoubleExtensionUnknownFileTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/DoubleExtensionUnknownFileTest.java index f160b988..14e5c1ec 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/DoubleExtensionUnknownFileTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/DoubleExtensionUnknownFileTest.java @@ -14,8 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.decode; +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; diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/ExternalEntityTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/ExternalEntityTest.java similarity index 94% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/ExternalEntityTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/ExternalEntityTest.java index a72f350f..65a81244 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/ExternalEntityTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/ExternalEntityTest.java @@ -14,8 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.decode; +import brut.androlib.Androlib; +import brut.androlib.ApkDecoder; +import brut.androlib.BaseTest; +import brut.androlib.TestUtils; import brut.directory.ExtFile; import brut.common.BrutException; import brut.util.OS; diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/ForceManifestDecodeNoResourcesTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/ForceManifestDecodeNoResourcesTest.java similarity index 97% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/ForceManifestDecodeNoResourcesTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/ForceManifestDecodeNoResourcesTest.java index ff890a53..e051db14 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/ForceManifestDecodeNoResourcesTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/ForceManifestDecodeNoResourcesTest.java @@ -14,8 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.decode; +import brut.androlib.ApkDecoder; +import brut.androlib.BaseTest; +import brut.androlib.TestUtils; import brut.common.BrutException; import brut.directory.ExtFile; import brut.util.OS; diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/MinifiedArscTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/MinifiedArscTest.java similarity index 95% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/MinifiedArscTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/MinifiedArscTest.java index 277a2c13..e989a0b7 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/MinifiedArscTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/MinifiedArscTest.java @@ -14,8 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.decode; +import brut.androlib.ApkDecoder; +import brut.androlib.BaseTest; +import brut.androlib.TestUtils; import brut.directory.ExtFile; import brut.common.BrutException; import brut.util.OS; diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/MissingVersionManifestTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/MissingVersionManifestTest.java similarity index 93% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/MissingVersionManifestTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/MissingVersionManifestTest.java index b6bda206..de014ae1 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/MissingVersionManifestTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/MissingVersionManifestTest.java @@ -14,8 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.decode; +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; diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/OutsideOfDirectoryEntryTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/OutsideOfDirectoryEntryTest.java similarity index 89% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/OutsideOfDirectoryEntryTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/OutsideOfDirectoryEntryTest.java index d1b1b7aa..442d32e0 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/OutsideOfDirectoryEntryTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/OutsideOfDirectoryEntryTest.java @@ -14,8 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.decode; +import brut.androlib.ApkDecoder; +import brut.androlib.BaseTest; +import brut.androlib.TestUtils; import brut.common.BrutException; import brut.directory.ExtFile; import brut.util.OS; @@ -37,7 +40,7 @@ public class OutsideOfDirectoryEntryTest extends BaseTest { public static void beforeClass() throws Exception { TestUtils.cleanFrameworkFile(); sTmpDir = new ExtFile(OS.createTempDirectory()); - TestUtils.copyResourceDir(DecodeKotlinTest.class, "brut/apktool/issue1589/", sTmpDir); + TestUtils.copyResourceDir(OutsideOfDirectoryEntryTest.class, "brut/apktool/issue1589/", sTmpDir); String apk = "issue1589.apk"; diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/ParentDirectoryTraversalTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/ParentDirectoryTraversalTest.java similarity index 93% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/ParentDirectoryTraversalTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/ParentDirectoryTraversalTest.java index 3b1a1a74..bc22c0fd 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/ParentDirectoryTraversalTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/ParentDirectoryTraversalTest.java @@ -14,8 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.decode; +import brut.androlib.ApkDecoder; +import brut.androlib.BaseTest; +import brut.androlib.TestUtils; import brut.common.BrutException; import brut.directory.ExtFile; import brut.util.OS; diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/VectorDrawableTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/VectorDrawableTest.java similarity index 94% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/VectorDrawableTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/VectorDrawableTest.java index 503dc8f1..61b05452 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/VectorDrawableTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/decode/VectorDrawableTest.java @@ -14,8 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.decode; +import brut.androlib.ApkDecoder; +import brut.androlib.BaseTest; +import brut.androlib.TestUtils; import brut.common.BrutException; import brut.directory.ExtFile; import brut.util.OS; diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/PositionalEnumerationTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/encoders/PositionalEnumerationTest.java similarity index 97% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/PositionalEnumerationTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/encoders/PositionalEnumerationTest.java index 1ada2f56..d852e57b 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/PositionalEnumerationTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/encoders/PositionalEnumerationTest.java @@ -14,8 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.encoders; +import brut.androlib.BaseTest; import brut.androlib.res.xml.ResXmlEncoders; import org.junit.Test; diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/UnknownDirectoryTraversalTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/util/UnknownDirectoryTraversalTest.java similarity index 96% rename from brut.apktool/apktool-lib/src/test/java/brut/androlib/UnknownDirectoryTraversalTest.java rename to brut.apktool/apktool-lib/src/test/java/brut/androlib/util/UnknownDirectoryTraversalTest.java index a5c46947..3b48a973 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/UnknownDirectoryTraversalTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/util/UnknownDirectoryTraversalTest.java @@ -14,8 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package brut.androlib; +package brut.androlib.util; +import brut.androlib.BaseTest; +import brut.androlib.TestUtils; import brut.common.BrutException; import brut.common.InvalidUnknownFileException; import brut.common.RootUnknownFileException;