diff options
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/com/wireguard/android/Application.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/src/main/java/com/wireguard/android/Application.java b/app/src/main/java/com/wireguard/android/Application.java index 3ba9814c..f79e4f32 100644 --- a/app/src/main/java/com/wireguard/android/Application.java +++ b/app/src/main/java/com/wireguard/android/Application.java @@ -87,9 +87,13 @@ public class Application extends android.app.Application { sharedPreferences.getBoolean("dark_theme", false) ? AppCompatDelegate.MODE_NIGHT_YES : AppCompatDelegate.MODE_NIGHT_NO); - if (new File("/sys/module/wireguard").exists()) - backend = new WgQuickBackend(getApplicationContext()); - else + if (new File("/sys/module/wireguard").exists()) { + try { + rootShell.start(); + backend = new WgQuickBackend(getApplicationContext()); + } catch (final Exception ignored) { } + } + if (backend == null) backend = new GoBackend(getApplicationContext()); tunnelManager = new TunnelManager(backend, configStore); |