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.
This commit is contained in:
1 parent
cc4f156c83
commit
abb73ffef7
4 files changed
+20
-6
No files matched your search
@@ -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 ->
|
||||
|
||||
+6
@@ -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"
|
||||
|
||||
@@ -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<Double, Double>? = { 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 <name> <version>` 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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user