Application: require rootshell to use wgquick backend

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2018-06-12 05:42:24 +02:00
parent 15e10d8fde
commit 61e3441bfb

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())
if (new File("/sys/module/wireguard").exists()) {
try {
rootShell.start();
backend = new WgQuickBackend(getApplicationContext());
else
} catch (final Exception ignored) { }
}
if (backend == null)
backend = new GoBackend(getApplicationContext());
tunnelManager = new TunnelManager(backend, configStore);