mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-02-25 10:50:40 +01:00
Merge branch 'linux-seahorse-fix' into 'main'
fix: Seahorse does not properly work on many Linux devices See merge request famedly/fluffychat!680
This commit is contained in:
commit
ec791d372f
@ -40,6 +40,8 @@ class FlutterFluffyBoxDatabase extends FluffyBoxDatabase {
|
|||||||
final containsEncryptionKey =
|
final containsEncryptionKey =
|
||||||
await secureStorage.containsKey(key: _cipherStorageKey);
|
await secureStorage.containsKey(key: _cipherStorageKey);
|
||||||
if (!containsEncryptionKey) {
|
if (!containsEncryptionKey) {
|
||||||
|
// do not try to create a buggy secure storage for new Linux users
|
||||||
|
if (Platform.isLinux) throw MissingPluginException();
|
||||||
final key = Hive.generateSecureKey();
|
final key = Hive.generateSecureKey();
|
||||||
await secureStorage.write(
|
await secureStorage.write(
|
||||||
key: _cipherStorageKey,
|
key: _cipherStorageKey,
|
||||||
|
@ -31,7 +31,7 @@ class FlutterMatrixHiveStore extends FamedlySdkHiveDatabase {
|
|||||||
HiveCipher hiverCipher;
|
HiveCipher hiverCipher;
|
||||||
try {
|
try {
|
||||||
// Workaround for secure storage is calling Platform.operatingSystem on web
|
// Workaround for secure storage is calling Platform.operatingSystem on web
|
||||||
if (kIsWeb) throw MissingPluginException();
|
if (kIsWeb || Platform.isLinux) throw MissingPluginException();
|
||||||
|
|
||||||
const secureStorage = FlutterSecureStorage();
|
const secureStorage = FlutterSecureStorage();
|
||||||
final containsEncryptionKey =
|
final containsEncryptionKey =
|
||||||
|
@ -4,6 +4,7 @@ import 'package:flutter_app_lock/flutter_app_lock.dart';
|
|||||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||||
import 'package:pin_code_text_field/pin_code_text_field.dart';
|
import 'package:pin_code_text_field/pin_code_text_field.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
import 'package:fluffychat/config/app_config.dart';
|
import 'package:fluffychat/config/app_config.dart';
|
||||||
import 'package:fluffychat/config/setting_keys.dart';
|
import 'package:fluffychat/config/setting_keys.dart';
|
||||||
@ -71,8 +72,12 @@ class _LockScreenState extends State<LockScreen> {
|
|||||||
hasError: _wrongInput,
|
hasError: _wrongInput,
|
||||||
onDone: (String input) async {
|
onDone: (String input) async {
|
||||||
if (input ==
|
if (input ==
|
||||||
await const FlutterSecureStorage()
|
await ([TargetPlatform.linux]
|
||||||
.read(key: SettingKeys.appLockKey)) {
|
.contains(Theme.of(context).platform)
|
||||||
|
? SharedPreferences.getInstance().then((prefs) =>
|
||||||
|
prefs.getString(SettingKeys.appLockKey))
|
||||||
|
: const FlutterSecureStorage()
|
||||||
|
.read(key: SettingKeys.appLockKey))) {
|
||||||
AppLock.of(context).didUnlock();
|
AppLock.of(context).didUnlock();
|
||||||
} else {
|
} else {
|
||||||
_textEditingController.clear();
|
_textEditingController.clear();
|
||||||
|
@ -14,6 +14,7 @@ import 'package:http/http.dart' as http;
|
|||||||
import 'package:matrix/encryption.dart';
|
import 'package:matrix/encryption.dart';
|
||||||
import 'package:matrix/matrix.dart';
|
import 'package:matrix/matrix.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
import 'package:universal_html/html.dart' as html;
|
import 'package:universal_html/html.dart' as html;
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
import 'package:vrouter/vrouter.dart';
|
import 'package:vrouter/vrouter.dart';
|
||||||
@ -32,6 +33,8 @@ import '../utils/background_push.dart';
|
|||||||
import '../utils/famedlysdk_store.dart';
|
import '../utils/famedlysdk_store.dart';
|
||||||
import '../utils/platform_infos.dart';
|
import '../utils/platform_infos.dart';
|
||||||
|
|
||||||
|
// import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||||
|
|
||||||
class Matrix extends StatefulWidget {
|
class Matrix extends StatefulWidget {
|
||||||
static const String callNamespace = 'chat.fluffy.jitsi_call';
|
static const String callNamespace = 'chat.fluffy.jitsi_call';
|
||||||
|
|
||||||
@ -407,8 +410,11 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||||||
// Display the app lock
|
// Display the app lock
|
||||||
if (PlatformInfos.isMobile) {
|
if (PlatformInfos.isMobile) {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
const FlutterSecureStorage()
|
([TargetPlatform.linux].contains(Theme.of(context).platform)
|
||||||
.read(key: SettingKeys.appLockKey)
|
? SharedPreferences.getInstance()
|
||||||
|
.then((prefs) => prefs.getString(SettingKeys.appLockKey))
|
||||||
|
: const FlutterSecureStorage()
|
||||||
|
.read(key: SettingKeys.appLockKey))
|
||||||
.then((lock) {
|
.then((lock) {
|
||||||
if (lock?.isNotEmpty ?? false) {
|
if (lock?.isNotEmpty ?? false) {
|
||||||
AppLock.of(widget.context).enable();
|
AppLock.of(widget.context).enable();
|
||||||
|
@ -1233,7 +1233,7 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.4"
|
version: "2.0.4"
|
||||||
shared_preferences:
|
shared_preferences:
|
||||||
dependency: transitive
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: shared_preferences
|
name: shared_preferences
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
|
@ -66,6 +66,7 @@ dependencies:
|
|||||||
scroll_to_index: ^2.1.0
|
scroll_to_index: ^2.1.0
|
||||||
sentry: ^6.0.1
|
sentry: ^6.0.1
|
||||||
share: ^2.0.4
|
share: ^2.0.4
|
||||||
|
shared_preferences: ^2.0.12
|
||||||
slugify: ^2.0.0
|
slugify: ^2.0.0
|
||||||
swipe_to_action: ^0.2.0
|
swipe_to_action: ^0.2.0
|
||||||
uni_links: ^0.5.1
|
uni_links: ^0.5.1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user