Search in sources :

Example 6 with ExtFile

use of brut.directory.ExtFile in project Apktool by iBotPeaches.

the class BuildAndDecodeJarTest method beforeClass.

@BeforeClass
public static void beforeClass() throws Exception, BrutException {
    TestUtils.cleanFrameworkFile();
    sTmpDir = new ExtFile(OS.createTempDirectory());
    sTestOrigDir = new ExtFile(sTmpDir, "testjar-orig");
    sTestNewDir = new ExtFile(sTmpDir, "testjar-new");
    LOGGER.info("Unpacking testjar...");
    TestUtils.copyResourceDir(BuildAndDecodeJarTest.class, "brut/apktool/testjar/", sTestOrigDir);
    LOGGER.info("Building testjar.jar...");
    File testJar = new File(sTmpDir, "testjar.jar");
    new Androlib().build(sTestOrigDir, testJar);
    LOGGER.info("Decoding testjar.jar...");
    ApkDecoder apkDecoder = new ApkDecoder(testJar);
    apkDecoder.setOutDir(sTestNewDir);
    apkDecoder.decode();
}
Also used : ExtFile(brut.directory.ExtFile) ExtFile(brut.directory.ExtFile) File(java.io.File) BeforeClass(org.junit.BeforeClass)

Example 7 with ExtFile

use of brut.directory.ExtFile in project Apktool by iBotPeaches.

the class BuildAndDecodeTest method beforeClass.

@BeforeClass
public static void beforeClass() throws Exception, BrutException {
    TestUtils.cleanFrameworkFile();
    sTmpDir = new ExtFile(OS.createTempDirectory());
    sTestOrigDir = new ExtFile(sTmpDir, "testapp-orig");
    sTestNewDir = new ExtFile(sTmpDir, "testapp-new");
    LOGGER.info("Unpacking testapp...");
    TestUtils.copyResourceDir(BuildAndDecodeTest.class, "brut/apktool/testapp/", sTestOrigDir);
    LOGGER.info("Building testapp.apk...");
    File testApk = new File(sTmpDir, "testapp.apk");
    new Androlib().build(sTestOrigDir, testApk);
    LOGGER.info("Decoding testapp.apk...");
    ApkDecoder apkDecoder = new ApkDecoder(testApk);
    apkDecoder.setOutDir(sTestNewDir);
    apkDecoder.decode();
}
Also used : ExtFile(brut.directory.ExtFile) ExtFile(brut.directory.ExtFile)

Example 8 with ExtFile

use of brut.directory.ExtFile in project Apktool by iBotPeaches.

the class DebugTagRetainedTest method beforeClass.

@BeforeClass
public static void beforeClass() throws Exception, BrutException {
    TestUtils.cleanFrameworkFile();
    sTmpDir = new ExtFile(OS.createTempDirectory());
    sTestOrigDir = new ExtFile(sTmpDir, "issue1235-orig");
    sTestNewDir = new ExtFile(sTmpDir, "issue1235-new");
    LOGGER.info("Unpacking issue1235...");
    TestUtils.copyResourceDir(BuildAndDecodeJarTest.class, "brut/apktool/issue1235/", sTestOrigDir);
    LOGGER.info("Building issue1235.apk...");
    ApkOptions apkOptions = new ApkOptions();
    apkOptions.debugMode = true;
    File testApk = new File(sTmpDir, "issue1235.apk");
    new Androlib(apkOptions).build(sTestOrigDir, testApk);
    LOGGER.info("Decoding issue1235.apk...");
    ApkDecoder apkDecoder = new ApkDecoder(testApk);
    apkDecoder.setOutDir(sTestNewDir);
    apkDecoder.decode();
}
Also used : ExtFile(brut.directory.ExtFile) File(java.io.File) ExtFile(brut.directory.ExtFile) BeforeClass(org.junit.BeforeClass)

Example 9 with ExtFile

use of brut.directory.ExtFile in project Apktool by iBotPeaches.

the class DoubleExtensionUnknownFileTest method beforeClass.

@BeforeClass
public static void beforeClass() throws Exception, BrutException {
    TestUtils.cleanFrameworkFile();
    sTmpDir = new ExtFile(OS.createTempDirectory());
    TestUtils.copyResourceDir(LargeIntsInManifestTest.class, "brut/apktool/issue1244/", sTmpDir);
}
Also used : ExtFile(brut.directory.ExtFile) BeforeClass(org.junit.BeforeClass)

Example 10 with ExtFile

use of brut.directory.ExtFile in project Apktool by iBotPeaches.

the class LargeIntsInManifestTest method beforeClass.

@BeforeClass
public static void beforeClass() throws Exception, BrutException {
    TestUtils.cleanFrameworkFile();
    sTmpDir = new ExtFile(OS.createTempDirectory());
    TestUtils.copyResourceDir(LargeIntsInManifestTest.class, "brut/apktool/issue767/", sTmpDir);
}
Also used : ExtFile(brut.directory.ExtFile)

Aggregations

ExtFile (brut.directory.ExtFile)31 ZipFile (java.util.zip.ZipFile)12 File (java.io.File)10 BeforeClass (org.junit.BeforeClass)8 Test (org.junit.Test)5 MetaInfo (brut.androlib.meta.MetaInfo)4 AndrolibException (brut.androlib.AndrolibException)2 BrutException (brut.common.BrutException)1 Directory (brut.directory.Directory)1 DirectoryException (brut.directory.DirectoryException)1 FileDirectory (brut.directory.FileDirectory)1