diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/build.gradle.kts | 6 | ||||
-rw-r--r-- | ui/src/main/java/com/wireguard/android/updater/Updater.kt | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/ui/build.gradle.kts b/ui/build.gradle.kts index 3672c1ee..34a32d5b 100644 --- a/ui/build.gradle.kts +++ b/ui/build.gradle.kts @@ -10,6 +10,7 @@ plugins { alias(libs.plugins.android.application) alias(libs.plugins.kotlin.android) alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.ajoberstar.grgit) } android { @@ -25,7 +26,10 @@ android { minSdk = 21 targetSdk = 33 versionCode = providers.gradleProperty("wireguardVersionCode").get().toInt() - versionName = providers.gradleProperty("wireguardVersionName").get() + versionName = grgit.describe { + tags = true + always = true + }.replace('-', '.') buildConfigField("int", "MIN_SDK_VERSION", minSdk.toString()) } compileOptions { 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 dbdbacfe..adcb3836 100644 --- a/ui/src/main/java/com/wireguard/android/updater/Updater.kt +++ b/ui/src/main/java/com/wireguard/android/updater/Updater.kt @@ -152,7 +152,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() } } |