Skip to content

Commit

Permalink
Merge pull request #11 from cake-tech/CW-832-cupcake-post-release-things
Browse files Browse the repository at this point in the history
CW-832-cupcake-post-release-things
  • Loading branch information
OmarHatem28 authored Nov 26, 2024
2 parents b81afb0 + 896084f commit e7290dd
Show file tree
Hide file tree
Showing 28 changed files with 4,067 additions and 92 deletions.
1 change: 1 addition & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ GeneratedPluginRegistrant.java
key.properties
**/*.keystore
**/*.jks
**/*.pwd
9 changes: 8 additions & 1 deletion 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,10 +50,11 @@ 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

PODFILE CHECKSUM: 819463e6a0290f5a72f145ba7cde16e8b6ef0796

COCOAPODS: 1.15.2
COCOAPODS: 1.16.2
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
13 changes: 8 additions & 5 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:cupcake/l10n/app_localizations.dart';
import 'package:cupcake/themes/base_theme.dart';
import 'package:cupcake/utils/config.dart';
import 'package:cupcake/utils/filesystem.dart';
import 'package:cupcake/utils/secure_storage.dart';
import 'package:cupcake/view_model/home_screen_view_model.dart';
import 'package:cupcake/views/home_screen.dart';
import 'package:cupcake/views/initial_setup_screen.dart';
Expand All @@ -13,12 +14,14 @@ late String signingKeyFound = "";

Future<void> appInit() async {
WidgetsFlutterBinding.ensureInitialized();
// try {
// signingKeyFound = await getSigningKey() ?? "unknown";
// } catch (e) {
// signingKeyFound = e.toString();
// }
await initializeBaseStoragePath();
if (config.initialSetupComplete == false) {
final oldSecureStorage = await secureStorage.readAll();
final date = DateTime.now().toIso8601String();
config.oldSecureStorage[date] = oldSecureStorage;
config.save();
await secureStorage.deleteAll();
}
}

Future<void> main() async {
Expand Down
8 changes: 8 additions & 0 deletions lib/utils/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,19 @@ class CupcakeConfig {
required this.msForQrCode,
required this.maxFragmentLength,
required this.walletSort,
required this.biometricEnabled,
required this.debug,
required this.oldSecureStorage,
});
CoinWalletInfo? lastWallet;
bool initialSetupComplete;
int walletMigrationLevel;
int msForQrCode;
int maxFragmentLength;
int walletSort;
bool biometricEnabled;
bool debug;
Map<String, dynamic> oldSecureStorage;

factory CupcakeConfig.fromJson(Map<String, dynamic> json) {
return CupcakeConfig(
Expand All @@ -32,7 +36,9 @@ 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 @@ -44,6 +50,8 @@ class CupcakeConfig {
'msForQrCode': msForQrCode,
'maxFragmentLength': maxFragmentLength,
'walletSort': walletSort,
'biometricEnabled': biometricEnabled,
'oldSecureStorage': oldSecureStorage,
'debug': debug,
};
}
Expand Down
Loading

0 comments on commit e7290dd

Please sign in to comment.