mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-20 02:59:26 +01:00
fix: Linux crash on secure storage usage
This commit is contained in:
parent
a103eb971c
commit
2e4a5f62e4
@ -58,9 +58,11 @@ class FlutterFluffyBoxDatabase extends FluffyBoxDatabase {
|
|||||||
hiverCipher = fluffybox.HiveAesCipher(base64Url.decode(rawEncryptionKey));
|
hiverCipher = fluffybox.HiveAesCipher(base64Url.decode(rawEncryptionKey));
|
||||||
} on MissingPluginException catch (_) {
|
} on MissingPluginException catch (_) {
|
||||||
Logs().i('FluffyBox encryption is not supported on this platform');
|
Logs().i('FluffyBox encryption is not supported on this platform');
|
||||||
} catch (_) {
|
} catch (e, s) {
|
||||||
const FlutterSecureStorage().delete(key: _cipherStorageKey);
|
const FlutterSecureStorage()
|
||||||
rethrow;
|
.delete(key: _cipherStorageKey)
|
||||||
|
.catchError((_) {});
|
||||||
|
Logs().w('Unable to init FluffyBox encryption', e, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore: deprecated_member_use
|
// ignore: deprecated_member_use
|
||||||
|
@ -51,9 +51,11 @@ class FlutterHiveCollectionsDatabase extends HiveCollectionsDatabase {
|
|||||||
hiverCipher = HiveAesCipher(base64Url.decode(rawEncryptionKey));
|
hiverCipher = HiveAesCipher(base64Url.decode(rawEncryptionKey));
|
||||||
} on MissingPluginException catch (_) {
|
} on MissingPluginException catch (_) {
|
||||||
Logs().i('Hive encryption is not supported on this platform');
|
Logs().i('Hive encryption is not supported on this platform');
|
||||||
} catch (_) {
|
} catch (e, s) {
|
||||||
const FlutterSecureStorage().delete(key: _cipherStorageKey);
|
const FlutterSecureStorage()
|
||||||
rethrow;
|
.delete(key: _cipherStorageKey)
|
||||||
|
.catchError((_) {});
|
||||||
|
Logs().w('Unable to init Hive encryption', e, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
final db = FlutterHiveCollectionsDatabase(
|
final db = FlutterHiveCollectionsDatabase(
|
||||||
|
Loading…
Reference in New Issue
Block a user