diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-12-16 06:17:27 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-12-16 07:07:05 +0100 |
commit | b7a6b44ec1df88ac83955d2ae7a01a7b705b9550 (patch) | |
tree | 64ab58469228267e0b5d9f6b67f2f6a2dce71a54 /app/src/main/java/com/wireguard/android/backends/VpnService.java | |
parent | 6d1117a94c80f93689f5f42cc239820a024240c5 (diff) |
RootShell: rewrite
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main/java/com/wireguard/android/backends/VpnService.java')
-rw-r--r-- | app/src/main/java/com/wireguard/android/backends/VpnService.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/src/main/java/com/wireguard/android/backends/VpnService.java b/app/src/main/java/com/wireguard/android/backends/VpnService.java index 5e254d2e..ad16fb36 100644 --- a/app/src/main/java/com/wireguard/android/backends/VpnService.java +++ b/app/src/main/java/com/wireguard/android/backends/VpnService.java @@ -14,6 +14,8 @@ import android.os.IBinder; import android.preference.PreferenceManager; import android.provider.OpenableColumns; import android.service.quicksettings.TileService; +import android.system.ErrnoException; +import android.system.OsConstants; import android.util.Log; import android.widget.Toast; @@ -48,7 +50,7 @@ public class VpnService extends Service public static final String KEY_ENABLED_CONFIGS = "enabled_configs"; public static final String KEY_PRIMARY_CONFIG = "primary_config"; public static final String KEY_RESTORE_ON_BOOT = "restore_on_boot"; - private static final String TAG = "VpnService"; + private static final String TAG = "WireGuard/VpnService"; private static VpnService instance; private final IBinder binder = new Binder(); @@ -275,7 +277,7 @@ public class VpnService extends Service Log.i(TAG, "Running wg-quick up for " + config.getName()); final File configFile = new File(getFilesDir(), config.getName() + ".conf"); final int ret = rootShell.run(null, "wg-quick up '" + configFile.getPath() + "'"); - if (ret == 13 /* EPERM */) + if (ret == OsConstants.EACCES) return -0xfff0002; return ret; } |