From 6a8e2c04448e5ce1d8123b8be80393f5a1a709ad Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sat, 11 Dec 2021 20:29:42 +0100 Subject: version: automatically generate version string from tag Signed-off-by: Mikael Magnusson --- ui/src/main/java/com/wireguard/android/updater/Updater.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ui/src/main/java') diff --git a/ui/src/main/java/com/wireguard/android/updater/Updater.kt b/ui/src/main/java/com/wireguard/android/updater/Updater.kt index 928028fd..7fc58e08 100644 --- a/ui/src/main/java/com/wireguard/android/updater/Updater.kt +++ b/ui/src/main/java/com/wireguard/android/updater/Updater.kt @@ -153,7 +153,10 @@ object Updater { throw InvalidParameterException("Version has no parts") parts = ULongArray(strParts.size) for (i in parts.indices) { - parts[i] = strParts[i].toULong() + if (strParts[i][0] == 'g') + parts[i] = strParts[i].substring(1).toULong(16) + else + parts[i] = strParts[i].toULong() } } @@ -439,4 +442,4 @@ object Updater { context.startActivity(start) } } -} \ No newline at end of file +} -- cgit v1.2.3