mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-25 04:59:33 +00:00
save
This commit is contained in:
parent
049e4def27
commit
fc6be2aa97
1 changed files with 27 additions and 0 deletions
|
@ -185,6 +185,8 @@ Future<void> defaultSettingsMigration(
|
||||||
case 25:
|
case 25:
|
||||||
await rewriteSecureStoragePin(secureStorage: secureStorage);
|
await rewriteSecureStoragePin(secureStorage: secureStorage);
|
||||||
break;
|
break;
|
||||||
|
case 26:
|
||||||
|
await pinEncryptionMigration(secureStorage: secureStorage);
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -378,6 +380,31 @@ Node getMoneroDefaultNode({required Box<Node> nodes}) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> pinEncryptionMigration({required FlutterSecureStorage secureStorage}) async {
|
||||||
|
try {
|
||||||
|
// first, get the encoded pin:
|
||||||
|
final keyForPinCode = generateStoreKeyFor(key: SecretStoreKey.pinCodePassword);
|
||||||
|
String? encodedPin;
|
||||||
|
encodedPin = await secureStorage.read(key: keyForPinCode);
|
||||||
|
|
||||||
|
// if (encodedPin == null) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // ensure we overwrite by deleting the old key first:
|
||||||
|
// await secureStorage.delete(key: keyForPinCode);
|
||||||
|
// await secureStorage.write(
|
||||||
|
// key: keyForPinCode,
|
||||||
|
// value: encodedPin,
|
||||||
|
// iOptions: IOSOptions(accessibility: KeychainAccessibility.first_unlock),
|
||||||
|
// mOptions: MacOsOptions(accessibility: KeychainAccessibility.first_unlock),
|
||||||
|
// );
|
||||||
|
} catch (e) {
|
||||||
|
// failure isn't really an option since we'll be updating how pins are stored and used
|
||||||
|
print(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> rewriteSecureStoragePin({required FlutterSecureStorage secureStorage}) async {
|
Future<void> rewriteSecureStoragePin({required FlutterSecureStorage secureStorage}) async {
|
||||||
// the bug only affects ios/mac:
|
// the bug only affects ios/mac:
|
||||||
if (!Platform.isIOS && !Platform.isMacOS) {
|
if (!Platform.isIOS && !Platform.isMacOS) {
|
||||||
|
|
Loading…
Reference in a new issue