use of brut.directory.ExtFile in project Apktool by iBotPeaches.
the class DoubleExtensionUnknownFileTest method multipleExtensionUnknownFileTest.
@Test
public void multipleExtensionUnknownFileTest() throws BrutException, IOException {
String apk = "issue1244.apk";
// decode issue1244.apk
ApkDecoder apkDecoder = new ApkDecoder(new File(sTmpDir + File.separator + apk));
ExtFile decodedApk = new ExtFile(sTmpDir + File.separator + apk + ".out");
apkDecoder.setOutDir(new File(sTmpDir + File.separator + apk + ".out"));
apkDecoder.decode();
MetaInfo metaInfo = new Androlib().readMetaFile(decodedApk);
for (String string : metaInfo.doNotCompress) {
if (StringUtils.countMatches(string, ".") > 1) {
assertTrue(string.equalsIgnoreCase("assets/bin/Data/sharedassets1.assets.split0"));
}
}
}
use of brut.directory.ExtFile in project Apktool by iBotPeaches.
the class LargeIntsInManifestTest method checkIfLargeIntsAreHandledTest.
@Test
public void checkIfLargeIntsAreHandledTest() throws BrutException, IOException {
String apk = "issue767.apk";
// decode issue767.apk
ApkDecoder apkDecoder = new ApkDecoder(new File(sTmpDir + File.separator + apk));
sTestOrigDir = new ExtFile(sTmpDir + File.separator + apk + ".out");
apkDecoder.setOutDir(new File(sTmpDir + File.separator + apk + ".out"));
apkDecoder.decode();
// build issue767
ExtFile testApk = new ExtFile(sTmpDir, apk + ".out");
new Androlib().build(testApk, null);
String newApk = apk + ".out" + File.separator + "dist" + File.separator + apk;
// decode issue767 again
apkDecoder = new ApkDecoder(new File(sTmpDir + File.separator + newApk));
sTestNewDir = new ExtFile(sTmpDir + File.separator + apk + ".out.two");
apkDecoder.setOutDir(new File(sTmpDir + File.separator + apk + ".out.two"));
apkDecoder.decode();
compareXmlFiles("AndroidManifest.xml");
}
use of brut.directory.ExtFile in project Apktool by iBotPeaches.
the class MissingVersionManifestTest method beforeClass.
@BeforeClass
public static void beforeClass() throws Exception, BrutException {
TestUtils.cleanFrameworkFile();
sTmpDir = new ExtFile(OS.createTempDirectory());
TestUtils.copyResourceDir(LargeIntsInManifestTest.class, "brut/apktool/issue1264/", sTmpDir);
}
use of brut.directory.ExtFile in project Apktool by iBotPeaches.
the class MissingVersionManifestTest method missingVersionParsesCorrectlyTest.
@Test
public void missingVersionParsesCorrectlyTest() throws BrutException, IOException {
String apk = "issue1264.apk";
// decode issue1264.apk
ApkDecoder apkDecoder = new ApkDecoder(new File(sTmpDir + File.separator + apk));
ExtFile decodedApk = new ExtFile(sTmpDir + File.separator + apk + ".out");
apkDecoder.setOutDir(new File(sTmpDir + File.separator + apk + ".out"));
apkDecoder.decode();
MetaInfo metaInfo = new Androlib().readMetaFile(decodedApk);
assertEquals(null, metaInfo.versionInfo.versionName);
}
use of brut.directory.ExtFile in project Apktool by iBotPeaches.
the class ProviderAttributeTest method beforeClass.
@BeforeClass
public static void beforeClass() throws BrutException {
TestUtils.cleanFrameworkFile();
sTmpDir = new ExtFile(OS.createTempDirectory());
TestUtils.copyResourceDir(ProviderAttributeTest.class, "brut/apktool/issue636/", sTmpDir);
}
Aggregations