mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 03:59:23 +00:00
Started working on iOS migrations. Addeed migrations for wallets info and address book. Fixed build for iOS
This commit is contained in:
parent
ac0723e918
commit
8e9033fce4
5 changed files with 98 additions and 14 deletions
|
@ -48,4 +48,11 @@ A new flutter plugin project.
|
||||||
sodium.libraries = 'sodium'
|
sodium.libraries = 'sodium'
|
||||||
sodium.xcconfig = { 'HEADER_SEARCH_PATHS' => "${PODS_ROOT}/#{s.name}/External/ios/libs/sodium/include/**" }
|
sodium.xcconfig = { 'HEADER_SEARCH_PATHS' => "${PODS_ROOT}/#{s.name}/External/ios/libs/sodium/include/**" }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
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
|
end
|
|
@ -4,24 +4,33 @@ PODS:
|
||||||
- MTBBarcodeScanner
|
- MTBBarcodeScanner
|
||||||
- cw_monero (0.0.2):
|
- cw_monero (0.0.2):
|
||||||
- cw_monero/Boost (= 0.0.2)
|
- cw_monero/Boost (= 0.0.2)
|
||||||
|
- cw_monero/lmdb (= 0.0.2)
|
||||||
- cw_monero/Monero (= 0.0.2)
|
- cw_monero/Monero (= 0.0.2)
|
||||||
- cw_monero/OpenSSL (= 0.0.2)
|
- cw_monero/OpenSSL (= 0.0.2)
|
||||||
- cw_monero/Sodium (= 0.0.2)
|
- cw_monero/Sodium (= 0.0.2)
|
||||||
- Flutter
|
- Flutter
|
||||||
- cw_monero/Boost (0.0.2):
|
- cw_monero/Boost (0.0.2):
|
||||||
- Flutter
|
- Flutter
|
||||||
|
- cw_monero/lmdb (0.0.2):
|
||||||
|
- Flutter
|
||||||
- cw_monero/Monero (0.0.2):
|
- cw_monero/Monero (0.0.2):
|
||||||
- Flutter
|
- Flutter
|
||||||
- cw_monero/OpenSSL (0.0.2):
|
- cw_monero/OpenSSL (0.0.2):
|
||||||
- Flutter
|
- Flutter
|
||||||
- cw_monero/Sodium (0.0.2):
|
- cw_monero/Sodium (0.0.2):
|
||||||
- Flutter
|
- Flutter
|
||||||
|
- devicelocale (0.0.1):
|
||||||
|
- Flutter
|
||||||
- esys_flutter_share (0.0.1):
|
- esys_flutter_share (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- Flutter (1.0.0)
|
- Flutter (1.0.0)
|
||||||
- flutter_secure_storage (3.3.1):
|
- flutter_secure_storage (3.3.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
|
- local_auth (0.0.1):
|
||||||
|
- Flutter
|
||||||
- MTBBarcodeScanner (5.0.11)
|
- MTBBarcodeScanner (5.0.11)
|
||||||
|
- package_info (0.0.1):
|
||||||
|
- Flutter
|
||||||
- path_provider (0.0.1):
|
- path_provider (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- share (0.5.2):
|
- share (0.5.2):
|
||||||
|
@ -36,9 +45,12 @@ PODS:
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- barcode_scan (from `.symlinks/plugins/barcode_scan/ios`)
|
- barcode_scan (from `.symlinks/plugins/barcode_scan/ios`)
|
||||||
- cw_monero (from `.symlinks/plugins/cw_monero/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`)
|
- 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`)
|
- 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`)
|
- path_provider (from `.symlinks/plugins/path_provider/ios`)
|
||||||
- share (from `.symlinks/plugins/share/ios`)
|
- share (from `.symlinks/plugins/share/ios`)
|
||||||
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
|
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
|
||||||
|
@ -54,12 +66,18 @@ EXTERNAL SOURCES:
|
||||||
:path: ".symlinks/plugins/barcode_scan/ios"
|
:path: ".symlinks/plugins/barcode_scan/ios"
|
||||||
cw_monero:
|
cw_monero:
|
||||||
:path: ".symlinks/plugins/cw_monero/ios"
|
:path: ".symlinks/plugins/cw_monero/ios"
|
||||||
|
devicelocale:
|
||||||
|
:path: ".symlinks/plugins/devicelocale/ios"
|
||||||
esys_flutter_share:
|
esys_flutter_share:
|
||||||
:path: ".symlinks/plugins/esys_flutter_share/ios"
|
:path: ".symlinks/plugins/esys_flutter_share/ios"
|
||||||
Flutter:
|
Flutter:
|
||||||
:path: ".symlinks/flutter/ios-release"
|
:path: ".symlinks/flutter/ios"
|
||||||
flutter_secure_storage:
|
flutter_secure_storage:
|
||||||
:path: ".symlinks/plugins/flutter_secure_storage/ios"
|
: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_provider:
|
||||||
:path: ".symlinks/plugins/path_provider/ios"
|
:path: ".symlinks/plugins/path_provider/ios"
|
||||||
share:
|
share:
|
||||||
|
@ -73,11 +91,14 @@ EXTERNAL SOURCES:
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
barcode_scan: 33f586d02270046fc6559135038b34b5754eaa4f
|
barcode_scan: 33f586d02270046fc6559135038b34b5754eaa4f
|
||||||
cw_monero: ca40a57b99f7753ed93d3b50af671a637277eb89
|
cw_monero: 2e1f79929880cc2293b5bc1b25e28152e4d84649
|
||||||
|
devicelocale: feebbe5e7a30adb8c4f83185de1b50ff19b44f00
|
||||||
esys_flutter_share: 403498dab005b36ce1f8d7aff377e81f0621b0b4
|
esys_flutter_share: 403498dab005b36ce1f8d7aff377e81f0621b0b4
|
||||||
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
|
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
|
||||||
flutter_secure_storage: 7953c38a04c3fdbb00571bcd87d8e3b5ceb9daec
|
flutter_secure_storage: 7953c38a04c3fdbb00571bcd87d8e3b5ceb9daec
|
||||||
|
local_auth: 2571c49920ae469f46d5557435fad8fa473a5e88
|
||||||
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
|
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
|
||||||
|
package_info: 48b108e75b8802c2d5e126f208ef540561c98aef
|
||||||
path_provider: fb74bd0465e96b594bb3b5088ee4a4e7bb1f2a9d
|
path_provider: fb74bd0465e96b594bb3b5088ee4a4e7bb1f2a9d
|
||||||
share: bae0a282aab4483288913fc4dc0b935d4b491f2e
|
share: bae0a282aab4483288913fc4dc0b935d4b491f2e
|
||||||
shared_preferences: 430726339841afefe5142b9c1f50cb6bd7793e01
|
shared_preferences: 430726339841afefe5142b9c1f50cb6bd7793e01
|
||||||
|
|
|
@ -399,7 +399,8 @@
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"$(PROJECT_DIR)/Flutter",
|
"$(PROJECT_DIR)/Flutter",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.cakewallet.cakewallet;
|
MARKETING_VERSION = 3.1.28;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
|
@ -534,7 +535,8 @@
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"$(PROJECT_DIR)/Flutter",
|
"$(PROJECT_DIR)/Flutter",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.cakewallet.cakewallet;
|
MARKETING_VERSION = 3.1.28;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
|
@ -564,7 +566,8 @@
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"$(PROJECT_DIR)/Flutter",
|
"$(PROJECT_DIR)/Flutter",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.cakewallet.cakewallet;
|
MARKETING_VERSION = 3.1.28;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>$(FLUTTER_BUILD_NAME)</string>
|
<string>$(MARKETING_VERSION)</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
|
|
|
@ -1,4 +1,12 @@
|
||||||
import 'dart:io';
|
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';
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
|
||||||
const reservedNames = ["flutter_assets", "wallets", "db"];
|
const reservedNames = ["flutter_assets", "wallets", "db"];
|
||||||
|
@ -12,8 +20,6 @@ Future<void> migrate_android_v1() async {
|
||||||
|
|
||||||
Future<void> migrate_ios_v1() async {
|
Future<void> migrate_ios_v1() async {
|
||||||
final appDocDir = await getApplicationDocumentsDirectory();
|
final appDocDir = await getApplicationDocumentsDirectory();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> migrate_hives({Directory appDocDir}) async {
|
Future<void> migrate_hives({Directory appDocDir}) async {
|
||||||
|
@ -73,7 +79,54 @@ Future<void> migrate_wallets({Directory appDocDir}) async {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> migrate_ios_wallets({Directory appDocDir}) async {
|
Future<void> migrate_ios_wallet_info(
|
||||||
// final oldWalletsDir = Directory('${appDocDir.path}/wallets');
|
{@required Directory appDocDir,
|
||||||
|
@required Box<WalletInfo> 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<String, dynamic>;
|
||||||
|
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<void> migrate_ios_trades_list(
|
||||||
|
{@required Directory appDocDir, @required Box<Trade> trades}) async {
|
||||||
|
final adderessBookJSON = File('${appDocDir.path}/trades_list.json');
|
||||||
|
final List<dynamic> trades =
|
||||||
|
json.decode(adderessBookJSON.readAsStringSync()) as List<dynamic>;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> migrate_ios_address_book(
|
||||||
|
{@required Directory appDocDir, @required Box<Contact> contacts}) async {
|
||||||
|
final adderessBookJSON = File('${appDocDir.path}/address_book.json');
|
||||||
|
final List<dynamic> addresses =
|
||||||
|
json.decode(adderessBookJSON.readAsStringSync()) as List<dynamic>;
|
||||||
|
|
||||||
|
addresses.forEach((dynamic item) async {
|
||||||
|
final _item = item as Map<String, dynamic>;
|
||||||
|
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);
|
||||||
|
});
|
||||||
}
|
}
|
Loading…
Reference in a new issue