feat(dev): add secrets dev screen (used to recover corrupted wallet) (#2234)

* feat(dev): add secrets dev screen (used to recover corrupted wallet)

* fix(dev): decode only password fields
This commit is contained in:
cyan
2025-04-30 09:29:08 +03:00
committed by GitHub
parent e527083871
commit da8a82a10f
7 changed files with 173 additions and 0 deletions
+16
View File
@@ -251,6 +251,22 @@ class $BackupService {
await importWalletKeychainInfo(info);
});
for (var key in (keychainJSON['_all'] as Map<String, dynamic>).keys) {
try {
if (!key.startsWith('MONERO_WALLET_')) continue;
final decodedPassword = decodeWalletPassword(password: keychainJSON['_all'][key].toString());
final walletName = key.split('_WALLET_')[1];
final walletType = key.split('_WALLET_')[0].toLowerCase();
await importWalletKeychainInfo({
'name': walletName,
'type': "WalletType.$walletType",
'password': decodedPassword,
});
} catch (e) {
printV('Error importing wallet ($key) password: $e');
}
}
keychainDumpFile.deleteSync();
}