From 8877ad2f5045f7aab63dfea24544501e80ff1650 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Wed, 10 Apr 2019 00:04:04 +0200 Subject: m7n: local build modifications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use custom application id: eu.m7n.wireguard.android Set app names to (m7n.eu) WireGuard and (m7n.eu) WireGuard β --- gradle.properties | 1 + ui/build.gradle.kts | 3 ++- ui/src/debug/res/values/strings.xml | 2 +- ui/src/main/res/values/strings.xml | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index 82fe120c..6e4f2a99 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,7 @@ wireguardVersionCode=502 wireguardVersionName=1.0.20230504 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/ui/build.gradle.kts b/ui/build.gradle.kts index 5c6163af..82f2caae 100644 --- a/ui/build.gradle.kts +++ b/ui/build.gradle.kts @@ -3,6 +3,7 @@ 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) @@ -19,7 +20,7 @@ android { } namespace = pkg defaultConfig { - applicationId = pkg + applicationId = appID minSdk = 21 targetSdk = 33 versionCode = providers.gradleProperty("wireguardVersionCode").get().toInt() 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 @@ - WireGuard β + (m7n.eu) WireGuard β diff --git a/ui/src/main/res/values/strings.xml b/ui/src/main/res/values/strings.xml index 66e35c98..c9e230db 100644 --- a/ui/src/main/res/values/strings.xml +++ b/ui/src/main/res/values/strings.xml @@ -63,7 +63,7 @@ External apps may toggle tunnels (advanced) Allow remote control apps Allowed IPs - WireGuard + (m7n.eu) WireGuard %1$s\'s %2$s %s %1$s in %2$s -- cgit v1.2.3 From fee2d9dec12dd9e5a8a8b25537ec1b389bfeb1e5 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sat, 11 Feb 2023 22:54:46 +0100 Subject: ui: add debug keystore Allow sharing between machines. --- keystore/debug.keystore | Bin 0 -> 2107 bytes ui/build.gradle.kts | 9 +++++++++ 2 files changed, 9 insertions(+) create mode 100644 keystore/debug.keystore diff --git a/keystore/debug.keystore b/keystore/debug.keystore new file mode 100644 index 00000000..c2655107 Binary files /dev/null and b/keystore/debug.keystore differ diff --git a/ui/build.gradle.kts b/ui/build.gradle.kts index 82f2caae..58a6a687 100644 --- a/ui/build.gradle.kts +++ b/ui/build.gradle.kts @@ -33,6 +33,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 +56,7 @@ android { debug { applicationIdSuffix = ".debug" versionNameSuffix = "-debug" + signingConfig = signingConfigs.getByName("debug") } create("googleplay") { initWith(getByName("release")) -- cgit v1.2.3 From e7a73f171050746efe0798a98e5499028a707c0b 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 --- gradle/libs.versions.toml | 2 ++ ui/build.gradle.kts | 6 +++++- ui/src/main/java/com/wireguard/android/updater/Updater.kt | 5 ++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d8527046..442707ae 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" kotlin = "1.9.0" [libraries] @@ -23,6 +24,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" } kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } diff --git a/ui/build.gradle.kts b/ui/build.gradle.kts index 5cdcb6a1..be11cc30 100644 --- a/ui/build.gradle.kts +++ b/ui/build.gradle.kts @@ -9,6 +9,7 @@ plugins { alias(libs.plugins.android.application) alias(libs.plugins.kotlin.android) alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.ajoberstar.grgit) } android { @@ -24,7 +25,10 @@ android { 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 { 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() } } -- cgit v1.2.3