diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-06-12 05:42:24 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-06-12 05:42:24 +0200 |
commit | 61e3441bfb01dfead97102b2e5b3f07aa17182a4 (patch) | |
tree | f5b55d0a2a967c3b5cdd2d850bc319acfe981248 /app/src/main/java/com/wireguard | |
parent | 15e10d8fde986b4956db3905b4ce2f1293779e57 (diff) |
Application: require rootshell to use wgquick backend
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main/java/com/wireguard')
-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); |