mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-01-12 10:42:35 +01:00
fix: secure storage on iOS was not setting up correctly
This commit is contained in:
parent
6a84eabe7f
commit
279f6ead50
@ -40,7 +40,7 @@ class FlutterFluffyBoxDatabase extends FluffyBoxDatabase {
|
|||||||
|
|
||||||
const secureStorage = FlutterSecureStorage();
|
const secureStorage = FlutterSecureStorage();
|
||||||
final containsEncryptionKey =
|
final containsEncryptionKey =
|
||||||
await secureStorage.containsKey(key: _cipherStorageKey);
|
await secureStorage.read(key: _cipherStorageKey) != null;
|
||||||
if (!containsEncryptionKey) {
|
if (!containsEncryptionKey) {
|
||||||
// do not try to create a buggy secure storage for new Linux users
|
// do not try to create a buggy secure storage for new Linux users
|
||||||
if (Platform.isLinux) throw MissingPluginException();
|
if (Platform.isLinux) throw MissingPluginException();
|
||||||
|
@ -33,7 +33,7 @@ class FlutterHiveCollectionsDatabase extends HiveCollectionsDatabase {
|
|||||||
|
|
||||||
const secureStorage = FlutterSecureStorage();
|
const secureStorage = FlutterSecureStorage();
|
||||||
final containsEncryptionKey =
|
final containsEncryptionKey =
|
||||||
await secureStorage.containsKey(key: _cipherStorageKey);
|
await secureStorage.read(key: _cipherStorageKey) != null;
|
||||||
if (!containsEncryptionKey) {
|
if (!containsEncryptionKey) {
|
||||||
// do not try to create a buggy secure storage for new Linux users
|
// do not try to create a buggy secure storage for new Linux users
|
||||||
if (Platform.isLinux) throw MissingPluginException();
|
if (Platform.isLinux) throw MissingPluginException();
|
||||||
@ -50,6 +50,9 @@ class FlutterHiveCollectionsDatabase extends HiveCollectionsDatabase {
|
|||||||
|
|
||||||
hiverCipher = HiveAesCipher(base64Url.decode(rawEncryptionKey));
|
hiverCipher = HiveAesCipher(base64Url.decode(rawEncryptionKey));
|
||||||
} on MissingPluginException catch (_) {
|
} on MissingPluginException catch (_) {
|
||||||
|
const FlutterSecureStorage()
|
||||||
|
.delete(key: _cipherStorageKey)
|
||||||
|
.catchError((_) {});
|
||||||
Logs().i('Hive encryption is not supported on this platform');
|
Logs().i('Hive encryption is not supported on this platform');
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
const FlutterSecureStorage()
|
const FlutterSecureStorage()
|
||||||
|
@ -668,7 +668,7 @@ packages:
|
|||||||
name: flutter_secure_storage
|
name: flutter_secure_storage
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.1.0"
|
version: "6.0.0"
|
||||||
flutter_secure_storage_linux:
|
flutter_secure_storage_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -43,7 +43,7 @@ dependencies:
|
|||||||
flutter_olm: ^1.2.0
|
flutter_olm: ^1.2.0
|
||||||
flutter_openssl_crypto: ^0.1.0
|
flutter_openssl_crypto: ^0.1.0
|
||||||
flutter_ringtone_player: ^3.1.1
|
flutter_ringtone_player: ^3.1.1
|
||||||
flutter_secure_storage: ^5.1.0
|
flutter_secure_storage: ^6.0.0
|
||||||
flutter_slidable: ^2.0.0
|
flutter_slidable: ^2.0.0
|
||||||
flutter_svg: ^0.22.0
|
flutter_svg: ^0.22.0
|
||||||
flutter_typeahead: ^4.0.0
|
flutter_typeahead: ^4.0.0
|
||||||
|
Loading…
Reference in New Issue
Block a user