From d2f9f592a568cfd634167056068bccbb7f56c12a Mon Sep 17 00:00:00 2001 From: Mygod Date: Tue, 7 Jul 2020 06:45:52 +0800 Subject: [PATCH] Use the same cacheDir to reuse cache --- .../main/java/be/mygod/vpnhotspot/net/TetheringManager.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/TetheringManager.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/TetheringManager.kt index 208268c9..d99c8229 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/TetheringManager.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/TetheringManager.kt @@ -329,12 +329,8 @@ object TetheringManager { } catch (e: InvocationTargetException) { if (e.targetException is SecurityException) GlobalScope.launch(Dispatchers.Unconfined) { val result = try { - val rootCache = File(cacheDir, "root") - rootCache.mkdirs() - check(rootCache.exists()) { "Creating root cache dir failed" } RootManager.use { - it.execute(be.mygod.vpnhotspot.root.StartTetheringLegacy( - rootCache, type, showProvisioningUi)) + it.execute(be.mygod.vpnhotspot.root.StartTetheringLegacy(cacheDir, type, showProvisioningUi)) }.value } catch (eRoot: Exception) { eRoot.addSuppressed(e)