feat(#397): show running build identity (branch @ sha, build time) in Device Info

No in-app signal of which binary is running has caused repeated confusion
(a debug-signed APK silently not installing over the release app, old layout
persisting with nothing to indicate the new build never landed).

BuildInfo reads GIT_SHA/GIT_BRANCH/BUILD_TIME from --dart-define with dev
fallbacks, so every build carries its own identity independent of the pubspec
version. Surfaced as its own copyable Build row in Device Info.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
pull/419/head
Strycher 4 months ago
parent f516163614
commit bd34682f36

@ -239,6 +239,7 @@
"settings_infoOffbandCaps": "Offband capabilities",
"settings_infoBattery": "Battery",
"settings_infoPublicKey": "Public Key",
"settings_infoBuild": "Build",
"settings_infoDataScope": "Data scope",
"settings_infoDataScopeSubtitle": "Messages, contacts, and channels are stored per radio under this key",
"settings_publicKeyCopied": "Public key copied",

@ -1192,6 +1192,12 @@ abstract class AppLocalizations {
/// **'Public Key'**
String get settings_infoPublicKey;
/// No description provided for @settings_infoBuild.
///
/// In en, this message translates to:
/// **'Build'**
String get settings_infoBuild;
/// No description provided for @settings_infoDataScope.
///
/// In en, this message translates to:

@ -599,6 +599,9 @@ class AppLocalizationsBg extends AppLocalizations {
@override
String get settings_infoPublicKey => 'Общ публичен ключ';
@override
String get settings_infoBuild => 'Build';
@override
String get settings_infoDataScope => 'Data scope';

@ -594,6 +594,9 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get settings_infoPublicKey => 'Öffentlicher Schlüssel';
@override
String get settings_infoBuild => 'Build';
@override
String get settings_infoDataScope => 'Data scope';

@ -584,6 +584,9 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get settings_infoPublicKey => 'Public Key';
@override
String get settings_infoBuild => 'Build';
@override
String get settings_infoDataScope => 'Data scope';

@ -595,6 +595,9 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get settings_infoPublicKey => 'Clave Pública';
@override
String get settings_infoBuild => 'Build';
@override
String get settings_infoDataScope => 'Data scope';

@ -599,6 +599,9 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get settings_infoPublicKey => 'Clé Publique';
@override
String get settings_infoBuild => 'Build';
@override
String get settings_infoDataScope => 'Data scope';

@ -597,6 +597,9 @@ class AppLocalizationsHu extends AppLocalizations {
@override
String get settings_infoPublicKey => 'Nyelvkönyv';
@override
String get settings_infoBuild => 'Build';
@override
String get settings_infoDataScope => 'Data scope';

@ -597,6 +597,9 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get settings_infoPublicKey => 'Chiave Pubblica';
@override
String get settings_infoBuild => 'Build';
@override
String get settings_infoDataScope => 'Data scope';

@ -570,6 +570,9 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get settings_infoPublicKey => '公開鍵';
@override
String get settings_infoBuild => 'Build';
@override
String get settings_infoDataScope => 'Data scope';

@ -570,6 +570,9 @@ class AppLocalizationsKo extends AppLocalizations {
@override
String get settings_infoPublicKey => '공개 키';
@override
String get settings_infoBuild => 'Build';
@override
String get settings_infoDataScope => 'Data scope';

@ -591,6 +591,9 @@ class AppLocalizationsNl extends AppLocalizations {
@override
String get settings_infoPublicKey => 'Openbare Sleutel';
@override
String get settings_infoBuild => 'Build';
@override
String get settings_infoDataScope => 'Data scope';

@ -599,6 +599,9 @@ class AppLocalizationsPl extends AppLocalizations {
@override
String get settings_infoPublicKey => 'Klucz Publiczny';
@override
String get settings_infoBuild => 'Build';
@override
String get settings_infoDataScope => 'Data scope';

@ -597,6 +597,9 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get settings_infoPublicKey => 'Chave Pública';
@override
String get settings_infoBuild => 'Build';
@override
String get settings_infoDataScope => 'Data scope';

@ -596,6 +596,9 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get settings_infoPublicKey => 'Публичный ключ';
@override
String get settings_infoBuild => 'Build';
@override
String get settings_infoDataScope => 'Data scope';

@ -591,6 +591,9 @@ class AppLocalizationsSk extends AppLocalizations {
@override
String get settings_infoPublicKey => 'Verejný kľúč';
@override
String get settings_infoBuild => 'Build';
@override
String get settings_infoDataScope => 'Data scope';

@ -588,6 +588,9 @@ class AppLocalizationsSl extends AppLocalizations {
@override
String get settings_infoPublicKey => 'Javni ključ';
@override
String get settings_infoBuild => 'Build';
@override
String get settings_infoDataScope => 'Data scope';

@ -586,6 +586,9 @@ class AppLocalizationsSv extends AppLocalizations {
@override
String get settings_infoPublicKey => 'Allmänt nyckel';
@override
String get settings_infoBuild => 'Build';
@override
String get settings_infoDataScope => 'Data scope';

@ -594,6 +594,9 @@ class AppLocalizationsUk extends AppLocalizations {
@override
String get settings_infoPublicKey => 'Відкритий ключ';
@override
String get settings_infoBuild => 'Build';
@override
String get settings_infoDataScope => 'Data scope';

@ -562,6 +562,9 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get settings_infoPublicKey => '公钥';
@override
String get settings_infoBuild => 'Build';
@override
String get settings_infoDataScope => 'Data scope';

@ -15,6 +15,7 @@ import '../services/app_debug_log_service.dart';
import '../services/app_settings_service.dart';
import '../connector/observer_config_client.dart';
import '../helpers/snack_bar_builder.dart';
import '../utils/build_info.dart';
import 'settings/settings_shell.dart';
import 'settings/app_settings_view.dart';
import 'settings/message_settings_view.dart';
@ -457,6 +458,14 @@ class _SettingsScreenState extends State<SettingsScreen> {
l10n.settings_infoChannelCount,
'${connector.channels.length}',
),
// #397: identity of the running binary, injected at build time and
// independent of the marketing version. Its own line so "which build
// am I on" is answerable at a glance; copyable for bug reports.
_buildInfoRow(
l10n.settings_infoBuild,
BuildInfo.stamp,
copyValue: BuildInfo.stamp,
),
],
),
),

@ -0,0 +1,35 @@
/// Identity of the running binary, injected at build time (#397).
///
/// Set via `--dart-define` so every build — debug or release, dev or prod —
/// carries its own identity, independent of the pubspec marketing version:
///
/// ```
/// flutter build apk --release \
/// --dart-define=GIT_SHA=$(git rev-parse --short HEAD) \
/// --dart-define=GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) \
/// --dart-define=BUILD_TIME=$(date -u +%Y-%m-%dT%H:%MZ)
/// ```
///
/// Falls back to `dev` / `unknown` when the defines are absent, so a plain
/// `flutter run` still works and never crashes on a missing value.
class BuildInfo {
const BuildInfo._();
static const String gitSha = String.fromEnvironment(
'GIT_SHA',
defaultValue: 'dev',
);
static const String gitBranch = String.fromEnvironment(
'GIT_BRANCH',
defaultValue: 'dev',
);
static const String buildTime = String.fromEnvironment(
'BUILD_TIME',
defaultValue: 'unknown',
);
/// One-line stamp for the UI: `branch @ sha · built <time>`.
static String get stamp => '$gitBranch @ $gitSha · built $buildTime';
}

@ -15,6 +15,7 @@
"settings_infoFirmware",
"settings_infoModel",
"settings_infoOffbandCaps",
"settings_infoBuild",
"settings_infoDataScope",
"settings_infoDataScopeSubtitle",
"settings_publicKeyCopied",
@ -31,6 +32,7 @@
"channels_notifyOff",
"chat_replyWithRoute",
"channel_heardTooltip",
"map_alwaysShowNames",
"path_suggestedRoute",
"path_searchRepeaters",
"channels_shareQr",
@ -80,6 +82,7 @@
"settings_infoFirmware",
"settings_infoModel",
"settings_infoOffbandCaps",
"settings_infoBuild",
"settings_infoDataScope",
"settings_infoDataScopeSubtitle",
"settings_publicKeyCopied",
@ -96,6 +99,7 @@
"channels_notifyOff",
"chat_replyWithRoute",
"channel_heardTooltip",
"map_alwaysShowNames",
"path_suggestedRoute",
"path_searchRepeaters",
"channels_shareQr",
@ -145,6 +149,7 @@
"settings_infoFirmware",
"settings_infoModel",
"settings_infoOffbandCaps",
"settings_infoBuild",
"settings_infoDataScope",
"settings_infoDataScopeSubtitle",
"settings_publicKeyCopied",
@ -161,6 +166,7 @@
"channels_notifyOff",
"chat_replyWithRoute",
"channel_heardTooltip",
"map_alwaysShowNames",
"path_suggestedRoute",
"path_searchRepeaters",
"channels_shareQr",
@ -210,6 +216,7 @@
"settings_infoFirmware",
"settings_infoModel",
"settings_infoOffbandCaps",
"settings_infoBuild",
"settings_infoDataScope",
"settings_infoDataScopeSubtitle",
"settings_publicKeyCopied",
@ -226,6 +233,7 @@
"channels_notifyOff",
"chat_replyWithRoute",
"channel_heardTooltip",
"map_alwaysShowNames",
"path_suggestedRoute",
"path_searchRepeaters",
"channels_shareQr",
@ -275,6 +283,7 @@
"settings_infoFirmware",
"settings_infoModel",
"settings_infoOffbandCaps",
"settings_infoBuild",
"settings_infoDataScope",
"settings_infoDataScopeSubtitle",
"settings_publicKeyCopied",
@ -291,6 +300,7 @@
"channels_notifyOff",
"chat_replyWithRoute",
"channel_heardTooltip",
"map_alwaysShowNames",
"path_suggestedRoute",
"path_searchRepeaters",
"channels_shareQr",
@ -340,6 +350,7 @@
"settings_infoFirmware",
"settings_infoModel",
"settings_infoOffbandCaps",
"settings_infoBuild",
"settings_infoDataScope",
"settings_infoDataScopeSubtitle",
"settings_publicKeyCopied",
@ -356,6 +367,7 @@
"channels_notifyOff",
"chat_replyWithRoute",
"channel_heardTooltip",
"map_alwaysShowNames",
"path_suggestedRoute",
"path_searchRepeaters",
"channels_shareQr",
@ -405,6 +417,7 @@
"settings_infoFirmware",
"settings_infoModel",
"settings_infoOffbandCaps",
"settings_infoBuild",
"settings_infoDataScope",
"settings_infoDataScopeSubtitle",
"settings_publicKeyCopied",
@ -421,6 +434,7 @@
"channels_notifyOff",
"chat_replyWithRoute",
"channel_heardTooltip",
"map_alwaysShowNames",
"path_suggestedRoute",
"path_searchRepeaters",
"channels_shareQr",
@ -470,6 +484,7 @@
"settings_infoFirmware",
"settings_infoModel",
"settings_infoOffbandCaps",
"settings_infoBuild",
"settings_infoDataScope",
"settings_infoDataScopeSubtitle",
"settings_publicKeyCopied",
@ -486,6 +501,7 @@
"channels_notifyOff",
"chat_replyWithRoute",
"channel_heardTooltip",
"map_alwaysShowNames",
"path_suggestedRoute",
"path_searchRepeaters",
"channels_shareQr",
@ -535,6 +551,7 @@
"settings_infoFirmware",
"settings_infoModel",
"settings_infoOffbandCaps",
"settings_infoBuild",
"settings_infoDataScope",
"settings_infoDataScopeSubtitle",
"settings_publicKeyCopied",
@ -551,6 +568,7 @@
"channels_notifyOff",
"chat_replyWithRoute",
"channel_heardTooltip",
"map_alwaysShowNames",
"path_suggestedRoute",
"path_searchRepeaters",
"channels_shareQr",
@ -600,6 +618,7 @@
"settings_infoFirmware",
"settings_infoModel",
"settings_infoOffbandCaps",
"settings_infoBuild",
"settings_infoDataScope",
"settings_infoDataScopeSubtitle",
"settings_publicKeyCopied",
@ -616,6 +635,7 @@
"channels_notifyOff",
"chat_replyWithRoute",
"channel_heardTooltip",
"map_alwaysShowNames",
"path_suggestedRoute",
"path_searchRepeaters",
"channels_shareQr",
@ -665,6 +685,7 @@
"settings_infoFirmware",
"settings_infoModel",
"settings_infoOffbandCaps",
"settings_infoBuild",
"settings_infoDataScope",
"settings_infoDataScopeSubtitle",
"settings_publicKeyCopied",
@ -681,6 +702,7 @@
"channels_notifyOff",
"chat_replyWithRoute",
"channel_heardTooltip",
"map_alwaysShowNames",
"path_suggestedRoute",
"path_searchRepeaters",
"channels_shareQr",
@ -730,6 +752,7 @@
"settings_infoFirmware",
"settings_infoModel",
"settings_infoOffbandCaps",
"settings_infoBuild",
"settings_infoDataScope",
"settings_infoDataScopeSubtitle",
"settings_publicKeyCopied",
@ -746,6 +769,7 @@
"channels_notifyOff",
"chat_replyWithRoute",
"channel_heardTooltip",
"map_alwaysShowNames",
"path_suggestedRoute",
"path_searchRepeaters",
"channels_shareQr",
@ -795,6 +819,7 @@
"settings_infoFirmware",
"settings_infoModel",
"settings_infoOffbandCaps",
"settings_infoBuild",
"settings_infoDataScope",
"settings_infoDataScopeSubtitle",
"settings_publicKeyCopied",
@ -811,6 +836,7 @@
"channels_notifyOff",
"chat_replyWithRoute",
"channel_heardTooltip",
"map_alwaysShowNames",
"path_suggestedRoute",
"path_searchRepeaters",
"channels_shareQr",
@ -860,6 +886,7 @@
"settings_infoFirmware",
"settings_infoModel",
"settings_infoOffbandCaps",
"settings_infoBuild",
"settings_infoDataScope",
"settings_infoDataScopeSubtitle",
"settings_publicKeyCopied",
@ -876,6 +903,7 @@
"channels_notifyOff",
"chat_replyWithRoute",
"channel_heardTooltip",
"map_alwaysShowNames",
"path_suggestedRoute",
"path_searchRepeaters",
"channels_shareQr",
@ -925,6 +953,7 @@
"settings_infoFirmware",
"settings_infoModel",
"settings_infoOffbandCaps",
"settings_infoBuild",
"settings_infoDataScope",
"settings_infoDataScopeSubtitle",
"settings_publicKeyCopied",
@ -941,6 +970,7 @@
"channels_notifyOff",
"chat_replyWithRoute",
"channel_heardTooltip",
"map_alwaysShowNames",
"path_suggestedRoute",
"path_searchRepeaters",
"channels_shareQr",
@ -990,6 +1020,7 @@
"settings_infoFirmware",
"settings_infoModel",
"settings_infoOffbandCaps",
"settings_infoBuild",
"settings_infoDataScope",
"settings_infoDataScopeSubtitle",
"settings_publicKeyCopied",
@ -1006,6 +1037,7 @@
"channels_notifyOff",
"chat_replyWithRoute",
"channel_heardTooltip",
"map_alwaysShowNames",
"path_suggestedRoute",
"path_searchRepeaters",
"channels_shareQr",
@ -1055,6 +1087,7 @@
"settings_infoFirmware",
"settings_infoModel",
"settings_infoOffbandCaps",
"settings_infoBuild",
"settings_infoDataScope",
"settings_infoDataScopeSubtitle",
"settings_publicKeyCopied",
@ -1071,6 +1104,7 @@
"channels_notifyOff",
"chat_replyWithRoute",
"channel_heardTooltip",
"map_alwaysShowNames",
"path_suggestedRoute",
"path_searchRepeaters",
"channels_shareQr",

Loading…
Cancel
Save

Powered by TurnKey Linux.