Skip to content

Commit

Permalink
CW-832 Cupcake post release things
Browse files Browse the repository at this point in the history
- Random name generator button
- Not entering a wallet name error (should be enhanced)
- on restore wallet top screen it says "create wallet" instead of restore wallet
- Not entering a wallet name error (should be more friendly and preferably on the field not a popup)
- When renaming a wallet to the same name, we need to improve the error message
- titles for pin screen
- tap to copy (verify - add a toast)
- biometric auth
- create pin screen - once there is a pin make only one pin, without confirmation
  • Loading branch information
MrCyjaneK committed Nov 22, 2024
1 parent dc4c579 commit 5b7ce21
Show file tree
Hide file tree
Showing 27 changed files with 4,046 additions and 78 deletions.
7 changes: 7 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ PODS:
- Flutter
- integration_test (0.0.1):
- Flutter
- local_auth_darwin (0.0.1):
- Flutter
- FlutterMacOS
- package_info_plus (0.4.5):
- Flutter
- path_provider_foundation (0.0.1):
Expand All @@ -19,6 +22,7 @@ DEPENDENCIES:
- Flutter (from `Flutter`)
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
- integration_test (from `.symlinks/plugins/integration_test/ios`)
- local_auth_darwin (from `.symlinks/plugins/local_auth_darwin/darwin`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- share_plus (from `.symlinks/plugins/share_plus/ios`)
Expand All @@ -32,6 +36,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_secure_storage/ios"
integration_test:
:path: ".symlinks/plugins/integration_test/ios"
local_auth_darwin:
:path: ".symlinks/plugins/local_auth_darwin/darwin"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_foundation:
Expand All @@ -44,6 +50,7 @@ SPEC CHECKSUMS:
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12
integration_test: 252f60fa39af5e17c3aa9899d35d908a0721b573
local_auth_darwin: 66e40372f1c29f383a314c738c7446e2f7fdadc3
package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
share_plus: 8875f4f2500512ea181eef553c3e27dba5135aad
Expand Down
2 changes: 2 additions & 0 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,7 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>NSFaceIDUsageDescription</key>
<string>Authenticate with FaceID instead of pin</string>
</dict>
</plist>
9 changes: 7 additions & 2 deletions lib/coins/monero/coin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -391,13 +391,18 @@ class MoneroWalletInfo extends CoinWalletInfo {

@override
Future<void> renameWallet(String newName) async {
if (p.basename(walletName) == newName) {
throw Exception("Wallet wasn't renamed");
}
for (var element in wPtrList) {
monero.WalletManager_closeWallet(Monero.wmPtr, element, true);
}
wPtrList.clear();
final basePath = p.dirname(walletName);
File(walletName).rename(p.join(basePath, newName));
File("$walletName.keys").rename(p.join(basePath, "$newName.keys"));
File(walletName).copySync(p.join(basePath, newName));
File("$walletName.keys").copySync(p.join(basePath, "$newName.keys"));
File(walletName).deleteSync();
File("$walletName.keys").deleteSync();
_walletName = newName;
}

Expand Down
12 changes: 12 additions & 0 deletions lib/coins/monero/wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,18 @@ class MoneroWallet implements CoinWallet {
value: secrets[key] ?? "unknown");
},
),
if (config.debug)
...List.generate(
config.toJson().keys.length,
(index) {
final key = config.toJson().keys.elementAt(index);
return WalletSeedDetail(
type: WalletSeedDetailType.text,
name: key,
value: const JsonEncoder.withIndent(' ')
.convert(config.toJson()[key]));
},
),
];
}
}
Expand Down
2 changes: 2 additions & 0 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
"balance": "Balance",
"wallet_seed": "Wallet seed",
"wallet_passphrase": "Wallet passphrase",
"wallet_password": "Wallet password",
"wallet_password_repeat": "Wallet password (repeat)",
"secret_spend_key": "Secret spend key",
"spend_key": "Spend key",
"secret_view_key": "Secret view key",
Expand Down
2 changes: 2 additions & 0 deletions lib/l10n/app_pl.arb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
"balance": "Saldo",
"wallet_seed": "Fraza odzyskiwania",
"wallet_passphrase": "Hasło frazy odzyskiwania",
"wallet_password": "Hasło portfela",
"wallet_password_repeat": "Hasło portfela (ponownie)",
"secret_spend_key": "Tajny klucz wydatków",
"spend_key": "Klucz wydatków",
"secret_view_key": "Tajny klucz podglądu",
Expand Down
3 changes: 2 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ late String signingKeyFound = "";
Future<void> appInit() async {
WidgetsFlutterBinding.ensureInitialized();
await initializeBaseStoragePath();
if (config.initialSetupComplete != false) {
if (config.initialSetupComplete == false) {
final oldSecureStorage = await secureStorage.readAll();
final date = DateTime.now().toIso8601String();
config.oldSecureStorage[date] = oldSecureStorage;
config.save();
await secureStorage.deleteAll();
}
}
Expand Down
5 changes: 5 additions & 0 deletions lib/utils/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class CupcakeConfig {
required this.msForQrCode,
required this.maxFragmentLength,
required this.walletSort,
required this.biometricEnabled,
required this.debug,
required this.oldSecureStorage,
});
Expand All @@ -23,6 +24,7 @@ class CupcakeConfig {
int msForQrCode;
int maxFragmentLength;
int walletSort;
bool biometricEnabled;
bool debug;
Map<String, dynamic> oldSecureStorage;

Expand All @@ -34,6 +36,7 @@ class CupcakeConfig {
msForQrCode: json['msForQrCode'] ?? 1000 ~/ 3.5,
maxFragmentLength: json['maxFragmentLength'] ?? 130,
walletSort: json['walletSort'] ?? 0,
biometricEnabled: json['biometricEnabled'] ?? false,
debug: json['debug'] ?? false,
oldSecureStorage: json['oldSecureStorage'] ?? {},
);
Expand All @@ -47,6 +50,8 @@ class CupcakeConfig {
'msForQrCode': msForQrCode,
'maxFragmentLength': maxFragmentLength,
'walletSort': walletSort,
'biometricEnabled': biometricEnabled,
'oldSecureStorage': oldSecureStorage,
'debug': debug,
};
}
Expand Down
Loading

0 comments on commit 5b7ce21

Please sign in to comment.