summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-02-12 18:04:36 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2021-02-12 18:08:38 +0100
commit8523979c9c2540b3d1db544674731ccc624f6f96 (patch)
tree5081bf00f4d8fa2a7a4006378bbb73b51c1ec232
parent8768acee68be592c1823bb5dfe316ca3e730b31c (diff)
tunnel: report git commit as wgVersion
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java2
-rw-r--r--tunnel/tools/libwg-go/api-android.go17
-rw-r--r--tunnel/tools/libwg-go/go.mod2
-rw-r--r--tunnel/tools/libwg-go/go.sum4
-rw-r--r--ui/src/main/res/values-de/strings.xml2
-rw-r--r--ui/src/main/res/values-es-rES/strings.xml2
-rw-r--r--ui/src/main/res/values-fr/strings.xml2
-rw-r--r--ui/src/main/res/values-hi-rIN/strings.xml2
-rw-r--r--ui/src/main/res/values-hi/strings.xml2
-rw-r--r--ui/src/main/res/values-id/strings.xml2
-rw-r--r--ui/src/main/res/values-it/strings.xml2
-rw-r--r--ui/src/main/res/values-ja/strings.xml2
-rw-r--r--ui/src/main/res/values-pa-rIN/strings.xml2
-rw-r--r--ui/src/main/res/values-pl-rPL/strings.xml2
-rw-r--r--ui/src/main/res/values-ro-rRO/strings.xml2
-rw-r--r--ui/src/main/res/values-ru/strings.xml2
-rw-r--r--ui/src/main/res/values-sl/strings.xml2
-rw-r--r--ui/src/main/res/values-tr-rTR/strings.xml2
-rw-r--r--ui/src/main/res/values-zh-rCN/strings.xml2
-rw-r--r--ui/src/main/res/values/strings.xml2
20 files changed, 36 insertions, 21 deletions
diff --git a/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java b/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java
index 85c60349..c7381487 100644
--- a/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java
+++ b/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java
@@ -278,7 +278,7 @@ public final class GoBackend implements Backend {
try (final ParcelFileDescriptor tun = builder.establish()) {
if (tun == null)
throw new BackendException(Reason.TUN_CREATION_ERROR);
- Log.d(TAG, "Go backend v" + wgVersion());
+ Log.d(TAG, "Go backend " + wgVersion());
currentTunnelHandle = wgTurnOn(tunnel.getName(), tun.detachFd(), goConfig);
}
if (currentTunnelHandle < 0)
diff --git a/tunnel/tools/libwg-go/api-android.go b/tunnel/tools/libwg-go/api-android.go
index 5fce4705..5e85d086 100644
--- a/tunnel/tools/libwg-go/api-android.go
+++ b/tunnel/tools/libwg-go/api-android.go
@@ -16,6 +16,8 @@ import (
"os"
"os/signal"
"runtime"
+ "runtime/debug"
+ "strings"
"unsafe"
"golang.org/x/sys/unix"
@@ -206,7 +208,20 @@ func wgGetConfig(tunnelHandle int32) *C.char {
//export wgVersion
func wgVersion() *C.char {
- return C.CString(device.WireGuardGoVersion)
+ info, ok := debug.ReadBuildInfo()
+ if !ok {
+ return C.CString("unknown")
+ }
+ for _, dep := range info.Deps {
+ if dep.Path == "golang.zx2c4.com/wireguard" {
+ parts := strings.Split(dep.Version, "-")
+ if len(parts) == 3 && len(parts[2]) == 12 {
+ return C.CString(parts[2][:7])
+ }
+ return C.CString(dep.Version)
+ }
+ }
+ return C.CString("unknown")
}
func main() {}
diff --git a/tunnel/tools/libwg-go/go.mod b/tunnel/tools/libwg-go/go.mod
index 8422b2bc..de0a4fda 100644
--- a/tunnel/tools/libwg-go/go.mod
+++ b/tunnel/tools/libwg-go/go.mod
@@ -5,5 +5,5 @@ go 1.15
require (
golang.org/x/net v0.0.0-20210119194325-5f4716e94777 // indirect
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c
- golang.zx2c4.com/wireguard v0.0.0-20210211144856-ef8115f63b22
+ golang.zx2c4.com/wireguard v0.0.0-20210212170059-7a0fb5bbb172
)
diff --git a/tunnel/tools/libwg-go/go.sum b/tunnel/tools/libwg-go/go.sum
index 391f9d6f..f11afd8b 100644
--- a/tunnel/tools/libwg-go/go.sum
+++ b/tunnel/tools/libwg-go/go.sum
@@ -18,5 +18,5 @@ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9sn
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-golang.zx2c4.com/wireguard v0.0.0-20210211144856-ef8115f63b22 h1:7Ct1Jps4o4u2hBFWrg8Rt65VmXfMPTeR0OSXxdq8gMk=
-golang.zx2c4.com/wireguard v0.0.0-20210211144856-ef8115f63b22/go.mod h1:r0ExowOoGFfDoLDxx+M9SYbNVsoZ0xviLL+K4f2mt+A=
+golang.zx2c4.com/wireguard v0.0.0-20210212170059-7a0fb5bbb172 h1:g1vFilCRox6yINkkKFt+Dj4T22qjxp63yNzR1BjgmEE=
+golang.zx2c4.com/wireguard v0.0.0-20210212170059-7a0fb5bbb172/go.mod h1:r0ExowOoGFfDoLDxx+M9SYbNVsoZ0xviLL+K4f2mt+A=
diff --git a/ui/src/main/res/values-de/strings.xml b/ui/src/main/res/values-de/strings.xml
index 96b62791..c9cde1ee 100644
--- a/ui/src/main/res/values-de/strings.xml
+++ b/ui/src/main/res/values-de/strings.xml
@@ -212,7 +212,7 @@
<string name="type_name_go_userspace">Go userspace</string>
<string name="type_name_kernel_module">Kernelmodul</string>
<string name="unknown_error">Unbekannter Fehler</string>
- <string name="version_summary">%1$s Backend v%2$s</string>
+ <string name="version_summary">%1$s Backend %2$s</string>
<string name="version_summary_checking">Überprüfe %s Backend-Version</string>
<string name="version_summary_unknown">Unbekannte %s Version</string>
<string name="version_title">WireGuard für Android v%s</string>
diff --git a/ui/src/main/res/values-es-rES/strings.xml b/ui/src/main/res/values-es-rES/strings.xml
index 3595701d..8e6c90d0 100644
--- a/ui/src/main/res/values-es-rES/strings.xml
+++ b/ui/src/main/res/values-es-rES/strings.xml
@@ -163,7 +163,7 @@
<string name="type_name_go_userspace">Ir al espacio de usuario</string>
<string name="type_name_kernel_module">Módulo Kernel</string>
<string name="unknown_error">Error desconocido</string>
- <string name="version_summary">%1$s backend v%2$s</string>
+ <string name="version_summary">%1$s backend %2$s</string>
<string name="version_summary_checking">Comprobando versión de backend %s</string>
<string name="version_summary_unknown">Versión %s desconocida</string>
<string name="version_title">WireGuard para Android -%s</string>
diff --git a/ui/src/main/res/values-fr/strings.xml b/ui/src/main/res/values-fr/strings.xml
index a0e06e54..00417e02 100644
--- a/ui/src/main/res/values-fr/strings.xml
+++ b/ui/src/main/res/values-fr/strings.xml
@@ -212,7 +212,7 @@
<string name="type_name_go_userspace">Nom de l\'espace utilisateur</string>
<string name="type_name_kernel_module">Module noyau</string>
<string name="unknown_error">Erreur inconnue</string>
- <string name="version_summary">%1$s backend v%2$s</string>
+ <string name="version_summary">%1$s backend %2$s</string>
<string name="version_summary_checking">Vérification de la version %s du backend</string>
<string name="version_summary_unknown">Version %s inconnue</string>
<string name="version_title">WireGuard pour Android v%s</string>
diff --git a/ui/src/main/res/values-hi-rIN/strings.xml b/ui/src/main/res/values-hi-rIN/strings.xml
index 9443a5f8..f47b1687 100644
--- a/ui/src/main/res/values-hi-rIN/strings.xml
+++ b/ui/src/main/res/values-hi-rIN/strings.xml
@@ -203,7 +203,7 @@
<string name="type_name_go_userspace">userspace पे जाए </string>
<string name="type_name_kernel_module">कर्नेल मॉड्यूल</string>
<string name="unknown_error">अज्ञात त्रुटि</string>
- <string name="version_summary">%1$s बैकएंड v%2$s</string>
+ <string name="version_summary">%1$s बैकएंड %2$s</string>
<string name="version_summary_checking">%s बैकएंड संस्करण की जाँच कर रहा है</string>
<string name="version_summary_unknown">अज्ञात %s संस्करण</string>
<string name="version_title">WireGuard for Android v%s</string>
diff --git a/ui/src/main/res/values-hi/strings.xml b/ui/src/main/res/values-hi/strings.xml
index fa65c119..d0899dff 100644
--- a/ui/src/main/res/values-hi/strings.xml
+++ b/ui/src/main/res/values-hi/strings.xml
@@ -162,7 +162,7 @@
<string name="type_name_go_userspace">userspace पे जाए </string>
<string name="type_name_kernel_module">कर्नेल मॉड्यूल</string>
<string name="unknown_error">अज्ञात त्रुटि</string>
- <string name="version_summary">%1$s बैकएंड v%2$s</string>
+ <string name="version_summary">%1$s बैकएंड %2$s</string>
<string name="version_summary_checking">%s बैकएंड संस्करण की जाँच कर रहा है</string>
<string name="version_summary_unknown">अज्ञात %s संस्करण</string>
<string name="version_title">WireGuard for Android v%s</string>
diff --git a/ui/src/main/res/values-id/strings.xml b/ui/src/main/res/values-id/strings.xml
index 774bd2d2..847c6a69 100644
--- a/ui/src/main/res/values-id/strings.xml
+++ b/ui/src/main/res/values-id/strings.xml
@@ -199,7 +199,7 @@
<string name="type_name_go_userspace">Ke userspace</string>
<string name="type_name_kernel_module">Modul kernel</string>
<string name="unknown_error">Eror tidak diketahui</string>
- <string name="version_summary">%1$s backend v%2$s</string>
+ <string name="version_summary">%1$s backend %2$s</string>
<string name="version_summary_checking">Mengecek versi backend %s</string>
<string name="version_summary_unknown">Versi %s Tidak diketahui</string>
<string name="version_title">WireGuard untuk Android v%s</string>
diff --git a/ui/src/main/res/values-it/strings.xml b/ui/src/main/res/values-it/strings.xml
index 8aee34bd..92ce6cd2 100644
--- a/ui/src/main/res/values-it/strings.xml
+++ b/ui/src/main/res/values-it/strings.xml
@@ -212,7 +212,7 @@
<string name="type_name_go_userspace">Spazio utente Go</string>
<string name="type_name_kernel_module">Modulo kernel</string>
<string name="unknown_error">Errore sconosciuto</string>
- <string name="version_summary">Backend %1$s v%2$s</string>
+ <string name="version_summary">Backend %1$s %2$s</string>
<string name="version_summary_checking">Controllo versione backend %s</string>
<string name="version_summary_unknown">Versione %s sconosciuta</string>
<string name="version_title">WireGuard per Android v%s</string>
diff --git a/ui/src/main/res/values-ja/strings.xml b/ui/src/main/res/values-ja/strings.xml
index f9146c5d..882f091a 100644
--- a/ui/src/main/res/values-ja/strings.xml
+++ b/ui/src/main/res/values-ja/strings.xml
@@ -199,7 +199,7 @@
<string name="type_name_go_userspace">Go ユーザースペース</string>
<string name="type_name_kernel_module">カーネルモジュール</string>
<string name="unknown_error">未知のエラー</string>
- <string name="version_summary">%1$s backend v%2$s</string>
+ <string name="version_summary">%1$s backend %2$s</string>
<string name="version_summary_checking">%s バックエンドのバージョンを確認中</string>
<string name="version_summary_unknown">未知の %s バージョン</string>
<string name="version_title">WireGuard for Android v%s</string>
diff --git a/ui/src/main/res/values-pa-rIN/strings.xml b/ui/src/main/res/values-pa-rIN/strings.xml
index 5fd7065d..7f68c1de 100644
--- a/ui/src/main/res/values-pa-rIN/strings.xml
+++ b/ui/src/main/res/values-pa-rIN/strings.xml
@@ -212,7 +212,7 @@
<string name="type_name_go_userspace">ਵਰਤੋਂ-ਸਪੇਸ ਤੇ ਜਾਓ</string>
<string name="type_name_kernel_module">ਕਰਨਲ ਮੋਡੀਊਲ</string>
<string name="unknown_error">ਅਣਪਛਾਤੀ ਗਲਤੀ</string>
- <string name="version_summary">%1$s ਬੈਕਐਂਡ v%2$s</string>
+ <string name="version_summary">%1$s ਬੈਕਐਂਡ %2$s</string>
<string name="version_summary_checking">%s ਬੈਕਐਂਡ ਵਰਜ਼ਨ ਦੀ ਜਾਂਚ ਕੀਤੀ ਜਾ ਰਹੀ ਹੈ</string>
<string name="version_summary_unknown">ਅਣਪਛਾਤਾ %s ਵਰਜਨ</string>
<string name="version_title">Android ਲਈ WireGuard v%s</string>
diff --git a/ui/src/main/res/values-pl-rPL/strings.xml b/ui/src/main/res/values-pl-rPL/strings.xml
index 9971f571..87eada58 100644
--- a/ui/src/main/res/values-pl-rPL/strings.xml
+++ b/ui/src/main/res/values-pl-rPL/strings.xml
@@ -238,7 +238,7 @@
<string name="type_name_go_userspace">Przestrzeń użytkownika Go</string>
<string name="type_name_kernel_module">Moduł jądra</string>
<string name="unknown_error">Nieznany błąd</string>
- <string name="version_summary">Implementacja %1$s v%2$s</string>
+ <string name="version_summary">Implementacja %1$s %2$s</string>
<string name="version_summary_checking">Sprawdzanie wersji %s implementacji</string>
<string name="version_summary_unknown">Nieznana %s wersja</string>
<string name="version_title">WireGuard dla systemu Android v%s</string>
diff --git a/ui/src/main/res/values-ro-rRO/strings.xml b/ui/src/main/res/values-ro-rRO/strings.xml
index acdd7e0a..87867e37 100644
--- a/ui/src/main/res/values-ro-rRO/strings.xml
+++ b/ui/src/main/res/values-ro-rRO/strings.xml
@@ -225,7 +225,7 @@
<string name="type_name_go_userspace">Spațiu de utilizator Go</string>
<string name="type_name_kernel_module">Modul nucleu</string>
<string name="unknown_error">Eroare necunoscută</string>
- <string name="version_summary">Bibliotecă %1$s v%2$s</string>
+ <string name="version_summary">Bibliotecă %1$s %2$s</string>
<string name="version_summary_checking">Se verifică versiunea bibliotecii %s</string>
<string name="version_summary_unknown">Versiune %s necunoscută</string>
<string name="version_title">WireGuard pentru Android v%s</string>
diff --git a/ui/src/main/res/values-ru/strings.xml b/ui/src/main/res/values-ru/strings.xml
index dcf350a7..4ec20c26 100644
--- a/ui/src/main/res/values-ru/strings.xml
+++ b/ui/src/main/res/values-ru/strings.xml
@@ -238,7 +238,7 @@
<string name="type_name_go_userspace">Перейти в пользовательское пространство</string>
<string name="type_name_kernel_module">Модуль ядра</string>
<string name="unknown_error">Неизвестная ошибка</string>
- <string name="version_summary">%1$s v%2$s</string>
+ <string name="version_summary">%1$s %2$s</string>
<string name="version_summary_checking">Проверка версии %s</string>
<string name="version_summary_unknown">Неизвестная версия %s</string>
<string name="version_title">WireGuard для Android v%s</string>
diff --git a/ui/src/main/res/values-sl/strings.xml b/ui/src/main/res/values-sl/strings.xml
index ae67e890..34df3187 100644
--- a/ui/src/main/res/values-sl/strings.xml
+++ b/ui/src/main/res/values-sl/strings.xml
@@ -238,7 +238,7 @@
<string name="type_name_go_userspace">Uporabniški prostor Go</string>
<string name="type_name_kernel_module">Modul jedra</string>
<string name="unknown_error">Neznana napaka</string>
- <string name="version_summary">Zaledje %1$s v%2$s</string>
+ <string name="version_summary">Zaledje %1$s %2$s</string>
<string name="version_summary_checking">Preverjam verzijo zaledja %s</string>
<string name="version_summary_unknown">Neznana verzija %s</string>
<string name="version_title">WireGuard za Android v%s</string>
diff --git a/ui/src/main/res/values-tr-rTR/strings.xml b/ui/src/main/res/values-tr-rTR/strings.xml
index 74d7483c..2585b997 100644
--- a/ui/src/main/res/values-tr-rTR/strings.xml
+++ b/ui/src/main/res/values-tr-rTR/strings.xml
@@ -212,7 +212,7 @@
<string name="type_name_go_userspace">Kullanıcı alanına git</string>
<string name="type_name_kernel_module">Çekirdek modülü</string>
<string name="unknown_error">Bilinmeyen hata</string>
- <string name="version_summary">%1$s backend v%2$s</string>
+ <string name="version_summary">%1$s backend %2$s</string>
<string name="version_summary_checking">%s arka uç sürümü kontrol ediliyor</string>
<string name="version_summary_unknown">Bilinmeyen %s sürümü</string>
<string name="version_title">Android için WireGuard v%s</string>
diff --git a/ui/src/main/res/values-zh-rCN/strings.xml b/ui/src/main/res/values-zh-rCN/strings.xml
index 7e840f00..1c41b19b 100644
--- a/ui/src/main/res/values-zh-rCN/strings.xml
+++ b/ui/src/main/res/values-zh-rCN/strings.xml
@@ -199,7 +199,7 @@
<string name="type_name_go_userspace">Go userspace</string>
<string name="type_name_kernel_module">Kernel module</string>
<string name="unknown_error">未知错误</string>
- <string name="version_summary">%1$s backend v%2$s</string>
+ <string name="version_summary">%1$s backend %2$s</string>
<string name="version_summary_checking">正在检查 %s backend 版本</string>
<string name="version_summary_unknown">未知的 %s 版本</string>
<string name="version_title">WireGuard for Android v%s</string>
diff --git a/ui/src/main/res/values/strings.xml b/ui/src/main/res/values/strings.xml
index d569ccfe..812b2192 100644
--- a/ui/src/main/res/values/strings.xml
+++ b/ui/src/main/res/values/strings.xml
@@ -219,7 +219,7 @@
<string name="type_name_go_userspace">Go userspace</string>
<string name="type_name_kernel_module">Kernel module</string>
<string name="unknown_error">Unknown error</string>
- <string name="version_summary">%1$s backend v%2$s</string>
+ <string name="version_summary">%1$s backend %2$s</string>
<string name="version_summary_checking">Checking %s backend version</string>
<string name="version_summary_unknown">Unknown %s version</string>
<string name="version_title">WireGuard for Android v%s</string>