diff --git a/lib/src/screens/restore/restore_from_keystone_private_mode_page.dart b/lib/src/screens/restore/restore_from_keystone_private_mode_page.dart index 9900459d3..6e031165c 100644 --- a/lib/src/screens/restore/restore_from_keystone_private_mode_page.dart +++ b/lib/src/screens/restore/restore_from_keystone_private_mode_page.dart @@ -54,22 +54,19 @@ class RestoreFromKeystonePrivateModePage extends BasePage { final restoreJson = json.decode(code); - final cipherPrimaryAddress = Uint8List.fromList( - Hex.HEX.decode(restoreJson['primaryAddress'] as String)); + restoreJson['primaryAddress'] = await _decryptData( + Uint8List.fromList( + Hex.HEX.decode(restoreJson['primaryAddress'] as String)), + secretKey); - restoreJson['primaryAddress'] = - await _decryptData(cipherPrimaryAddress, secretKey); - - final cipherPrivateViewKey = Uint8List.fromList( - Hex.HEX.decode(restoreJson['privateViewKey'] as String)); - - restoreJson['privateViewKey'] = - await _decryptData(cipherPrivateViewKey, secretKey); + restoreJson['privateViewKey'] = await _decryptData( + Uint8List.fromList( + Hex.HEX.decode(restoreJson['privateViewKey'] as String)), + secretKey); final res = json.encode(restoreJson); - print(res); Navigator.of(context).pop(res); - } catch (e) { + } catch (_) { pinCodeStateKey.currentState?.reset(); showBar( context, diff --git a/lib/view_model/restore/restore_wallet.dart b/lib/view_model/restore/restore_wallet.dart index a52d6b73d..beaa54068 100644 --- a/lib/view_model/restore/restore_wallet.dart +++ b/lib/view_model/restore/restore_wallet.dart @@ -18,8 +18,7 @@ class RestoredWallet { this.recipientName, this.height, this.privateKey, - this.source, - this.isEncrypted = false}); + this.source}); final WalletRestoreMode restoreMode; final WalletType type; @@ -35,7 +34,6 @@ class RestoredWallet { final int? height; final String? privateKey; final String? source; - final bool? isEncrypted; factory RestoredWallet.fromKey(Map json) { try { @@ -45,7 +43,6 @@ class RestoredWallet { json['view_key'] = codeParsed["privateViewKey"]; json['height'] = codeParsed["restoreHeight"].toString(); json['source'] = codeParsed["source"] ?? ''; - json['encrypted'] = codeParsed["encrypted"] ?? false; } } catch (e) { // fine, we don't care, it is only for monero anyway @@ -60,7 +57,6 @@ class RestoredWallet { height: height != null ? int.tryParse(height)??0 : 0, privateKey: json['private_key'] as String?, source: json['source'] as String?, - isEncrypted: json['encrypted'] as bool? ?? false, ); }