From 53e9fe91558f225b06e588c446f59d38387ba3f0 Mon Sep 17 00:00:00 2001 From: LooKeR Date: Tue, 9 Nov 2021 10:59:09 +0530 Subject: [PATCH] Improve: Async Root Uninstall --- .../kotlin/com/looker/droidify/installer/RootInstaller.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/com/looker/droidify/installer/RootInstaller.kt b/src/main/kotlin/com/looker/droidify/installer/RootInstaller.kt index 6bc4c423..f7bd736a 100644 --- a/src/main/kotlin/com/looker/droidify/installer/RootInstaller.kt +++ b/src/main/kotlin/com/looker/droidify/installer/RootInstaller.kt @@ -40,9 +40,7 @@ class RootInstaller(context: Context) : BaseInstaller(context) { withContext(Dispatchers.IO) { launch { Shell.su(installCommand).submit { - if (it.isSuccess) { - Shell.su(deleteCommand).submit() - } + if (it.isSuccess) Shell.su(deleteCommand).submit() } } } @@ -53,7 +51,7 @@ class RootInstaller(context: Context) : BaseInstaller(context) { if (rootInstallerEnabled) { val uninstallCommand = String.format(ROOT_UNINSTALL_PACKAGE, getCurrentUserState, packageName) - withContext(Dispatchers.IO) { launch { Shell.su(uninstallCommand).exec() } } + withContext(Dispatchers.IO) { launch { Shell.su(uninstallCommand).submit() } } } }