From abb73ffef7580afc053f4a76184d840617561311 Mon Sep 17 00:00:00 2001 From: QIU Date: Thu, 27 Aug 2026 15:41:07 +0000 Subject: [PATCH] build: bump to 4.6.2 (versionCode 469) Carries the CW record fixes: the record no longer deletes its own text while decoding, a drifting tone no longer wipes it instead of filling it, the archive path no longer races itself when capture stops, and the decoded text can finally be copied off the screen. Also stops the APRS version string drifting, which the comment on it had predicted and which had already happened again: it still read 4.6.0 while the app shipped 4.6.1, so every station on the network was told the wrong version. AprsReporter now takes the version as a parameter and the app module passes BuildConfig.VERSION_NAME, which required turning on the buildConfig feature - AGP 8 does not generate the class otherwise. The literal cannot fall out of step with the build again. --- .../com/rtbishop/look4sat/AprsForegroundService.kt | 3 +++ .../look4sat/convention/PluginSetupUtils.kt | 6 ++++++ .../look4sat/core/data/aprs/AprsReporter.kt | 13 +++++++++---- gradle/libs.versions.toml | 4 ++-- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/rtbishop/look4sat/AprsForegroundService.kt b/app/src/main/java/com/rtbishop/look4sat/AprsForegroundService.kt index 7f287051..91632d49 100644 --- a/app/src/main/java/com/rtbishop/look4sat/AprsForegroundService.kt +++ b/app/src/main/java/com/rtbishop/look4sat/AprsForegroundService.kt @@ -15,6 +15,7 @@ import android.os.Build import android.os.Handler import android.os.Looper import android.os.IBinder +import com.rtbishop.look4sat.BuildConfig import com.rtbishop.look4sat.MainApplication import com.rtbishop.look4sat.core.presentation.R import com.rtbishop.look4sat.core.data.aprs.AprsConfig @@ -109,6 +110,8 @@ class AprsForegroundService : Service() { startForegroundWithNotification(cfg) val rep = AprsReporter( configProvider = { AprsStore.loadConfig(this) }, + // The real version, so the login line cannot drift from the build again. + appVersion = BuildConfig.VERSION_NAME, positionProvider = { stationPosition() }, onState = { lastState = it }, onReport = { report -> diff --git a/build-logic/convention/src/main/java/com/rtbishop/look4sat/convention/PluginSetupUtils.kt b/build-logic/convention/src/main/java/com/rtbishop/look4sat/convention/PluginSetupUtils.kt index 6126a2d0..09f8b1da 100644 --- a/build-logic/convention/src/main/java/com/rtbishop/look4sat/convention/PluginSetupUtils.kt +++ b/build-logic/convention/src/main/java/com/rtbishop/look4sat/convention/PluginSetupUtils.kt @@ -62,6 +62,12 @@ internal fun Project.setupAndroidApp() { versionCode = libs.versions.appVersionCode.get().toInt() versionName = libs.versions.appVersionName.get() } + // The APRS login line reports the app version to every station on the network. It used + // to be a literal in core:data and drifted twice, so the app module now reads + // BuildConfig.VERSION_NAME - which AGP 8 only generates when asked. + buildFeatures { + buildConfig = true + } buildTypes { debug { applicationIdSuffix = ".debug" diff --git a/core/data/src/main/java/com/rtbishop/look4sat/core/data/aprs/AprsReporter.kt b/core/data/src/main/java/com/rtbishop/look4sat/core/data/aprs/AprsReporter.kt index 67b39c24..9c4a9e6f 100644 --- a/core/data/src/main/java/com/rtbishop/look4sat/core/data/aprs/AprsReporter.kt +++ b/core/data/src/main/java/com/rtbishop/look4sat/core/data/aprs/AprsReporter.kt @@ -58,6 +58,14 @@ data class AprsReport( /** Report scheduler (periodic + manual trigger); connection management lives in the foreground service */ class AprsReporter( private val configProvider: () -> AprsConfig, + /** + * The app's own version, reported to APRS-IS in the login line. + * + * Passed in because core:data has no BuildConfig. It used to be a literal here and drifted + * exactly as predicted: it still read 4.6.0 two releases later, so every station on the + * network was told the wrong version. A caller in the app module can read the real one. + */ + private val appVersion: String, private val positionProvider: () -> Pair? = { null }, private val onState: (AprsState) -> Unit = {}, private val onReport: (AprsReport) -> Unit = {} @@ -136,11 +144,8 @@ class AprsReporter( // transmitting under a passcode the app invented for an unchecked licence. passcode = AprsPasscode.loginValue(cfg.callsign, cfg.passcode), // Two fields, because APRS-IS wants `vers ` as separate tokens. - // The version is hardcoded and drifts - it read 4.5.4 while the app was 4.6.0. - // core:data has no BuildConfig, so fixing that properly means passing it in from - // the app module; noting rather than doing it here to keep this change small. softwareName = "Look4Sat", - version = "4.6.0" + version = appVersion ).also { client = it } if (!c.isConnected) c.connect() onState(AprsState.Connected) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 2c362940..10e950be 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,8 +1,8 @@ [versions] #noinspection UnusedVersionCatalogEntry -appVersionCode = "468" +appVersionCode = "469" #noinspection UnusedVersionCatalogEntry -appVersionName = "4.6.1" +appVersionName = "4.6.2" #noinspection UnusedVersionCatalogEntry compileSdk = "37" #noinspection UnusedVersionCatalogEntry