From f5a12e01bd528b4c15eff48540957b79dd47d02d Mon Sep 17 00:00:00 2001 From: kitadai31 <90122968+kitadai31@users.noreply.github.com> Date: Sat, 7 Sep 2024 11:59:37 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20Empty=20=E2=80=9Ctmp-XXXXXX=E2=80=9D=20d?= =?UTF-8?q?irectory=20keeps=20growing=20in=20cacheDir=20(#2194)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kotlin/app/revanced/manager/flutter/MainActivity.kt | 3 +-- lib/services/manager_api.dart | 7 ------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/android/app/src/main/kotlin/app/revanced/manager/flutter/MainActivity.kt b/android/app/src/main/kotlin/app/revanced/manager/flutter/MainActivity.kt index f0fc99b672..fae87d0361 100644 --- a/android/app/src/main/kotlin/app/revanced/manager/flutter/MainActivity.kt +++ b/android/app/src/main/kotlin/app/revanced/manager/flutter/MainActivity.kt @@ -109,14 +109,13 @@ class MainActivity : FlutterActivity() { "getPatches" -> { val patchBundleFilePath = call.argument("patchBundleFilePath")!! - val cacheDirPath = call.argument("cacheDirPath")!! try { val patchBundleFile = File(patchBundleFilePath) patchBundleFile.setWritable(false) patches = PatchBundleLoader.Dex( patchBundleFile, - optimizedDexDirectory = File(cacheDirPath) + optimizedDexDirectory = codeCacheDir ) } catch (ex: Exception) { return@setMethodCallHandler result.notImplemented() diff --git a/lib/services/manager_api.dart b/lib/services/manager_api.dart index 2eb4b3bb73..fa3f0d6920 100644 --- a/lib/services/manager_api.dart +++ b/lib/services/manager_api.dart @@ -427,19 +427,12 @@ class ManagerAPI { return patches; } final File? patchBundleFile = await downloadPatches(); - final Directory appCache = await getTemporaryDirectory(); - Directory('${appCache.path}/cache').createSync(); - final Directory workDir = - Directory('${appCache.path}/cache').createTempSync('tmp-'); - final Directory cacheDir = Directory('${workDir.path}/cache'); - cacheDir.createSync(); if (patchBundleFile != null) { try { final String patchesJson = await PatcherAPI.patcherChannel.invokeMethod( 'getPatches', { 'patchBundleFilePath': patchBundleFile.path, - 'cacheDirPath': cacheDir.path, }, ); final List patchesJsonList = jsonDecode(patchesJson);