diff --git a/echolot-prober/app/build.gradle.kts b/echolot-prober/app/build.gradle.kts index cb3fe16..793f6cf 100644 --- a/echolot-prober/app/build.gradle.kts +++ b/echolot-prober/app/build.gradle.kts @@ -13,7 +13,9 @@ android { applicationId = "app.echo_lot.prober" minSdk = 26 targetSdk = 35 - versionCode = 1 + // Bump versionCode on EVERY deployed change — it is shown on screen and lands in the + // JSON report as proberBuild, so a report is attributable to an exact prober build. + versionCode = 2 versionName = "0.1.0" } @@ -32,6 +34,7 @@ android { buildFeatures { compose = true aidl = true + buildConfig = true // BuildConfig.VERSION_CODE feeds the on-screen + report build number } } diff --git a/echolot-prober/app/src/main/java/app/echo_lot/prober/export/Report.kt b/echolot-prober/app/src/main/java/app/echo_lot/prober/export/Report.kt index c1cc4ea..b127ab6 100644 --- a/echolot-prober/app/src/main/java/app/echo_lot/prober/export/Report.kt +++ b/echolot-prober/app/src/main/java/app/echo_lot/prober/export/Report.kt @@ -7,6 +7,7 @@ import android.content.Context import android.content.Intent import android.os.Build import androidx.core.content.FileProvider +import app.echo_lot.prober.BuildConfig import app.echo_lot.prober.probe.ProbeResult import kotlinx.serialization.Serializable import kotlinx.serialization.encodeToString @@ -17,6 +18,9 @@ import java.io.File data class Report( val schema: String = "echolot/prober-report", val schemaVersion: String = "0.1.0", + // Ascending integer, bumped per deployed change (= versionCode). Shown on screen too, so a + // report and a screenshot are attributable to the same build. + val proberBuild: Int = BuildConfig.VERSION_CODE, val device: DeviceInfo, val results: List, ) diff --git a/echolot-prober/app/src/main/java/app/echo_lot/prober/ui/ProberScreen.kt b/echolot-prober/app/src/main/java/app/echo_lot/prober/ui/ProberScreen.kt index 83539c8..0d4301d 100644 --- a/echolot-prober/app/src/main/java/app/echo_lot/prober/ui/ProberScreen.kt +++ b/echolot-prober/app/src/main/java/app/echo_lot/prober/ui/ProberScreen.kt @@ -41,7 +41,10 @@ fun ProberScreen( onShare: () -> Unit, ) { Column(Modifier.fillMaxSize().padding(16.dp)) { - Text("Echolot Capability Prober", style = MaterialTheme.typography.headlineSmall) + Text( + "Echolot Capability Prober · build ${app.echo_lot.prober.BuildConfig.VERSION_CODE}", + style = MaterialTheme.typography.headlineSmall, + ) Text( "Runs the borderline no-root probes from the feasibility matrix on THIS device and reports what actually works.", style = MaterialTheme.typography.bodySmall,