diff --git a/lib/entities/default_settings_migration.dart b/lib/entities/default_settings_migration.dart index 25140f106..90e32d982 100644 --- a/lib/entities/default_settings_migration.dart +++ b/lib/entities/default_settings_migration.dart @@ -70,8 +70,13 @@ Future defaultSettingsMigration( await sharedPreferences.setBool(PreferencesKey.isNewInstall, isNewInstall); - final currentVersion = + int currentVersion = sharedPreferences.getInt(PreferencesKey.currentDefaultSettingsMigrationVersion) ?? 0; + // TODO: remove after v4.22.1 is live + /// for beta testers who didn't correctly get the 46 step configured + if (currentVersion == 46) { + currentVersion--; + } if (currentVersion >= version) { return; @@ -334,20 +339,20 @@ Future defaultSettingsMigration( ); break; case 46: - _fixNodesUseSSLFlag(nodes); - updateWalletTypeNodesWithNewNode( + await _fixNodesUseSSLFlag(nodes); + await updateWalletTypeNodesWithNewNode( newNodeUri: 'litecoin.stackwallet.com:20063', nodes: nodes, type: WalletType.litecoin, useSSL: true, ); - updateWalletTypeNodesWithNewNode( + await updateWalletTypeNodesWithNewNode( newNodeUri: 'electrum-ltc.bysh.me:50002', nodes: nodes, type: WalletType.litecoin, useSSL: true, ); - _changeDefaultNode( + await _changeDefaultNode( nodes: nodes, sharedPreferences: sharedPreferences, type: WalletType.solana, @@ -360,13 +365,13 @@ Future defaultSettingsMigration( 'solana-rpc.publicnode.com:443', ], ); - _updateNode( + await _updateNode( nodes: nodes, currentUri: "ethereum.publicnode.com", newUri: "ethereum-rpc.publicnode.com", useSSL: true, ); - _updateNode( + await _updateNode( nodes: nodes, currentUri: "polygon-bor.publicnode.com", newUri: "polygon-bor-rpc.publicnode.com", @@ -387,13 +392,16 @@ Future defaultSettingsMigration( await sharedPreferences.setInt(PreferencesKey.currentDefaultSettingsMigrationVersion, version); } -void _updateNode({ +Future _updateNode({ required Box nodes, required String currentUri, String? newUri, bool? useSSL, -}) { +}) async { for (Node node in nodes.values) { + print("@@@@@@@@@@@@@"); + print(node.uriRaw); + print(node.uri); if (node.uriRaw == currentUri) { if (newUri != null) { node.uriRaw = newUri; @@ -401,6 +409,7 @@ void _updateNode({ if (useSSL != null) { node.useSSL = useSSL; } + await node.save(); } } } @@ -481,7 +490,7 @@ void _deselectExchangeProvider(SharedPreferences sharedPreferences, String provi ); } -void _fixNodesUseSSLFlag(Box nodes) { +Future _fixNodesUseSSLFlag(Box nodes) async { for (Node node in nodes.values) { switch (node.uriRaw) { case cakeWalletLitecoinElectrumUri: @@ -490,6 +499,7 @@ void _fixNodesUseSSLFlag(Box nodes) { case newCakeWalletMoneroUri: node.useSSL = true; node.trusted = true; + await node.save(); } } } diff --git a/scripts/android/app_env.sh b/scripts/android/app_env.sh index 6b1907451..45e28379d 100644 --- a/scripts/android/app_env.sh +++ b/scripts/android/app_env.sh @@ -23,7 +23,7 @@ MONERO_COM_SCHEME="monero.com" CAKEWALLET_NAME="Cake Wallet" CAKEWALLET_VERSION="4.22.1" -CAKEWALLET_BUILD_NUMBER=241 +CAKEWALLET_BUILD_NUMBER=242 CAKEWALLET_BUNDLE_ID="com.cakewallet.cake_wallet" CAKEWALLET_PACKAGE="com.cakewallet.cake_wallet" CAKEWALLET_SCHEME="cakewallet" diff --git a/scripts/ios/app_env.sh b/scripts/ios/app_env.sh index c1747c502..079b12391 100644 --- a/scripts/ios/app_env.sh +++ b/scripts/ios/app_env.sh @@ -19,7 +19,7 @@ MONERO_COM_BUNDLE_ID="com.cakewallet.monero" CAKEWALLET_NAME="Cake Wallet" CAKEWALLET_VERSION="4.22.1" -CAKEWALLET_BUILD_NUMBER=288 +CAKEWALLET_BUILD_NUMBER=289 CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet" HAVEN_NAME="Haven" diff --git a/scripts/linux/app_env.sh b/scripts/linux/app_env.sh index f0ec8e9e6..5103eeccc 100755 --- a/scripts/linux/app_env.sh +++ b/scripts/linux/app_env.sh @@ -15,7 +15,7 @@ fi CAKEWALLET_NAME="Cake Wallet" CAKEWALLET_VERSION="1.12.1" -CAKEWALLET_BUILD_NUMBER=42 +CAKEWALLET_BUILD_NUMBER=43 if ! [[ " ${TYPES[*]} " =~ " ${APP_LINUX_TYPE} " ]]; then echo "Wrong app type." diff --git a/scripts/macos/app_env.sh b/scripts/macos/app_env.sh index fe3d806d8..af2b6ab1e 100755 --- a/scripts/macos/app_env.sh +++ b/scripts/macos/app_env.sh @@ -22,7 +22,7 @@ MONERO_COM_BUNDLE_ID="com.cakewallet.monero" CAKEWALLET_NAME="Cake Wallet" CAKEWALLET_VERSION="1.15.1" -CAKEWALLET_BUILD_NUMBER=100 +CAKEWALLET_BUILD_NUMBER=101 CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet" if ! [[ " ${TYPES[*]} " =~ " ${APP_MACOS_TYPE} " ]]; then