CAKE-310. CAKE-309. Bugs fixes. Changed way for save wallet after adding of new account/subaddress. Added App transport security rule for iOS. Changed version to 4.1.5.

M committed Apr 14, 2021 at 11:54 UTC 5faf7f5cbaaa23d78575d1e9e072fc008fa77ec4
6 files changed +35 -21
cw_monero/lib/account_list.dart
+10 -4
@@ -5,6 +5,7 @@ import 'package:cw_monero/types.dart';
5 import 'package:cw_monero/monero_api.dart';
6 import 'package:cw_monero/structs/account_row.dart';
7 import 'package:flutter/foundation.dart';
8 +import 'package:cw_monero/wallet.dart';
9
10 final accountSizeNative = moneroApi
11 .lookup<NativeFunction<account_size>>('account_size')
@@ -70,8 +71,13 @@ void _setLabelForAccount(Map<String, dynamic> args) {
71 setLabelForAccountSync(label: label, accountIndex: accountIndex);
72 }
73
73 -Future<void> addAccount({String label}) async => compute(_addAccount, label);
74 +Future<void> addAccount({String label}) async {
75 + await compute(_addAccount, label);
76 + await store();
77 +}
78
75 -Future<void> setLabelForAccount({int accountIndex, String label}) async =>
76 - compute(
77 - _setLabelForAccount, {'accountIndex': accountIndex, 'label': label});
\ No newline at end of file
79 +Future<void> setLabelForAccount({int accountIndex, String label}) async {
80 + await compute(
81 + _setLabelForAccount, {'accountIndex': accountIndex, 'label': label});
82 + await store();
83 +}
\ No newline at end of file
cw_monero/lib/subaddress_list.dart
+13 -8
@@ -5,6 +5,7 @@ import 'package:cw_monero/signatures.dart';
5 import 'package:cw_monero/types.dart';
6 import 'package:cw_monero/monero_api.dart';
7 import 'package:cw_monero/structs/subaddress_row.dart';
8 +import 'package:cw_monero/wallet.dart';
9
10 final subaddressSizeNative = moneroApi
11 .lookup<NativeFunction<subaddrress_size>>('subaddrress_size')
@@ -79,14 +80,18 @@ void _setLabelForSubaddress(Map<String, dynamic> args) {
80 accountIndex: accountIndex, addressIndex: addressIndex, label: label);
81 }
82
82 -Future addSubaddress({int accountIndex, String label}) async =>
83 - compute<Map<String, Object>, void>(
83 +Future addSubaddress({int accountIndex, String label}) async {
84 + await compute<Map<String, Object>, void>(
85 _addSubaddress, {'accountIndex': accountIndex, 'label': label});
86 + await store();
87 +}
88
89 Future setLabelForSubaddress(
87 - {int accountIndex, int addressIndex, String label}) =>
88 - compute<Map<String, Object>, void>(_setLabelForSubaddress, {
89 - 'accountIndex': accountIndex,
90 - 'addressIndex': addressIndex,
91 - 'label': label
92 - });
90 + {int accountIndex, int addressIndex, String label}) async {
91 + await compute<Map<String, Object>, void>(_setLabelForSubaddress, {
92 + 'accountIndex': accountIndex,
93 + 'addressIndex': addressIndex,
94 + 'label': label
95 + });
96 + await store();
97 +}
ios/Runner.xcodeproj/project.pbxproj
+6 -6
@@ -358,7 +358,7 @@
358 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
359 CLANG_ENABLE_MODULES = YES;
360 CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
361 - CURRENT_PROJECT_VERSION = 33;
361 + CURRENT_PROJECT_VERSION = 34;
362 DEVELOPMENT_TEAM = 32J6BB6VUS;
363 ENABLE_BITCODE = NO;
364 FRAMEWORK_SEARCH_PATHS = (
@@ -375,7 +375,7 @@
375 "$(inherited)",
376 "$(PROJECT_DIR)/Flutter",
377 );
378 - MARKETING_VERSION = 4.1.4;
378 + MARKETING_VERSION = 4.1.5;
379 PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet;
380 PRODUCT_NAME = "$(TARGET_NAME)";
381 SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -501,7 +501,7 @@
501 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
502 CLANG_ENABLE_MODULES = YES;
503 CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
504 - CURRENT_PROJECT_VERSION = 33;
504 + CURRENT_PROJECT_VERSION = 34;
505 DEVELOPMENT_TEAM = 32J6BB6VUS;
506 ENABLE_BITCODE = NO;
507 FRAMEWORK_SEARCH_PATHS = (
@@ -518,7 +518,7 @@
518 "$(inherited)",
519 "$(PROJECT_DIR)/Flutter",
520 );
521 - MARKETING_VERSION = 4.1.4;
521 + MARKETING_VERSION = 4.1.5;
522 PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet;
523 PRODUCT_NAME = "$(TARGET_NAME)";
524 SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -536,7 +536,7 @@
536 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
537 CLANG_ENABLE_MODULES = YES;
538 CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
539 - CURRENT_PROJECT_VERSION = 33;
539 + CURRENT_PROJECT_VERSION = 34;
540 DEVELOPMENT_TEAM = 32J6BB6VUS;
541 ENABLE_BITCODE = NO;
542 FRAMEWORK_SEARCH_PATHS = (
@@ -553,7 +553,7 @@
553 "$(inherited)",
554 "$(PROJECT_DIR)/Flutter",
555 );
556 - MARKETING_VERSION = 4.1.4;
556 + MARKETING_VERSION = 4.1.5;
557 PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet;
558 PRODUCT_NAME = "$(TARGET_NAME)";
559 SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
ios/Runner/Info.plist
+5
@@ -24,6 +24,11 @@
24 <string>$(CURRENT_PROJECT_VERSION)</string>
25 <key>LSRequiresIPhoneOS</key>
26 <true/>
27 + <key>NSAppTransportSecurity</key>
28 + <dict>
29 + <key>NSAllowsArbitraryLoads</key>
30 + <true/>
31 + </dict>
32 <key>NSCameraUsageDescription</key>
33 <string>Used for scan QR code</string>
34 <key>NSDocumentsFolderUsageDescription</key>
lib/monero/monero_wallet.dart
-2
@@ -100,10 +100,8 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance> with Store {
100
101 Future<void> init() async {
102 accountList.update();
103 - accountList.accounts.observe((_) async => await save());
103 account = accountList.accounts.first;
104 subaddressList.update(accountIndex: account.id ?? 0);
106 - subaddressList.subaddresses.observe((_) async => await save());
105 subaddress = subaddressList.getAll().first;
106 balance = MoneroBalance(
107 fullBalance: monero_wallet.getFullBalance(accountIndex: account.id),
pubspec.yaml
+1 -1
@@ -11,7 +11,7 @@ description: Cake Wallet.
11 # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
12 # Read more about iOS versioning at
13 # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
14 -version: 4.1.4+43
14 +version: 4.1.5+44
15
16 environment:
17 sdk: ">=2.7.0 <3.0.0"