Application: require rootshell to use wgquick backend
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
15e10d8fde
commit
61e3441bfb
@ -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…
Reference in New Issue
Block a user