mirror of
https://github.com/revanced/Apktool.git
synced 2024-12-11 21:37:47 +01:00
Cleanup trailing temp files/folders (#2742)
* test: add missing afterClass to cleanup BRUT* directory * fix: properly cleanup apkFile temp after buildManifest
This commit is contained in:
parent
86856a69d7
commit
ddc4bb360a
@ -562,6 +562,8 @@ public class Androlib {
|
|||||||
|
|
||||||
Directory tmpDir = new ExtFile(apkFile).getDirectory();
|
Directory tmpDir = new ExtFile(apkFile).getDirectory();
|
||||||
tmpDir.copyToDir(apkDir, APK_MANIFEST_FILENAMES);
|
tmpDir.copyToDir(apkDir, APK_MANIFEST_FILENAMES);
|
||||||
|
|
||||||
|
apkFile.delete();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} catch (IOException | DirectoryException ex) {
|
} catch (IOException | DirectoryException ex) {
|
||||||
|
@ -26,6 +26,7 @@ import brut.directory.ExtFile;
|
|||||||
import brut.util.BrutIO;
|
import brut.util.BrutIO;
|
||||||
import brut.util.OS;
|
import brut.util.OS;
|
||||||
import brut.util.OSDetection;
|
import brut.util.OSDetection;
|
||||||
|
import org.junit.AfterClass;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
@ -43,6 +44,11 @@ public class UnknownDirectoryTraversalTest extends BaseTest {
|
|||||||
TestUtils.copyResourceDir(UnknownDirectoryTraversalTest.class, "util/traversal", sTmpDir);
|
TestUtils.copyResourceDir(UnknownDirectoryTraversalTest.class, "util/traversal", sTmpDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AfterClass
|
||||||
|
public static void afterClass() throws BrutException {
|
||||||
|
OS.rmdir(sTmpDir);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void validFileTest() throws IOException, BrutException {
|
public void validFileTest() throws IOException, BrutException {
|
||||||
String validFilename = BrutIO.sanitizeUnknownFile(sTmpDir, "file");
|
String validFilename = BrutIO.sanitizeUnknownFile(sTmpDir, "file");
|
||||||
|
Loading…
Reference in New Issue
Block a user