From 632da245ab2d35a68adf0208d4078c8754c0b4bf Mon Sep 17 00:00:00 2001 From: maskedeken <52683904+maskedeken@users.noreply.github.com> Date: Thu, 9 May 2024 05:25:28 +0800 Subject: [PATCH] fix kernel mode switch not work (#196) --- .../ui/screens/settings/SettingsViewModel.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/settings/SettingsViewModel.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/settings/SettingsViewModel.kt index f40df18..2d6051f 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/settings/SettingsViewModel.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/settings/SettingsViewModel.kt @@ -182,8 +182,12 @@ constructor( try { rootShell.start() Timber.i("Root shell accepted!") - saveKernelMode(on = true) - saveAmneziaMode(false) + saveSettings( + uiState.value.settings.copy( + isKernelEnabled = true, + isAmneziaEnabled = false, + ), + ) } catch (e: RootShell.RootShellException) { Timber.e(e)