From 61c6aecd03219ed6b5e5f8dfff5d31b3d927db01 Mon Sep 17 00:00:00 2001 From: Sorunome Date: Wed, 7 Oct 2020 09:35:25 +0200 Subject: [PATCH 1/5] chore: update flutter_secure_store --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 411e6a4..a2047ad 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -40,7 +40,7 @@ dependencies: path_provider: ^1.5.1 webview_flutter: ^0.3.19+9 share: ^0.6.3+5 - flutter_secure_storage: ^3.3.1+1 + flutter_secure_storage: ^3.3.4 http: ^0.12.0+4 universal_html: ^1.1.12 receive_sharing_intent: ^1.3.3 From 6d0f344b67c6eb81e0e85b01515c2bb14e8f93e3 Mon Sep 17 00:00:00 2001 From: Sorunome Date: Wed, 7 Oct 2020 18:39:21 +0200 Subject: [PATCH 2/5] fix: overgo issues with flutter_secure_store --- lib/components/theme_switcher.dart | 2 +- lib/utils/famedlysdk_store.dart | 34 +++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/lib/components/theme_switcher.dart b/lib/components/theme_switcher.dart index f5ddadf..a212b82 100644 --- a/lib/components/theme_switcher.dart +++ b/lib/components/theme_switcher.dart @@ -175,7 +175,7 @@ class ThemeSwitcherWidgetState extends State { BuildContext context; Future loadSelection(MatrixState matrix) async { - String item = await matrix.store.getItem('theme') ?? 'light'; + String item = await matrix.store.getItem('theme') ?? 'system'; selectedTheme = Themes.values.firstWhere( (e) => e.toString() == 'Themes.' + item, orElse: () => Themes.system); diff --git a/lib/utils/famedlysdk_store.dart b/lib/utils/famedlysdk_store.dart index b14e4b0..52b18fc 100644 --- a/lib/utils/famedlysdk_store.dart +++ b/lib/utils/famedlysdk_store.dart @@ -199,9 +199,30 @@ Future migrate(String clientName, Database db, Store store) async { }); } +// see https://github.com/mogol/flutter_secure_storage/issues/161#issuecomment-704578453 +class AsyncMutex { + Completer _completer; + + Future lock() async { + while (_completer != null) { + await _completer.future; + } + + _completer = Completer(); + } + + void unlock() { + assert(_completer != null); + final completer = _completer; + _completer = null; + completer.complete(); + } +} + class Store { final LocalStorage storage; final FlutterSecureStorage secureStorage; + static final _mutex = AsyncMutex(); Store() : storage = LocalStorage('LocalStorage'), @@ -217,9 +238,12 @@ class Store { } } try { + await _mutex.lock(); return await secureStorage.read(key: key); } catch (_) { return null; + } finally { + _mutex.unlock(); } } @@ -231,7 +255,12 @@ class Store { if (value == null) { return await secureStorage.delete(key: key); } else { - return await secureStorage.write(key: key, value: value); + try { + await _mutex.lock(); + return await secureStorage.write(key: key, value: value); + } finally { + _mutex.unlock(); + } } } @@ -245,9 +274,12 @@ class Store { } } try { + await _mutex.lock(); return await secureStorage.readAll(); } catch (_) { return {}; + } finally { + _mutex.unlock(); } } } From 0070ce55cc29419852415d800a2a31612613871a Mon Sep 17 00:00:00 2001 From: MTRNord Date: Fri, 9 Oct 2020 08:40:53 +0200 Subject: [PATCH 3/5] fix(locals): Calling the wrong parameter on userLeftTheChat caused wrong output --- lib/utils/matrix_locals.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/matrix_locals.dart b/lib/utils/matrix_locals.dart index fe79cf5..38be8bc 100644 --- a/lib/utils/matrix_locals.dart +++ b/lib/utils/matrix_locals.dart @@ -250,7 +250,7 @@ class MatrixLocals extends MatrixLocalizations { @override String userLeftTheChat(String targetName) { - return l10n.userLeftTheChat(userLeftTheChat); + return l10n.userLeftTheChat(targetName); } @override From 2dde86d235453471eea7b28fd690a5351008856e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xos=C3=A9=20M?= Date: Fri, 9 Oct 2020 04:29:54 +0000 Subject: [PATCH 4/5] Translated using Weblate (Galician) Currently translated at 100.0% (313 of 313 strings) Translation: FluffyChat/Translations-New Translate-URL: https://hosted.weblate.org/projects/fluffychat/translations-new/gl/ --- lib/l10n/intl_gl.arb | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/l10n/intl_gl.arb b/lib/l10n/intl_gl.arb index 5cb4196..313197d 100644 --- a/lib/l10n/intl_gl.arb +++ b/lib/l10n/intl_gl.arb @@ -1291,7 +1291,7 @@ "username": {} } }, - "sentCallInformations": "{senderName} enviou informaciĆ³ns da chamada", + "sentCallInformations": "{senderName} enviou informaciĆ³n da chamada", "@sentCallInformations": { "type": "text", "placeholders": { @@ -1702,5 +1702,25 @@ "@yourOwnUsername": { "type": "text", "placeholders": {} + }, + "privacy": "Privacidade", + "@privacy": { + "type": "text", + "placeholders": {} + }, + "enableEmotesGlobally": "Activar paquete emote globalmente", + "@enableEmotesGlobally": { + "type": "text", + "placeholders": {} + }, + "emotePacks": "Paquetes de Emotes para a sala", + "@emotePacks": { + "type": "text", + "placeholders": {} + }, + "changeDeviceName": "Cambiar nome do dispositivo", + "@changeDeviceName": { + "type": "text", + "placeholders": {} } } From 48d4caf4f011e1645ea23a20ce12d3f3fb76a039 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Sat, 10 Oct 2020 10:22:08 +0000 Subject: [PATCH 5/5] Update README.md --- README.md | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index d1d9449..562719f 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ * Change password * End-To-End-Encryption -## How to build +# How to build 1. [Install flutter](https://flutter.dev) @@ -44,29 +44,47 @@ git clone --recurse-submodules https://gitlab.com/ChristianPauly/fluffychat-flut cd fluffychat-flutter ``` -### Android / iOS +3. Choose your target platform below and enable support for it. -3. For Android install CMake from the SDK Manager +4. Debug with: `flutter run` -4. Install ninja: +### Android + +* Install CMake from the SDK Manager + +* Install ninja: ``` sudo apt install ninja-build ``` -5. Outcomment the Google Services plugin at the end of the file `android/app/build.gradle`: +* Outcomment the Google Services plugin at the end of the file `android/app/build.gradle`: ``` // apply plugin: "com.google.gms.google-services" ``` -6. `flutter run` +* Build with: `flutter build apk` + +### iOS / iPadOS + +* With xcode you can't build a release version without our cert. :-/ Use `flutter run --profile` to have a working version on your iOS device. ### Web -3. `flutter channel beta && flutter upgrade` +* Enable web support in Flutter: https://flutter.dev/docs/get-started/web -4. `flutter config --enable-web` +* Build with: `flutter build web --release` + +### Desktop (Linux, Windows, macOS) + +* Enable Desktop support in Flutter: https://flutter.dev/desktop + +* Build with one of these: +``` +flutter build linux --release +flutter build windows --release +flutter build macos --release +``` -5. `flutter run` ## How to add translations for your language