From 04d8abe4e14d06df51ae7092b99d63e2542f98ee Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Tue, 13 Jul 2021 18:16:55 -0700 Subject: [PATCH] make version text selectable; add profile password warning text; shorten buildver git hash --- .drone.yml | 4 ++-- README.md | 1 + lib/l10n/intl_de.arb | 4 +++- lib/l10n/intl_en.arb | 4 +++- lib/l10n/intl_es.arb | 4 +++- lib/l10n/intl_fr.arb | 6 ++++-- lib/l10n/intl_it.arb | 4 +++- lib/l10n/intl_pl.arb | 4 +++- lib/l10n/intl_pt.arb | 4 +++- lib/main.dart | 3 ++- lib/views/addeditprofileview.dart | 12 +++++++++++- lib/views/globalsettingsview.dart | 9 ++++++--- lib/views/torstatusview.dart | 2 +- 13 files changed, 45 insertions(+), 16 deletions(-) diff --git a/.drone.yml b/.drone.yml index 9122b097..f1dfd587 100644 --- a/.drone.yml +++ b/.drone.yml @@ -30,7 +30,7 @@ steps: path: /root/.pub-cache commands: - ./fetch-tor.sh - - echo `git describe --tags` > VERSION + - echo `git describe --tags --abbrev=1` > VERSION - echo `date +%G-%m-%d-%H-%M` > BUILDDATE - flutter pub get - mkdir deploy @@ -197,7 +197,7 @@ steps: commands: - powershell -command "Invoke-WebRequest -Uri https://dist.torproject.org/torbrowser/10.0.18/tor-win64-0.4.5.9.zip -OutFile tor.zip" - powershell -command "if ((Get-FileHash tor.zip -Algorithm sha512).Hash -ne '72764eb07ad8ab511603aba0734951ca003989f5f4686af91ba220217b4a8a4bcc5f571b59f52c847932f6efedf847b111621983050fcddbb8099d43ca66fb07' ) { Write-Error 'tor.zip sha512sum mismatch' }" - - git describe --tags > VERSION + - git describe --tags --abbrev=1 > VERSION - powershell -command "Get-Date -Format 'yyyy-MM-dd-HH-mm'" > BUILDDATE - .\fetch-libcwtch-go.ps1 diff --git a/README.md b/README.md index f95318aa..68d92554 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,7 @@ In Lokalise, hit Download and make sure: * Format is set to "Flutter (.arb) * Output filename is set to `l10n/intl_%LANG_ISO%.%FORMAT%` * Empty translations is set to "Replace with base language" +* Order "Last Update" Build, download and unzip the output, overwriting `lib/l10n`. The next time Flwtch is built, Flutter will notice the changes and update `app_localizations.dart` accordingly (thanks to `generate:true` in `pubspec.yaml`). diff --git a/lib/l10n/intl_de.arb b/lib/l10n/intl_de.arb index 0e5cb515..f9c78196 100644 --- a/lib/l10n/intl_de.arb +++ b/lib/l10n/intl_de.arb @@ -1,6 +1,8 @@ { "@@locale": "de", - "@@last_modified": "2021-07-10T17:32:01+02:00", + "@@last_modified": "2021-07-14T01:50:27+02:00", + "plainProfileDescription": "We recommend that you protect your Cwtch profiles with a password. If you do not set a password on this profile then anyone who has access to this device may be able to access information about this profile, including contacts, messages and sensitive cryptographic keys.", + "encryptedProfileDescription": "Encrypting a profile with a password protects it from other people who may also use this device. Encrypted profiles cannot be decrypted, displayed or accessed until the correct password is entered to unlock them.", "addContactConfirm": "Add contact %1", "addContact": "Add contact", "contactGoto": "Go to conversation with %1", diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 5cd879bc..3cc670be 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -1,6 +1,8 @@ { "@@locale": "en", - "@@last_modified": "2021-07-10T17:32:01+02:00", + "@@last_modified": "2021-07-14T01:50:27+02:00", + "plainProfileDescription": "We recommend that you protect your Cwtch profiles with a password. If you do not set a password on this profile then anyone who has access to this device may be able to access information about this profile, including contacts, messages and sensitive cryptographic keys.", + "encryptedProfileDescription": "Encrypting a profile with a password protects it from other people who may also use this device. Encrypted profiles cannot be decrypted, displayed or accessed until the correct password is entered to unlock them.", "addContactConfirm": "Add contact %1", "addContact": "Add contact", "contactGoto": "Go to conversation with %1", diff --git a/lib/l10n/intl_es.arb b/lib/l10n/intl_es.arb index c3e2d8c2..012f8349 100644 --- a/lib/l10n/intl_es.arb +++ b/lib/l10n/intl_es.arb @@ -1,6 +1,8 @@ { "@@locale": "es", - "@@last_modified": "2021-07-10T17:32:01+02:00", + "@@last_modified": "2021-07-14T01:50:27+02:00", + "plainProfileDescription": "We recommend that you protect your Cwtch profiles with a password. If you do not set a password on this profile then anyone who has access to this device may be able to access information about this profile, including contacts, messages and sensitive cryptographic keys.", + "encryptedProfileDescription": "Encrypting a profile with a password protects it from other people who may also use this device. Encrypted profiles cannot be decrypted, displayed or accessed until the correct password is entered to unlock them.", "addContactConfirm": "Add contact %1", "addContact": "Add contact", "contactGoto": "Go to conversation with %1", diff --git a/lib/l10n/intl_fr.arb b/lib/l10n/intl_fr.arb index 7bc91585..0bc51e36 100644 --- a/lib/l10n/intl_fr.arb +++ b/lib/l10n/intl_fr.arb @@ -1,7 +1,9 @@ { "@@locale": "fr", - "@@last_modified": "2021-07-10T17:32:01+02:00", - "addContactConfirm": "Add contact %1", + "@@last_modified": "2021-07-14T01:50:27+02:00", + "plainProfileDescription": "Nous vous recommandons de protéger vos profils Cwtch par un mot de passe. Si vous ne définissez pas de mot de passe sur ce profil, toute personne ayant accès à cet appareil peut être en mesure d'accéder aux informations relatives à ce profil, y compris les contacts, les messages et les clés de chiffrement sensibles.", + "encryptedProfileDescription": "Le chiffrement d'un profil à l'aide d'un mot de passe le protège des autres personnes susceptibles d'utiliser également cet appareil. Les profils chiffrés ne peuvent pas être déchiffrés , affichés ou accessibles tant que le mot de passe correct n'a pas été saisi pour les déverrouiller.", + "addContactConfirm": "Ajouter le contact %1", "addContact": "Ajouter le contact", "contactGoto": "Aller à la conversation avec %1", "settingUIColumnOptionSame": "Même réglage que pour le mode portrait", diff --git a/lib/l10n/intl_it.arb b/lib/l10n/intl_it.arb index 9d2f9485..74b19e73 100644 --- a/lib/l10n/intl_it.arb +++ b/lib/l10n/intl_it.arb @@ -1,6 +1,8 @@ { "@@locale": "it", - "@@last_modified": "2021-07-10T17:32:01+02:00", + "@@last_modified": "2021-07-14T01:50:27+02:00", + "plainProfileDescription": "We recommend that you protect your Cwtch profiles with a password. If you do not set a password on this profile then anyone who has access to this device may be able to access information about this profile, including contacts, messages and sensitive cryptographic keys.", + "encryptedProfileDescription": "Encrypting a profile with a password protects it from other people who may also use this device. Encrypted profiles cannot be decrypted, displayed or accessed until the correct password is entered to unlock them.", "addContactConfirm": "Add contact %1", "addContact": "Add contact", "contactGoto": "Go to conversation with %1", diff --git a/lib/l10n/intl_pl.arb b/lib/l10n/intl_pl.arb index fe721ecf..059c640f 100644 --- a/lib/l10n/intl_pl.arb +++ b/lib/l10n/intl_pl.arb @@ -1,6 +1,8 @@ { "@@locale": "pl", - "@@last_modified": "2021-07-10T17:32:01+02:00", + "@@last_modified": "2021-07-14T01:50:27+02:00", + "plainProfileDescription": "We recommend that you protect your Cwtch profiles with a password. If you do not set a password on this profile then anyone who has access to this device may be able to access information about this profile, including contacts, messages and sensitive cryptographic keys.", + "encryptedProfileDescription": "Encrypting a profile with a password protects it from other people who may also use this device. Encrypted profiles cannot be decrypted, displayed or accessed until the correct password is entered to unlock them.", "addContactConfirm": "Add contact %1", "addContact": "Add contact", "contactGoto": "Go to conversation with %1", diff --git a/lib/l10n/intl_pt.arb b/lib/l10n/intl_pt.arb index 53180cc3..af6f049e 100644 --- a/lib/l10n/intl_pt.arb +++ b/lib/l10n/intl_pt.arb @@ -1,6 +1,8 @@ { "@@locale": "pt", - "@@last_modified": "2021-07-10T17:32:01+02:00", + "@@last_modified": "2021-07-14T01:50:27+02:00", + "plainProfileDescription": "We recommend that you protect your Cwtch profiles with a password. If you do not set a password on this profile then anyone who has access to this device may be able to access information about this profile, including contacts, messages and sensitive cryptographic keys.", + "encryptedProfileDescription": "Encrypting a profile with a password protects it from other people who may also use this device. Encrypted profiles cannot be decrypted, displayed or accessed until the correct password is entered to unlock them.", "addContactConfirm": "Add contact %1", "addContact": "Add contact", "contactGoto": "Go to conversation with %1", diff --git a/lib/main.dart b/lib/main.dart index 204c8695..37638d61 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'package:cwtch/config.dart'; import 'package:cwtch/notification_manager.dart'; import 'package:cwtch/views/messageview.dart'; import 'package:cwtch/widgets/rightshiftfixer.dart'; @@ -28,7 +29,7 @@ var globalTorStatus = TorStatus(); var globalAppState = AppState(); void main() { - print("main()"); + print("Cwtch version: ${EnvironmentConfig.BUILD_VER} built on: ${EnvironmentConfig.BUILD_DATE}"); LicenseRegistry.addLicense(() => licenses()); WidgetsFlutterBinding.ensureInitialized(); print("runApp()"); diff --git a/lib/views/addeditprofileview.dart b/lib/views/addeditprofileview.dart index 26d2dcd7..634bd9d7 100644 --- a/lib/views/addeditprofileview.dart +++ b/lib/views/addeditprofileview.dart @@ -134,6 +134,11 @@ class _AddEditProfileViewState extends State { ) ])), // We only allow setting password types on profile creation + Visibility( + visible: Provider.of(context).onion.isEmpty, + child: SizedBox( + height: 20, + )), Visibility( visible: Provider.of(context).onion.isEmpty, child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -147,7 +152,12 @@ class _AddEditProfileViewState extends State { AppLocalizations.of(context)!.radioUsePassword, style: TextStyle(color: theme.current().mainTextColor()), ), - ])), + Flexible( + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 24), + child: Text( usePassword ? AppLocalizations.of(context)!.encryptedProfileDescription : AppLocalizations.of(context)!.plainProfileDescription, + textAlign: TextAlign.left, + )))])), SizedBox( height: 20, ), diff --git a/lib/views/globalsettingsview.dart b/lib/views/globalsettingsview.dart index aa782034..afff9910 100644 --- a/lib/views/globalsettingsview.dart +++ b/lib/views/globalsettingsview.dart @@ -34,6 +34,7 @@ class _GlobalSettingsViewState extends State { Widget _buildSettingsList() { return Consumer(builder: (context, settings, child) { return LayoutBuilder(builder: (BuildContext context, BoxConstraints viewportConstraints) { + var appIcon = Icon(Icons.info, color: settings.current().mainTextColor()); return Scrollbar( isAlwaysShown: true, child: SingleChildScrollView( @@ -177,12 +178,14 @@ class _GlobalSettingsViewState extends State { ], )), AboutListTile( - icon: Icon(Icons.info, color: settings.current().mainTextColor()), + icon: appIcon, applicationIcon: Padding(padding: EdgeInsets.all(5), child: Icon(CwtchIcons.cwtch_knott)), applicationName: "Cwtch (Flutter UI)", - applicationVersion: AppLocalizations.of(context)!.versionBuilddate.replaceAll("%1", EnvironmentConfig.BUILD_VER).replaceAll("%2", EnvironmentConfig.BUILD_DATE), applicationLegalese: '\u{a9} 2021 Open Privacy Research Society', - ), + aboutBoxChildren: [Padding( + padding: EdgeInsets.fromLTRB(24.0 + 10.0 + (appIcon.size ?? 24.0), 16.0, 0.0, 0.0), // About has 24 padding (ln 389) and there appears to be another 10 of padding in the widget + child: SelectableText(AppLocalizations.of(context)!.versionBuilddate.replaceAll("%1", EnvironmentConfig.BUILD_VER).replaceAll("%2", EnvironmentConfig.BUILD_DATE)), + )]), ])))); }); }); diff --git a/lib/views/torstatusview.dart b/lib/views/torstatusview.dart index e3f445da..0c6264fd 100644 --- a/lib/views/torstatusview.dart +++ b/lib/views/torstatusview.dart @@ -54,7 +54,7 @@ class _TorStatusView extends State { ), ListTile( title: Text(AppLocalizations.of(context)!.torVersion), - subtitle: Text(torStatus.version), + subtitle: SelectableText(torStatus.version), ), ])))); });