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);