Browse Source

Application: require rootshell to use wgquick backend

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
master
Jason A. Donenfeld 6 years ago
parent
commit
61e3441bfb
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      app/src/main/java/com/wireguard/android/Application.java

+ 7
- 3
app/src/main/java/com/wireguard/android/Application.java View File

@@ -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);


Loading…
Cancel
Save