mirror of
https://github.com/revanced/Apktool.git
synced 2024-11-11 06:59:24 +01:00
clear /apktool/framework/1.apk in between tests
This commit is contained in:
parent
d05dc3296a
commit
8689991626
@ -677,7 +677,7 @@ final public class AndrolibResources {
|
||||
}
|
||||
}
|
||||
|
||||
private File getFrameworkDir() throws AndrolibException {
|
||||
public File getFrameworkDir() throws AndrolibException {
|
||||
if (mFrameworkDirectory != null) {
|
||||
return mFrameworkDirectory;
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ public class AndResGuardTest {
|
||||
|
||||
@BeforeClass
|
||||
public static void beforeClass() throws Exception, BrutException {
|
||||
TestUtils.cleanFrameworkFile();
|
||||
sTmpDir = new ExtFile(OS.createTempDirectory());
|
||||
TestUtils.copyResourceDir(LargeIntsInManifestTest.class, "brut/apktool/issue1170/", sTmpDir);
|
||||
}
|
||||
|
@ -34,6 +34,7 @@ public class BuildAndDecodeJarTest {
|
||||
|
||||
@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");
|
||||
|
@ -41,6 +41,8 @@ public class BuildAndDecodeTest {
|
||||
|
||||
@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");
|
||||
|
@ -36,6 +36,7 @@ public class LargeIntsInManifestTest {
|
||||
|
||||
@BeforeClass
|
||||
public static void beforeClass() throws Exception, BrutException {
|
||||
TestUtils.cleanFrameworkFile();
|
||||
sTmpDir = new ExtFile(OS.createTempDirectory());
|
||||
TestUtils.copyResourceDir(LargeIntsInManifestTest.class, "brut/apktool/issue767/", sTmpDir);
|
||||
}
|
||||
|
@ -36,6 +36,7 @@ public class ProviderAttributeTest {
|
||||
|
||||
@BeforeClass
|
||||
public static void beforeClass() throws BrutException {
|
||||
TestUtils.cleanFrameworkFile();
|
||||
sTmpDir = new ExtFile(OS.createTempDirectory());
|
||||
TestUtils.copyResourceDir(ProviderAttributeTest.class, "brut/apktool/issue636/", sTmpDir);
|
||||
}
|
||||
|
@ -35,6 +35,7 @@ public class SharedLibraryTest {
|
||||
|
||||
@BeforeClass
|
||||
public static void beforeClass() throws BrutException {
|
||||
TestUtils.cleanFrameworkFile();
|
||||
sTmpDir = new ExtFile(OS.createTempDirectory());
|
||||
TestUtils.copyResourceDir(SharedLibraryTest.class, "brut/apktool/shared_libraries/", sTmpDir);
|
||||
}
|
||||
|
@ -25,6 +25,8 @@ import java.net.URLDecoder;
|
||||
import java.nio.file.Files;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import brut.util.OS;
|
||||
import org.custommonkey.xmlunit.ElementQualifier;
|
||||
import org.w3c.dom.Element;
|
||||
import org.xmlpull.v1.*;
|
||||
@ -116,6 +118,30 @@ public abstract class TestUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @throws AndrolibException
|
||||
* @throws BrutException
|
||||
*/
|
||||
public static void cleanFrameworkFile() throws AndrolibException, BrutException {
|
||||
File framework = new File(getFrameworkDir(), "1.apk");
|
||||
|
||||
if (Files.exists(framework.toPath())) {
|
||||
OS.rmfile(framework.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return File
|
||||
* @throws AndrolibException
|
||||
*/
|
||||
public static File getFrameworkDir() throws AndrolibException {
|
||||
AndrolibResources androlibResources = new AndrolibResources();
|
||||
androlibResources.apkOptions = new ApkOptions();
|
||||
return androlibResources.getFrameworkDir();
|
||||
}
|
||||
|
||||
public static class ResValueElementQualifier implements ElementQualifier {
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user