Skip to content

Commit e7290dd

Browse files
authored
Merge pull request #11 from cake-tech/CW-832-cupcake-post-release-things
CW-832-cupcake-post-release-things
2 parents b81afb0 + 896084f commit e7290dd

28 files changed

+4067
-92
lines changed

android/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ GeneratedPluginRegistrant.java
1111
key.properties
1212
**/*.keystore
1313
**/*.jks
14+
**/*.pwd

ios/Podfile.lock

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ PODS:
66
- Flutter
77
- integration_test (0.0.1):
88
- Flutter
9+
- local_auth_darwin (0.0.1):
10+
- Flutter
11+
- FlutterMacOS
912
- package_info_plus (0.4.5):
1013
- Flutter
1114
- path_provider_foundation (0.0.1):
@@ -19,6 +22,7 @@ DEPENDENCIES:
1922
- Flutter (from `Flutter`)
2023
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
2124
- integration_test (from `.symlinks/plugins/integration_test/ios`)
25+
- local_auth_darwin (from `.symlinks/plugins/local_auth_darwin/darwin`)
2226
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
2327
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
2428
- share_plus (from `.symlinks/plugins/share_plus/ios`)
@@ -32,6 +36,8 @@ EXTERNAL SOURCES:
3236
:path: ".symlinks/plugins/flutter_secure_storage/ios"
3337
integration_test:
3438
:path: ".symlinks/plugins/integration_test/ios"
39+
local_auth_darwin:
40+
:path: ".symlinks/plugins/local_auth_darwin/darwin"
3541
package_info_plus:
3642
:path: ".symlinks/plugins/package_info_plus/ios"
3743
path_provider_foundation:
@@ -44,10 +50,11 @@ SPEC CHECKSUMS:
4450
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
4551
flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12
4652
integration_test: 252f60fa39af5e17c3aa9899d35d908a0721b573
53+
local_auth_darwin: 66e40372f1c29f383a314c738c7446e2f7fdadc3
4754
package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4
4855
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
4956
share_plus: 8875f4f2500512ea181eef553c3e27dba5135aad
5057

5158
PODFILE CHECKSUM: 819463e6a0290f5a72f145ba7cde16e8b6ef0796
5259

53-
COCOAPODS: 1.15.2
60+
COCOAPODS: 1.16.2

ios/Runner/Info.plist

+2
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,7 @@
4747
<string>UIInterfaceOrientationLandscapeLeft</string>
4848
<string>UIInterfaceOrientationLandscapeRight</string>
4949
</array>
50+
<key>NSFaceIDUsageDescription</key>
51+
<string>Authenticate with FaceID instead of pin</string>
5052
</dict>
5153
</plist>

lib/coins/monero/coin.dart

+7-2
Original file line numberDiff line numberDiff line change
@@ -391,13 +391,18 @@ class MoneroWalletInfo extends CoinWalletInfo {
391391

392392
@override
393393
Future<void> renameWallet(String newName) async {
394+
if (p.basename(walletName) == newName) {
395+
throw Exception("Wallet wasn't renamed");
396+
}
394397
for (var element in wPtrList) {
395398
monero.WalletManager_closeWallet(Monero.wmPtr, element, true);
396399
}
397400
wPtrList.clear();
398401
final basePath = p.dirname(walletName);
399-
File(walletName).rename(p.join(basePath, newName));
400-
File("$walletName.keys").rename(p.join(basePath, "$newName.keys"));
402+
File(walletName).copySync(p.join(basePath, newName));
403+
File("$walletName.keys").copySync(p.join(basePath, "$newName.keys"));
404+
File(walletName).deleteSync();
405+
File("$walletName.keys").deleteSync();
401406
_walletName = newName;
402407
}
403408

lib/coins/monero/wallet.dart

+12
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,18 @@ class MoneroWallet implements CoinWallet {
299299
value: secrets[key] ?? "unknown");
300300
},
301301
),
302+
if (config.debug)
303+
...List.generate(
304+
config.toJson().keys.length,
305+
(index) {
306+
final key = config.toJson().keys.elementAt(index);
307+
return WalletSeedDetail(
308+
type: WalletSeedDetailType.text,
309+
name: key,
310+
value: const JsonEncoder.withIndent(' ')
311+
.convert(config.toJson()[key]));
312+
},
313+
),
302314
];
303315
}
304316
}

lib/l10n/app_en.arb

+2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
"balance": "Balance",
5555
"wallet_seed": "Wallet seed",
5656
"wallet_passphrase": "Wallet passphrase",
57+
"wallet_password": "Wallet password",
58+
"wallet_password_repeat": "Wallet password (repeat)",
5759
"secret_spend_key": "Secret spend key",
5860
"spend_key": "Spend key",
5961
"secret_view_key": "Secret view key",

lib/l10n/app_pl.arb

+2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
"balance": "Saldo",
5555
"wallet_seed": "Fraza odzyskiwania",
5656
"wallet_passphrase": "Hasło frazy odzyskiwania",
57+
"wallet_password": "Hasło portfela",
58+
"wallet_password_repeat": "Hasło portfela (ponownie)",
5759
"secret_spend_key": "Tajny klucz wydatków",
5860
"spend_key": "Klucz wydatków",
5961
"secret_view_key": "Tajny klucz podglądu",

lib/main.dart

+8-5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'package:cupcake/l10n/app_localizations.dart';
22
import 'package:cupcake/themes/base_theme.dart';
33
import 'package:cupcake/utils/config.dart';
44
import 'package:cupcake/utils/filesystem.dart';
5+
import 'package:cupcake/utils/secure_storage.dart';
56
import 'package:cupcake/view_model/home_screen_view_model.dart';
67
import 'package:cupcake/views/home_screen.dart';
78
import 'package:cupcake/views/initial_setup_screen.dart';
@@ -13,12 +14,14 @@ late String signingKeyFound = "";
1314

1415
Future<void> appInit() async {
1516
WidgetsFlutterBinding.ensureInitialized();
16-
// try {
17-
// signingKeyFound = await getSigningKey() ?? "unknown";
18-
// } catch (e) {
19-
// signingKeyFound = e.toString();
20-
// }
2117
await initializeBaseStoragePath();
18+
if (config.initialSetupComplete == false) {
19+
final oldSecureStorage = await secureStorage.readAll();
20+
final date = DateTime.now().toIso8601String();
21+
config.oldSecureStorage[date] = oldSecureStorage;
22+
config.save();
23+
await secureStorage.deleteAll();
24+
}
2225
}
2326

2427
Future<void> main() async {

lib/utils/config.dart

+8
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,19 @@ class CupcakeConfig {
1414
required this.msForQrCode,
1515
required this.maxFragmentLength,
1616
required this.walletSort,
17+
required this.biometricEnabled,
1718
required this.debug,
19+
required this.oldSecureStorage,
1820
});
1921
CoinWalletInfo? lastWallet;
2022
bool initialSetupComplete;
2123
int walletMigrationLevel;
2224
int msForQrCode;
2325
int maxFragmentLength;
2426
int walletSort;
27+
bool biometricEnabled;
2528
bool debug;
29+
Map<String, dynamic> oldSecureStorage;
2630

2731
factory CupcakeConfig.fromJson(Map<String, dynamic> json) {
2832
return CupcakeConfig(
@@ -32,7 +36,9 @@ class CupcakeConfig {
3236
msForQrCode: json['msForQrCode'] ?? 1000 ~/ 3.5,
3337
maxFragmentLength: json['maxFragmentLength'] ?? 130,
3438
walletSort: json['walletSort'] ?? 0,
39+
biometricEnabled: json['biometricEnabled'] ?? false,
3540
debug: json['debug'] ?? false,
41+
oldSecureStorage: json['oldSecureStorage'] ?? {},
3642
);
3743
}
3844

@@ -44,6 +50,8 @@ class CupcakeConfig {
4450
'msForQrCode': msForQrCode,
4551
'maxFragmentLength': maxFragmentLength,
4652
'walletSort': walletSort,
53+
'biometricEnabled': biometricEnabled,
54+
'oldSecureStorage': oldSecureStorage,
4755
'debug': debug,
4856
};
4957
}

0 commit comments

Comments
 (0)