diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-10-28 19:10:04 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-10-29 16:42:36 +0200 |
commit | a03ad51622d338d1c116aa8cae3c0effb1b7bcf2 (patch) | |
tree | 5bb6bcd061d5ec60c1ec5f305facca4f7ab56217 /ui/src/main/java/com/wireguard/android/activity | |
parent | 447b06ec2c7e279a94f9c6519862874298ad89ef (diff) |
tunnel: remove kernel module downloader
Nathan Chance dropped the ball repeatedly and never maintained this in a
consistent way that anybody could use. With Android 12 out now, just
drop it all together. A bummer, but I don't see much of a choice.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui/src/main/java/com/wireguard/android/activity')
-rw-r--r-- | ui/src/main/java/com/wireguard/android/activity/SettingsActivity.kt | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/ui/src/main/java/com/wireguard/android/activity/SettingsActivity.kt b/ui/src/main/java/com/wireguard/android/activity/SettingsActivity.kt index 06091cae..4196797c 100644 --- a/ui/src/main/java/com/wireguard/android/activity/SettingsActivity.kt +++ b/ui/src/main/java/com/wireguard/android/activity/SettingsActivity.kt @@ -17,7 +17,6 @@ import com.wireguard.android.R import com.wireguard.android.backend.WgQuickBackend import com.wireguard.android.preference.PreferencesPreferenceDataStore import com.wireguard.android.util.AdminKnobs -import com.wireguard.android.util.ModuleLoader import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext @@ -79,30 +78,19 @@ class SettingsActivity : ThemeChangeAwareActivity() { startActivity(Intent(requireContext(), LogViewerActivity::class.java)) true } - val moduleInstaller = preferenceManager.findPreference<Preference>("module_downloader") - val kernelModuleDisabler = preferenceManager.findPreference<Preference>("kernel_module_disabler") - moduleInstaller?.isVisible = false - if (ModuleLoader.isModuleLoaded()) { - moduleInstaller?.parent?.removePreference(moduleInstaller) + val kernelModuleEnabler = preferenceManager.findPreference<Preference>("kernel_module_enabler") + if (WgQuickBackend.hasKernelSupport()) { lifecycleScope.launch { if (Application.getBackend() !is WgQuickBackend) { try { withContext(Dispatchers.IO) { Application.getRootShell().start() } } catch (_: Throwable) { - kernelModuleDisabler?.parent?.removePreference(kernelModuleDisabler) + kernelModuleEnabler?.parent?.removePreference(kernelModuleEnabler) } } } } else { - kernelModuleDisabler?.parent?.removePreference(kernelModuleDisabler) - lifecycleScope.launch { - try { - withContext(Dispatchers.IO) { Application.getRootShell().start() } - moduleInstaller?.isVisible = true - } catch (_: Throwable) { - moduleInstaller?.parent?.removePreference(moduleInstaller) - } - } + kernelModuleEnabler?.parent?.removePreference(kernelModuleEnabler) } } } |