diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-06-02 19:26:33 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-06-02 19:26:33 +0200 |
commit | 567503abc740e6816fc1a207075a05da8e0f7e8a (patch) | |
tree | 24305a5ee78403d42ec0ff7fabb65ed164838366 /app/src/main | |
parent | 4671f59c67db5576ea340a2f586642b3243c85a4 (diff) |
Backends: print versions somewhere in log
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/com/wireguard/android/backend/GoBackend.java | 2 | ||||
-rw-r--r-- | app/src/main/java/com/wireguard/android/backend/WgQuickBackend.java | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/app/src/main/java/com/wireguard/android/backend/GoBackend.java b/app/src/main/java/com/wireguard/android/backend/GoBackend.java index a6582cd6..21df018e 100644 --- a/app/src/main/java/com/wireguard/android/backend/GoBackend.java +++ b/app/src/main/java/com/wireguard/android/backend/GoBackend.java @@ -187,7 +187,7 @@ public final class GoBackend implements Backend { try (final ParcelFileDescriptor tun = builder.establish()) { if (tun == null) throw new Exception("Unable to create tun device"); - + Log.d(TAG, "Go backend v" + wgVersion()); currentTunnelHandle = wgTurnOn(tunnel.getName(), tun.detachFd(), goConfig); } if (currentTunnelHandle < 0) diff --git a/app/src/main/java/com/wireguard/android/backend/WgQuickBackend.java b/app/src/main/java/com/wireguard/android/backend/WgQuickBackend.java index 6de40431..49b562a0 100644 --- a/app/src/main/java/com/wireguard/android/backend/WgQuickBackend.java +++ b/app/src/main/java/com/wireguard/android/backend/WgQuickBackend.java @@ -109,8 +109,10 @@ public final class WgQuickBackend implements Backend { try (final FileOutputStream stream = new FileOutputStream(tempFile, false)) { stream.write(config.toString().getBytes(StandardCharsets.UTF_8)); } - final String command = String.format("wg-quick %s '%s'", + String command = String.format("wg-quick %s '%s'", state.toString().toLowerCase(), tempFile.getAbsolutePath()); + if (state == State.UP) + command = "cat /sys/module/wireguard/version && " + command; final int result = rootShell.run(null, command); // noinspection ResultOfMethodCallIgnored tempFile.delete(); |