diff --git a/cw_monero/ios/cw_monero.podspec b/cw_monero/ios/cw_monero.podspec index 1fd4a89c2..a48f9e09b 100644 --- a/cw_monero/ios/cw_monero.podspec +++ b/cw_monero/ios/cw_monero.podspec @@ -48,4 +48,11 @@ A new flutter plugin project. sodium.libraries = 'sodium' sodium.xcconfig = { 'HEADER_SEARCH_PATHS' => "${PODS_ROOT}/#{s.name}/External/ios/libs/sodium/include/**" } end -end \ No newline at end of file + + s.subspec 'lmdb' do |sodium| +# sodium.preserve_paths = 'External/ios/libs/sodium/include/**/*.h' + sodium.vendored_libraries = 'External/ios/libs/lmdb/liblmdb.a' + sodium.libraries = 'lmdb' +# sodium.xcconfig = { 'HEADER_SEARCH_PATHS' => "${PODS_ROOT}/#{s.name}/External/ios/libs/sodium/include/**" } + end +end diff --git a/ios/Podfile.lock b/ios/Podfile.lock index e7f54fa8f..e1c1978b8 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -4,24 +4,33 @@ PODS: - MTBBarcodeScanner - cw_monero (0.0.2): - cw_monero/Boost (= 0.0.2) + - cw_monero/lmdb (= 0.0.2) - cw_monero/Monero (= 0.0.2) - cw_monero/OpenSSL (= 0.0.2) - cw_monero/Sodium (= 0.0.2) - Flutter - cw_monero/Boost (0.0.2): - Flutter + - cw_monero/lmdb (0.0.2): + - Flutter - cw_monero/Monero (0.0.2): - Flutter - cw_monero/OpenSSL (0.0.2): - Flutter - cw_monero/Sodium (0.0.2): - Flutter + - devicelocale (0.0.1): + - Flutter - esys_flutter_share (0.0.1): - Flutter - Flutter (1.0.0) - flutter_secure_storage (3.3.1): - Flutter + - local_auth (0.0.1): + - Flutter - MTBBarcodeScanner (5.0.11) + - package_info (0.0.1): + - Flutter - path_provider (0.0.1): - Flutter - share (0.5.2): @@ -36,9 +45,12 @@ PODS: DEPENDENCIES: - barcode_scan (from `.symlinks/plugins/barcode_scan/ios`) - cw_monero (from `.symlinks/plugins/cw_monero/ios`) + - devicelocale (from `.symlinks/plugins/devicelocale/ios`) - esys_flutter_share (from `.symlinks/plugins/esys_flutter_share/ios`) - - Flutter (from `.symlinks/flutter/ios-release`) + - Flutter (from `.symlinks/flutter/ios`) - flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`) + - local_auth (from `.symlinks/plugins/local_auth/ios`) + - package_info (from `.symlinks/plugins/package_info/ios`) - path_provider (from `.symlinks/plugins/path_provider/ios`) - share (from `.symlinks/plugins/share/ios`) - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) @@ -54,12 +66,18 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/barcode_scan/ios" cw_monero: :path: ".symlinks/plugins/cw_monero/ios" + devicelocale: + :path: ".symlinks/plugins/devicelocale/ios" esys_flutter_share: :path: ".symlinks/plugins/esys_flutter_share/ios" Flutter: - :path: ".symlinks/flutter/ios-release" + :path: ".symlinks/flutter/ios" flutter_secure_storage: :path: ".symlinks/plugins/flutter_secure_storage/ios" + local_auth: + :path: ".symlinks/plugins/local_auth/ios" + package_info: + :path: ".symlinks/plugins/package_info/ios" path_provider: :path: ".symlinks/plugins/path_provider/ios" share: @@ -73,11 +91,14 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: barcode_scan: 33f586d02270046fc6559135038b34b5754eaa4f - cw_monero: ca40a57b99f7753ed93d3b50af671a637277eb89 + cw_monero: 2e1f79929880cc2293b5bc1b25e28152e4d84649 + devicelocale: feebbe5e7a30adb8c4f83185de1b50ff19b44f00 esys_flutter_share: 403498dab005b36ce1f8d7aff377e81f0621b0b4 Flutter: 0e3d915762c693b495b44d77113d4970485de6ec flutter_secure_storage: 7953c38a04c3fdbb00571bcd87d8e3b5ceb9daec + local_auth: 2571c49920ae469f46d5557435fad8fa473a5e88 MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb + package_info: 48b108e75b8802c2d5e126f208ef540561c98aef path_provider: fb74bd0465e96b594bb3b5088ee4a4e7bb1f2a9d share: bae0a282aab4483288913fc4dc0b935d4b491f2e shared_preferences: 430726339841afefe5142b9c1f50cb6bd7793e01 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index ef5c8ce46..53b0fb3ed 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -399,7 +399,8 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.cakewallet.cakewallet; + MARKETING_VERSION = 3.1.28; + PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -534,7 +535,8 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.cakewallet.cakewallet; + MARKETING_VERSION = 3.1.28; + PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -564,7 +566,8 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.cakewallet.cakewallet; + MARKETING_VERSION = 3.1.28; + PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 31d748e9a..40f292e53 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) + $(MARKETING_VERSION) CFBundleSignature ???? CFBundleVersion diff --git a/lib/src/domain/common/fs_migration.dart b/lib/src/domain/common/fs_migration.dart index d79d07dfe..db17cd134 100644 --- a/lib/src/domain/common/fs_migration.dart +++ b/lib/src/domain/common/fs_migration.dart @@ -1,4 +1,12 @@ import 'dart:io'; +import 'dart:convert'; +import 'package:cake_wallet/src/domain/common/contact.dart'; +import 'package:cake_wallet/src/domain/common/crypto_currency.dart'; +import 'package:cake_wallet/src/domain/common/wallet_info.dart'; +import 'package:cake_wallet/src/domain/common/wallet_type.dart'; +import 'package:cake_wallet/src/domain/exchange/trade.dart'; +import 'package:flutter/foundation.dart'; +import 'package:hive/hive.dart'; import 'package:path_provider/path_provider.dart'; const reservedNames = ["flutter_assets", "wallets", "db"]; @@ -12,8 +20,6 @@ Future migrate_android_v1() async { Future migrate_ios_v1() async { final appDocDir = await getApplicationDocumentsDirectory(); - - } Future migrate_hives({Directory appDocDir}) async { @@ -73,7 +79,54 @@ Future migrate_wallets({Directory appDocDir}) async { }); } -Future migrate_ios_wallets({Directory appDocDir}) async { - // final oldWalletsDir = Directory('${appDocDir.path}/wallets'); - -} \ No newline at end of file +Future migrate_ios_wallet_info( + {@required Directory appDocDir, + @required Box walletsInfo}) async { + final walletsDir = Directory('${appDocDir.path}/wallets'); + final moneroWalletsDir = Directory('${walletsDir.path}/monero'); + + moneroWalletsDir.listSync().forEach((item) async { + try { + if (item is Directory) { + final name = item.path.split('/').last; + final configFile = File('${item.path}/$name.json'); + final config = + json.decode(configFile.readAsStringSync()) as Map; + final isRecovery = config["isRecovery"] as bool ?? false; + final id = + walletTypeToString(WalletType.monero).toLowerCase() + '_' + name; + final walletInfo = + WalletInfo(id: id, name: name, isRecovery: isRecovery); + + await walletsInfo.add(walletInfo); + } + } catch (e) { + print(e.toString()); + } + }); +} + +Future migrate_ios_trades_list( + {@required Directory appDocDir, @required Box trades}) async { + final adderessBookJSON = File('${appDocDir.path}/trades_list.json'); + final List trades = + json.decode(adderessBookJSON.readAsStringSync()) as List; +} + +Future migrate_ios_address_book( + {@required Directory appDocDir, @required Box contacts}) async { + final adderessBookJSON = File('${appDocDir.path}/address_book.json'); + final List addresses = + json.decode(adderessBookJSON.readAsStringSync()) as List; + + addresses.forEach((dynamic item) async { + final _item = item as Map; + final type = _item["type"] as String; + final address = _item["address"] as String; + final name = _item["name"] as String; + final contact = Contact( + address: address, name: name, type: CryptoCurrency.fromString(type)); + + await contacts.add(contact); + }); +}