diff --git a/configure_cake_wallet_android.sh b/configure_cake_wallet_android.sh index da794a35c..dccadc7b7 100755 --- a/configure_cake_wallet_android.sh +++ b/configure_cake_wallet_android.sh @@ -4,11 +4,11 @@ source ./app_env.sh cakewallet cd ../.. && flutter pub get flutter packages pub run tool/generate_localization.dart cd cw_core && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. -cd cw_monero && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. -cd cw_bitcoin && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. -cd cw_haven && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. -cd cw_ethereum && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. -cd cw_nano && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. -cd cw_bitcoin_cash && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. +#cd cw_monero && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. +#cd cw_bitcoin && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. +#cd cw_haven && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. +#cd cw_ethereum && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. +#cd cw_nano && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. +#cd cw_bitcoin_cash && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. cd cw_polygon && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd .. flutter packages pub run build_runner build --delete-conflicting-outputs diff --git a/cw_core/lib/encryption_file_utils.dart b/cw_core/lib/encryption_file_utils.dart index 0852aeda7..1889c4389 100644 --- a/cw_core/lib/encryption_file_utils.dart +++ b/cw_core/lib/encryption_file_utils.dart @@ -1,6 +1,6 @@ import 'dart:io'; import 'dart:typed_data'; -import 'package:cw_core/file.dart' as file; +import 'package:cw_core/utils/file.dart' as file; import 'package:cake_backup/backup.dart' as cwb; EncryptionFileUtils encryptionFileUtilsFor(bool direct) diff --git a/cw_polygon/lib/polygon_transaction_history.dart b/cw_polygon/lib/polygon_transaction_history.dart index a06b8be4a..27dec35e9 100644 --- a/cw_polygon/lib/polygon_transaction_history.dart +++ b/cw_polygon/lib/polygon_transaction_history.dart @@ -1,8 +1,8 @@ import 'dart:convert'; import 'dart:core'; import 'package:cw_core/pathForWallet.dart'; +import 'package:cw_core/utils/file.dart'; import 'package:cw_core/wallet_info.dart'; -import 'package:cw_ethereum/file.dart'; import 'package:cw_polygon/polygon_transaction_info.dart'; import 'package:mobx/mobx.dart'; import 'package:cw_core/transaction_history.dart'; diff --git a/cw_polygon/lib/polygon_wallet.dart b/cw_polygon/lib/polygon_wallet.dart index 66e6797c6..90cb12ff1 100644 --- a/cw_polygon/lib/polygon_wallet.dart +++ b/cw_polygon/lib/polygon_wallet.dart @@ -11,13 +11,13 @@ import 'package:cw_core/pending_transaction.dart'; import 'package:cw_core/sync_status.dart'; import 'package:cw_core/transaction_direction.dart'; import 'package:cw_core/transaction_priority.dart'; +import 'package:cw_core/utils/file.dart'; import 'package:cw_core/wallet_addresses.dart'; import 'package:cw_core/wallet_base.dart'; import 'package:cw_core/wallet_info.dart'; import 'package:cw_ethereum/erc20_balance.dart'; import 'package:cw_ethereum/ethereum_formatter.dart'; import 'package:cw_ethereum/ethereum_transaction_model.dart'; -import 'package:cw_ethereum/file.dart'; import 'package:cw_core/erc20_token.dart'; import 'package:cw_polygon/default_erc20_tokens.dart'; import 'package:cw_polygon/polygon_client.dart'; @@ -532,6 +532,9 @@ abstract class PolygonWalletBase extends WalletBase _password; + @override String signMessage(String message, {String? address = null}) => bytesToHex( _polygonPrivateKey.signPersonalMessageToUint8List(ascii.encode(message))); diff --git a/lib/entities/default_settings_migration.dart b/lib/entities/default_settings_migration.dart index 30411e250..6a4fedbad 100644 --- a/lib/entities/default_settings_migration.dart +++ b/lib/entities/default_settings_migration.dart @@ -1,13 +1,11 @@ import 'dart:io' show Directory, File, Platform; import 'package:cake_wallet/bitcoin/bitcoin.dart'; -import 'package:cake_wallet/entities/encrypt.dart'; import 'package:cake_wallet/entities/exchange_api_mode.dart'; import 'package:cw_core/pathForWallet.dart'; import 'package:cake_wallet/entities/secret_store_key.dart'; import 'package:cake_wallet/core/secure_storage.dart'; import 'package:cw_core/root_dir.dart'; import 'package:hive/hive.dart'; -import 'package:path_provider/path_provider.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:cake_wallet/entities/preferences_key.dart'; import 'package:cw_core/wallet_type.dart'; @@ -381,7 +379,7 @@ Node getMoneroDefaultNode({required Box nodes}) { } } -Future rewriteSecureStoragePin({required FlutterSecureStorage secureStorage}) async { +Future rewriteSecureStoragePin({required SecureStorage secureStorage}) async { // the bug only affects ios/mac: if (!Platform.isIOS && !Platform.isMacOS) { return; @@ -407,8 +405,9 @@ Future rewriteSecureStoragePin({required FlutterSecureStorage secureStorag await secureStorage.write( key: keyForPinCode, value: encodedPin, - iOptions: IOSOptions(accessibility: KeychainAccessibility.first_unlock), - mOptions: MacOsOptions(accessibility: KeychainAccessibility.first_unlock), + // TODO: find a way to add those with the generated secure storage + // iOptions: IOSOptions(accessibility: KeychainAccessibility.first_unlock), + // mOptions: MacOsOptions(accessibility: KeychainAccessibility.first_unlock), ); } @@ -431,7 +430,7 @@ Future changeLitecoinCurrentElectrumServerToDefault( Future changeBitcoinCashCurrentNodeToDefault( {required SharedPreferences sharedPreferences, required Box nodes}) async { final server = getBitcoinCashDefaultElectrumServer(nodes: nodes); - final serverId = server?.key as int ?? 0; + final serverId = server?.key as int? ?? 0; await sharedPreferences.setInt(PreferencesKey.currentBitcoinCashNodeIdKey, serverId); } diff --git a/lib/polygon/cw_polygon.dart b/lib/polygon/cw_polygon.dart index 066b29d43..3e08e5825 100644 --- a/lib/polygon/cw_polygon.dart +++ b/lib/polygon/cw_polygon.dart @@ -4,15 +4,16 @@ class CWPolygon extends Polygon { @override List getPolygonWordList(String language) => EthereumMnemonics.englishWordlist; - WalletService createPolygonWalletService(Box walletInfoSource) => + WalletService createPolygonWalletService(Box walletInfoSource, bool isDirect) => PolygonWalletService(walletInfoSource); @override WalletCredentials createPolygonNewWalletCredentials({ required String name, WalletInfo? walletInfo, + String? password }) => - PolygonNewWalletCredentials(name: name, walletInfo: walletInfo); + PolygonNewWalletCredentials(name: name, walletInfo: walletInfo, password: password); @override WalletCredentials createPolygonRestoreWalletFromSeedCredentials({ diff --git a/scripts/linux/app_config.sh b/scripts/linux/app_config.sh index 6969418bd..63a365cb6 100755 --- a/scripts/linux/app_config.sh +++ b/scripts/linux/app_config.sh @@ -13,7 +13,7 @@ CONFIG_ARGS="" case $APP_LINUX_TYPE in $CAKEWALLET) - CONFIG_ARGS="--monero --bitcoin --ethereum --nano --excludeFlutterSecureStorage";; + CONFIG_ARGS="--monero --bitcoin --ethereum --nano --bitcoinCash --excludeFlutterSecureStorage";; esac cp -rf pubspec_description.yaml pubspec.yaml diff --git a/scripts/linux/app_env.sh b/scripts/linux/app_env.sh index 937ae010f..41a2dc6d0 100755 --- a/scripts/linux/app_env.sh +++ b/scripts/linux/app_env.sh @@ -14,8 +14,8 @@ if [ -n "$1" ]; then fi CAKEWALLET_NAME="Cake Wallet" -CAKEWALLET_VERSION="1.1.5" -CAKEWALLET_BUILD_NUMBER=9 +CAKEWALLET_VERSION="1.2.0" +CAKEWALLET_BUILD_NUMBER=10 if ! [[ " ${TYPES[*]} " =~ " ${APP_LINUX_TYPE} " ]]; then echo "Wrong app type." diff --git a/tool/configure.dart b/tool/configure.dart index 3fa23c2c3..22f54d0a3 100644 --- a/tool/configure.dart +++ b/tool/configure.dart @@ -612,8 +612,8 @@ import 'package:cw_ethereum/ethereum_mnemonics.dart'; const polygonContent = """ abstract class Polygon { List getPolygonWordList(String language); - WalletService createPolygonWalletService(Box walletInfoSource); - WalletCredentials createPolygonNewWalletCredentials({required String name, WalletInfo? walletInfo}); + WalletService createPolygonWalletService(Box walletInfoSource, bool isDirect); + WalletCredentials createPolygonNewWalletCredentials({required String name, WalletInfo? walletInfo, String? password}); WalletCredentials createPolygonRestoreWalletFromSeedCredentials({required String name, required String mnemonic, required String password}); WalletCredentials createPolygonRestoreWalletFromPrivateKey({required String name, required String privateKey, required String password}); String getAddress(WalletBase wallet);