diff options
-rw-r--r-- | gradle.properties | 1 | ||||
-rw-r--r-- | gradle/libs.versions.toml | 2 | ||||
-rw-r--r-- | keystore/debug.keystore | bin | 0 -> 2107 bytes | |||
-rw-r--r-- | ui/build.gradle.kts | 18 | ||||
-rw-r--r-- | ui/src/debug/res/values/strings.xml | 2 | ||||
-rw-r--r-- | ui/src/main/java/com/wireguard/android/updater/Updater.kt | 5 | ||||
-rw-r--r-- | ui/src/main/res/values/strings.xml | 2 |
7 files changed, 25 insertions, 5 deletions
diff --git a/gradle.properties b/gradle.properties index efc1fe18..3e22e0f4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,7 @@ wireguardVersionCode=510 wireguardVersionName=1.0.20231018 wireguardPackageName=com.wireguard.android +wireguardApplicationID=eu.m7n.wireguard.android # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0f97fabc..5471d84a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,6 @@ [versions] agp = "8.2.0-beta06" +grgit = "5.2.0" grpc = "1.59.0" kotlin = "1.9.0" protobuf = "0.9.4" @@ -32,6 +33,7 @@ kotlinx-coroutines-android = "org.jetbrains.kotlinx:kotlinx-coroutines-android:1 zxing-android-embedded = "com.journeyapps:zxing-android-embedded:4.3.0" [plugins] +ajoberstar-grgit = { id = "org.ajoberstar.grgit", version.ref = "grgit" } android-application = { id = "com.android.application", version.ref = "agp" } android-library = { id = "com.android.library", version.ref = "agp" } google-protobuf = { id = "com.google.protobuf", version.ref = "protobuf" } diff --git a/keystore/debug.keystore b/keystore/debug.keystore Binary files differnew file mode 100644 index 00000000..c2655107 --- /dev/null +++ b/keystore/debug.keystore diff --git a/ui/build.gradle.kts b/ui/build.gradle.kts index 5cdcb6a1..fff3acd9 100644 --- a/ui/build.gradle.kts +++ b/ui/build.gradle.kts @@ -4,11 +4,13 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.tasks.KotlinCompile val pkg: String = providers.gradleProperty("wireguardPackageName").get() +val appID: String = providers.gradleProperty("wireguardApplicationID").get() plugins { alias(libs.plugins.android.application) alias(libs.plugins.kotlin.android) alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.ajoberstar.grgit) } android { @@ -20,11 +22,14 @@ android { } namespace = pkg defaultConfig { - applicationId = pkg + applicationId = appID minSdk = 21 targetSdk = 34 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 { @@ -32,6 +37,14 @@ android { targetCompatibility = JavaVersion.VERSION_17 isCoreLibraryDesugaringEnabled = true } + signingConfigs { + named("debug") { + storeFile = File("/src/wireguard-android/keystore/debug.keystore") + storePassword = "android" + keyAlias = "androiddebugkey" + keyPassword = "android" + } + } buildTypes { release { isMinifyEnabled = true @@ -48,6 +61,7 @@ android { debug { applicationIdSuffix = ".debug" versionNameSuffix = "-debug" + signingConfig = signingConfigs.getByName("debug") } create("googleplay") { initWith(getByName("release")) diff --git a/ui/src/debug/res/values/strings.xml b/ui/src/debug/res/values/strings.xml index 947b7381..af58a39d 100644 --- a/ui/src/debug/res/values/strings.xml +++ b/ui/src/debug/res/values/strings.xml @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> <resources> - <string name="app_name" translatable="false">WireGuard β</string> + <string name="app_name" translatable="false">(m7n.eu) WireGuard β</string> </resources> 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 651e3cd7..87adad96 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() } } diff --git a/ui/src/main/res/values/strings.xml b/ui/src/main/res/values/strings.xml index 3f16aed2..1cb642e2 100644 --- a/ui/src/main/res/values/strings.xml +++ b/ui/src/main/res/values/strings.xml @@ -63,7 +63,7 @@ <string name="allow_remote_control_intents_summary_on">External apps may toggle tunnels (advanced)</string> <string name="allow_remote_control_intents_title">Allow remote control apps</string> <string name="allowed_ips">Allowed IPs</string> - <string name="app_name" translatable="false">WireGuard</string> + <string name="app_name" translatable="false">(m7n.eu) WireGuard</string> <string name="bad_config_context">%1$s\'s %2$s</string> <string name="bad_config_context_top_level">%s</string> <string name="bad_config_error">%1$s in %2$s</string> |