fix(app): read the version from the installed package
The version was a hand-written constant that had to be kept in sync with `version:` in pubspec.yaml. It was not: the constant still said 1.1.0 while the shipped build was 1.1.2+22, so every abuse report carried a version that no build ever had — and reports could not be traced back to a build. AppInfo reads versionName / CFBundleShortVersionString, which Flutter derives from the pubspec, so the two cannot drift apart again. Reports now carry the build number as well; when the version is not known yet the field is omitted rather than guessed. Also adds the timestamp regression test that covers MessagingService.wireSentAt, which shipped in 1.1.2 without its test.
This commit is contained in:
@@ -6,6 +6,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:intl/date_symbol_data_local.dart';
|
||||
import 'package:sepot/app.dart';
|
||||
import 'package:sepot/core/app_info.dart';
|
||||
import 'package:sepot/core/constants/app_constants.dart';
|
||||
import 'package:sepot/core/crypto/sepot_crypto.dart';
|
||||
import 'package:sepot/core/l10n/l10n.dart';
|
||||
@@ -56,6 +57,14 @@ void main(List<String> args) {
|
||||
debugPrint('FlutterError: ${details.exceptionAsString()}');
|
||||
};
|
||||
|
||||
// Verze appky z balíčku — nekritické, bez ní se jen v nastavení a
|
||||
// v hlášení zneužití místo čísla ukáže AppInfo.unknownVersion.
|
||||
try {
|
||||
await AppInfo.init();
|
||||
} catch (e, s) {
|
||||
debugPrint('AppInfo.init selhalo (nekritické): $e\n$s');
|
||||
}
|
||||
|
||||
// Formáty dat všech podporovaných jazyků — nekritické, appka poběží i bez nich
|
||||
for (final lang in const ['cs', 'en', 'de', 'ru', 'it']) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user