From b6a9ce58dbd1718ad168ef5993fccaf65201f34b Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Wed, 24 Apr 2024 21:37:22 +0200 Subject: [PATCH 01/42] monero.dart clean --- .fvmrc | 3 +++ .gitignore | 3 +++ .vscode/settings.json | 1 + android/app/build.gradle | 7 ++++++- android/app/src/main/AndroidManifest.xml | 3 ++- .../arm64-v8a/libmonero_libwallet2_api_c.so | 1 + .../armeabi-v7a/libmonero_libwallet2_api_c.so | 1 + .../x86_64/libmonero_libwallet2_api_c.so | 1 + lib/wallets/crypto_currency/coins/monero.dart | 3 ++- .../crypto_currency/coins/wownero.dart | 2 +- lib/wallets/wallet/impl/wownero_wallet.dart | 6 ++++-- macos/Flutter/GeneratedPluginRegistrant.swift | 6 ------ macos/Podfile.lock | 4 ++-- macos/Runner.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- pubspec.lock | 20 ++++++++++--------- pubspec.yaml | 2 +- scripts/macos/build_all.sh | 6 +++--- 18 files changed, 44 insertions(+), 29 deletions(-) create mode 100644 .fvmrc create mode 120000 android/app/src/main/jniLibs/arm64-v8a/libmonero_libwallet2_api_c.so create mode 120000 android/app/src/main/jniLibs/armeabi-v7a/libmonero_libwallet2_api_c.so create mode 120000 android/app/src/main/jniLibs/x86_64/libmonero_libwallet2_api_c.so diff --git a/.fvmrc b/.fvmrc new file mode 100644 index 000000000..5fb0c142c --- /dev/null +++ b/.fvmrc @@ -0,0 +1,3 @@ +{ + "flutter": "3.16.0" +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index ec9131840..144745e55 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,6 @@ libtor_ffi.dll flutter_libsparkmobile.dll secp256k1.dll /libisar.so + +# FVM Version Cache +.fvm/ \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index eba0d6cd7..a86b03d61 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { "dart.lineLength": 80, + "dart.flutterSdkPath": ".fvm/versions/3.16.0" } \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index ec8747bff..cd56f57ff 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -45,7 +45,12 @@ android { lintOptions { disable 'InvalidPackage' } - + packagingOptions { + pickFirst 'lib/x86/libc++_shared.so' + pickFirst 'lib/x86_64/libc++_shared.so' + pickFirst 'lib/armeabi-v7a/libc++_shared.so' + pickFirst 'lib/arm64-v8a/libc++_shared.so' + } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.cypherstack.stackwallet" diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 3f1a56aa8..786db2728 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -23,7 +23,8 @@ android:requestLegacyExternalStorage="true" android:icon="@mipmap/ic_launcher" android:allowBackup="false" - android:fullBackupContent="false"> + android:fullBackupContent="false" + android:extractNativeLibs="true"> Date: Fri, 26 Apr 2024 00:44:11 +0200 Subject: [PATCH 02/42] fix build issues --- linux/CMakeLists.txt | 4 ++-- scripts/android/build_all.sh | 6 +++--- scripts/linux/build_all.sh | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index 53391e7ad..8fed408de 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -134,10 +134,10 @@ install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR} install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) -install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libmonero/scripts/linux/build/libcw_monero.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libmonero/scripts/monero_c/release/monero/x86_64-linux-gnu_libwallet2_api_c.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" RENAME "monero_libwallet2_api_c.so" COMPONENT Runtime) -install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libmonero/scripts/linux/build/libcw_wownero.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libmonero/scripts/monero_c/release/wownero/x86_64-linux-gnu_libwallet2_api_c.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" RENAME "wownero_libwallet2_api_c.so" COMPONENT Runtime) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libepiccash/scripts/linux/build/rust/target/x86_64-unknown-linux-gnu/release/libepic_cash_wallet.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" diff --git a/scripts/android/build_all.sh b/scripts/android/build_all.sh index 3f499e3f9..13438cf7d 100755 --- a/scripts/android/build_all.sh +++ b/scripts/android/build_all.sh @@ -10,9 +10,9 @@ mkdir -p build . ./config.sh ./install_ndk.sh -(cd ../../crypto_plugins/flutter_liblelantus/scripts/android && ./build_all.sh ) & -(cd ../../crypto_plugins/flutter_libepiccash/scripts/android && ./install_ndk.sh && ./build_opensll.sh && ./build_all.sh ) & -(cd ../../crypto_plugins/flutter_libmonero/scripts/android/ && ./build_all.sh ) & +(cd ../../crypto_plugins/flutter_liblelantus/scripts/android && ./build_all.sh ) +(cd ../../crypto_plugins/flutter_libepiccash/scripts/android && ./install_ndk.sh && ./build_openssl.sh && ./build_all.sh ) +(cd ../../crypto_plugins/flutter_libmonero/scripts/android/ && ./build_all.sh ) wait echo "Done building" diff --git a/scripts/linux/build_all.sh b/scripts/linux/build_all.sh index 672668c13..408a2c6b4 100755 --- a/scripts/linux/build_all.sh +++ b/scripts/linux/build_all.sh @@ -11,10 +11,10 @@ set_rust_to_1671 # flutter-elinux pub get # flutter-elinux build linux --dart-define="IS_ARM=true" mkdir -p build -./build_secure_storage_deps.sh & -(cd ../../crypto_plugins/flutter_liblelantus/scripts/linux && ./build_all.sh ) & -(cd ../../crypto_plugins/flutter_libepiccash/scripts/linux && ./build_all.sh ) & -(cd ../../crypto_plugins/flutter_libmonero/scripts/linux && ./build_monero_all.sh && ./build_sharedfile.sh ) & +./build_secure_storage_deps.sh +(cd ../../crypto_plugins/flutter_liblelantus/scripts/linux && ./build_all.sh ) +(cd ../../crypto_plugins/flutter_libepiccash/scripts/linux && ./build_all.sh ) +(cd ../../crypto_plugins/flutter_libmonero/scripts/linux && ./build_all.sh ) wait echo "Done building" From fb0b87942a8c3da4a3ad8ea168237f6920814761 Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Fri, 26 Apr 2024 14:21:21 +0200 Subject: [PATCH 03/42] wownero support --- .../add_wallet_views/add_wallet_view/add_wallet_view.dart | 2 +- .../settings/settings_menu/nodes_settings.dart | 2 +- pubspec.lock | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart b/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart index 32e1b618c..54b94efb3 100644 --- a/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart +++ b/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart @@ -131,7 +131,7 @@ class _AddWalletViewState extends ConsumerState { _coins.remove(Coin.monero); _coins.remove(Coin.wownero); } else if (Platform.isLinux) { - _coins.remove(Coin.wownero); + // _coins.remove(Coin.wownero); } coinEntities.addAll(_coins.map((e) => CoinEntity(e))); diff --git a/lib/pages_desktop_specific/settings/settings_menu/nodes_settings.dart b/lib/pages_desktop_specific/settings/settings_menu/nodes_settings.dart index eec6e1a5f..1edeac7a6 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/nodes_settings.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/nodes_settings.dart @@ -69,7 +69,7 @@ class _NodesSettings extends ConsumerState { _coins.remove(Coin.monero); _coins.remove(Coin.wownero); } else if (Platform.isLinux) { - _coins.remove(Coin.wownero); + // _coins.remove(Coin.wownero); } searchNodeController = TextEditingController(); diff --git a/pubspec.lock b/pubspec.lock index 111adbb54..428c81a90 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1144,8 +1144,8 @@ packages: dependency: transitive description: path: "." - ref: "342bad5d91d8476f0e32a57ae944f2cfe34d4241" - resolved-ref: "342bad5d91d8476f0e32a57ae944f2cfe34d4241" + ref: "2e1d13765c1403a933c77972511a661f26d4af2e" + resolved-ref: "2e1d13765c1403a933c77972511a661f26d4af2e" url: "https://git.mrcyjanek.net/mrcyjanek/monero.dart" source: git version: "0.0.0" From dc699c6551c6e647c593227460042398fcafdfe8 Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Fri, 26 Apr 2024 17:51:51 +0200 Subject: [PATCH 04/42] additionalInfo backwards compat --- lib/wallets/wallet/impl/monero_wallet.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/wallets/wallet/impl/monero_wallet.dart b/lib/wallets/wallet/impl/monero_wallet.dart index e0d70db36..5f681c774 100644 --- a/lib/wallets/wallet/impl/monero_wallet.dart +++ b/lib/wallets/wallet/impl/monero_wallet.dart @@ -218,8 +218,8 @@ class MoneroWallet extends CryptonoteWallet with CwBasedInterface { final addressString = (CwBasedInterface.cwWalletBase as MoneroWalletBase?) ?.getTransactionAddress( - addressInfo!['accountIndex'] as int, - addressInfo['addressIndex'] as int, + addressInfo?['accountIndex'] as int? ?? 0, + addressInfo?['addressIndex'] as int? ?? 0, ); if (addressString != null) { From 01b5bc479d2988e9283a2db171041a016da88034 Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Sat, 27 Apr 2024 18:16:31 +0200 Subject: [PATCH 05/42] macos support --- macos/Podfile.lock | 54 -------------------------- macos/Runner.xcodeproj/project.pbxproj | 18 +++++++++ macos/monero_libwallet2_api_c.dylib | 1 + macos/wownero_libwallet2_api_c.dylib | 1 + pubspec.lock | 4 +- 5 files changed, 22 insertions(+), 56 deletions(-) create mode 120000 macos/monero_libwallet2_api_c.dylib create mode 120000 macos/wownero_libwallet2_api_c.dylib diff --git a/macos/Podfile.lock b/macos/Podfile.lock index 3c7eac5bb..87053ba83 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -5,48 +5,6 @@ PODS: - connectivity_plus (0.0.1): - FlutterMacOS - ReachabilitySwift - - cw_monero (0.0.1): - - cw_monero/Boost (= 0.0.1) - - cw_monero/Monero (= 0.0.1) - - cw_monero/OpenSSL (= 0.0.1) - - cw_monero/Sodium (= 0.0.1) - - cw_monero/Unbound (= 0.0.1) - - FlutterMacOS - - cw_monero/Boost (0.0.1): - - FlutterMacOS - - cw_monero/Monero (0.0.1): - - FlutterMacOS - - cw_monero/OpenSSL (0.0.1): - - FlutterMacOS - - cw_monero/Sodium (0.0.1): - - FlutterMacOS - - cw_monero/Unbound (0.0.1): - - FlutterMacOS - - cw_shared_external (0.0.1): - - cw_shared_external/Boost (= 0.0.1) - - cw_shared_external/OpenSSL (= 0.0.1) - - FlutterMacOS - - cw_shared_external/Boost (0.0.1): - - FlutterMacOS - - cw_shared_external/OpenSSL (0.0.1): - - FlutterMacOS - - cw_wownero (0.0.1): - - cw_wownero/Boost (= 0.0.1) - - cw_wownero/OpenSSL (= 0.0.1) - - cw_wownero/Sodium (= 0.0.1) - - cw_wownero/Unbound (= 0.0.1) - - cw_wownero/Wownero (= 0.0.1) - - FlutterMacOS - - cw_wownero/Boost (0.0.1): - - FlutterMacOS - - cw_wownero/OpenSSL (0.0.1): - - FlutterMacOS - - cw_wownero/Sodium (0.0.1): - - FlutterMacOS - - cw_wownero/Unbound (0.0.1): - - FlutterMacOS - - cw_wownero/Wownero (0.0.1): - - FlutterMacOS - desktop_drop (0.0.1): - FlutterMacOS - device_info_plus (0.0.1): @@ -87,9 +45,6 @@ PODS: DEPENDENCIES: - coinlib_flutter (from `Flutter/ephemeral/.symlinks/plugins/coinlib_flutter/darwin`) - connectivity_plus (from `Flutter/ephemeral/.symlinks/plugins/connectivity_plus/macos`) - - cw_monero (from `Flutter/ephemeral/.symlinks/plugins/cw_monero/macos`) - - cw_shared_external (from `Flutter/ephemeral/.symlinks/plugins/cw_shared_external/macos`) - - cw_wownero (from `Flutter/ephemeral/.symlinks/plugins/cw_wownero/macos`) - desktop_drop (from `Flutter/ephemeral/.symlinks/plugins/desktop_drop/macos`) - device_info_plus (from `Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos`) - devicelocale (from `Flutter/ephemeral/.symlinks/plugins/devicelocale/macos`) @@ -118,12 +73,6 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/coinlib_flutter/darwin connectivity_plus: :path: Flutter/ephemeral/.symlinks/plugins/connectivity_plus/macos - cw_monero: - :path: Flutter/ephemeral/.symlinks/plugins/cw_monero/macos - cw_shared_external: - :path: Flutter/ephemeral/.symlinks/plugins/cw_shared_external/macos - cw_wownero: - :path: Flutter/ephemeral/.symlinks/plugins/cw_wownero/macos desktop_drop: :path: Flutter/ephemeral/.symlinks/plugins/desktop_drop/macos device_info_plus: @@ -164,9 +113,6 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: coinlib_flutter: 6abec900d67762a6e7ccfd567a3cd3ae00bbee35 connectivity_plus: 18d3c32514c886e046de60e9c13895109866c747 - cw_monero: 7acce7238d217e3993ecac6ec2dec07be728769a - cw_shared_external: c6adfd29c9be4d64f84e1fa9c541ccbcbdb6b457 - cw_wownero: bcd7f2ad6c0a3e8e2a51756fb14f0579b6f8b4ff desktop_drop: 69eeff437544aa619c8db7f4481b3a65f7696898 device_info_plus: 5401765fde0b8d062a2f8eb65510fb17e77cf07f devicelocale: 9f0f36ac651cabae2c33f32dcff4f32b61c38225 diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index c7d39b845..ea15e0c92 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -31,6 +31,8 @@ B98151822A67402A009D013C /* mobileliblelantus.framework in Bundle Framework */ = {isa = PBXBuildFile; fileRef = B98151802A674022009D013C /* mobileliblelantus.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; B98151842A674143009D013C /* libsqlite3.0.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = B98151832A674143009D013C /* libsqlite3.0.tbd */; }; BFD0376C00E1FFD46376BB9D /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9206484E84CB0AD93E3E68CA /* Pods_RunnerTests.framework */; }; + CEA2021D2BDD4D7100FE1D27 /* wownero_libwallet2_api_c.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = CEA2021C2BDD4D7100FE1D27 /* wownero_libwallet2_api_c.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + CEA202202BDD4F0B00FE1D27 /* monero_libwallet2_api_c.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = CEA2021F2BDD4F0B00FE1D27 /* monero_libwallet2_api_c.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; F653CA022D33E8B60E11A9F3 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E6036BF01BF05EA773C76D22 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ @@ -63,6 +65,17 @@ name = "Bundle Framework"; runOnlyForDeploymentPostprocessing = 0; }; + CEA202192BDD4C3500FE1D27 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 12; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + CEA202202BDD4F0B00FE1D27 /* monero_libwallet2_api_c.dylib in CopyFiles */, + CEA2021D2BDD4D7100FE1D27 /* wownero_libwallet2_api_c.dylib in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ @@ -93,6 +106,8 @@ B98151802A674022009D013C /* mobileliblelantus.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = mobileliblelantus.framework; path = ../crypto_plugins/flutter_liblelantus/scripts/macos/mobileliblelantus/mobileliblelantus.framework; sourceTree = ""; }; B98151832A674143009D013C /* libsqlite3.0.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.0.tbd; path = usr/lib/libsqlite3.0.tbd; sourceTree = SDKROOT; }; BF5E76865ACB46314AC27D8F /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; + CEA2021C2BDD4D7100FE1D27 /* wownero_libwallet2_api_c.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = wownero_libwallet2_api_c.dylib; sourceTree = ""; }; + CEA2021F2BDD4F0B00FE1D27 /* monero_libwallet2_api_c.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = monero_libwallet2_api_c.dylib; sourceTree = ""; }; E6036BF01BF05EA773C76D22 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -140,6 +155,8 @@ 33CC10E42044A3C60003C045 = { isa = PBXGroup; children = ( + CEA2021F2BDD4F0B00FE1D27 /* monero_libwallet2_api_c.dylib */, + CEA2021C2BDD4D7100FE1D27 /* wownero_libwallet2_api_c.dylib */, 33FAB671232836740065AC1E /* Runner */, 33CEB47122A05771004F2AC0 /* Flutter */, 331C80D6294CF71000263BE5 /* RunnerTests */, @@ -250,6 +267,7 @@ 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, 529691D83C3BADE14E2EAC03 /* [CP] Embed Pods Frameworks */, + CEA202192BDD4C3500FE1D27 /* CopyFiles */, ); buildRules = ( ); diff --git a/macos/monero_libwallet2_api_c.dylib b/macos/monero_libwallet2_api_c.dylib new file mode 120000 index 000000000..da01b591e --- /dev/null +++ b/macos/monero_libwallet2_api_c.dylib @@ -0,0 +1 @@ +../crypto_plugins/flutter_libmonero/scripts/monero_c/release/monero/host-apple-darwin_libwallet2_api_c.dylib \ No newline at end of file diff --git a/macos/wownero_libwallet2_api_c.dylib b/macos/wownero_libwallet2_api_c.dylib new file mode 120000 index 000000000..f0a776dc1 --- /dev/null +++ b/macos/wownero_libwallet2_api_c.dylib @@ -0,0 +1 @@ +../crypto_plugins/flutter_libmonero/scripts/monero_c/release/wownero/host-apple-darwin_libwallet2_api_c.dylib \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index 428c81a90..7d2bdde86 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1144,8 +1144,8 @@ packages: dependency: transitive description: path: "." - ref: "2e1d13765c1403a933c77972511a661f26d4af2e" - resolved-ref: "2e1d13765c1403a933c77972511a661f26d4af2e" + ref: "7ba955fd9d975c7228ee43a744294399b48f9993" + resolved-ref: "7ba955fd9d975c7228ee43a744294399b48f9993" url: "https://git.mrcyjanek.net/mrcyjanek/monero.dart" source: git version: "0.0.0" From c78fba7b364bc69ecedc6c71405506f9c02fcc6b Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Wed, 24 Apr 2024 21:37:22 +0200 Subject: [PATCH 06/42] monero.dart clean --- .fvmrc | 3 +++ .gitignore | 3 +++ .vscode/settings.json | 1 + android/app/build.gradle | 7 ++++++- android/app/src/main/AndroidManifest.xml | 3 ++- .../arm64-v8a/libmonero_libwallet2_api_c.so | 1 + .../armeabi-v7a/libmonero_libwallet2_api_c.so | 1 + .../jniLibs/x86_64/libmonero_libwallet2_api_c.so | 1 + crypto_plugins/flutter_libmonero | 2 +- lib/wallets/crypto_currency/coins/monero.dart | 3 ++- lib/wallets/crypto_currency/coins/wownero.dart | 2 +- lib/wallets/wallet/impl/wownero_wallet.dart | 6 ++++-- macos/Flutter/GeneratedPluginRegistrant.swift | 6 ------ pubspec.lock | 16 +++++++++------- scripts/macos/build_all.sh | 10 +++++----- 15 files changed, 40 insertions(+), 25 deletions(-) create mode 100644 .fvmrc create mode 120000 android/app/src/main/jniLibs/arm64-v8a/libmonero_libwallet2_api_c.so create mode 120000 android/app/src/main/jniLibs/armeabi-v7a/libmonero_libwallet2_api_c.so create mode 120000 android/app/src/main/jniLibs/x86_64/libmonero_libwallet2_api_c.so diff --git a/.fvmrc b/.fvmrc new file mode 100644 index 000000000..5fb0c142c --- /dev/null +++ b/.fvmrc @@ -0,0 +1,3 @@ +{ + "flutter": "3.16.0" +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index ec9131840..144745e55 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,6 @@ libtor_ffi.dll flutter_libsparkmobile.dll secp256k1.dll /libisar.so + +# FVM Version Cache +.fvm/ \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index eba0d6cd7..a86b03d61 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { "dart.lineLength": 80, + "dart.flutterSdkPath": ".fvm/versions/3.16.0" } \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index ae9570217..5272e9456 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -45,7 +45,12 @@ android { lintOptions { disable 'InvalidPackage' } - + packagingOptions { + pickFirst 'lib/x86/libc++_shared.so' + pickFirst 'lib/x86_64/libc++_shared.so' + pickFirst 'lib/armeabi-v7a/libc++_shared.so' + pickFirst 'lib/arm64-v8a/libc++_shared.so' + } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.cypherstack.stackwallet" diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 3f1a56aa8..786db2728 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -23,7 +23,8 @@ android:requestLegacyExternalStorage="true" android:icon="@mipmap/ic_launcher" android:allowBackup="false" - android:fullBackupContent="false"> + android:fullBackupContent="false" + android:extractNativeLibs="true"> Date: Fri, 26 Apr 2024 00:44:11 +0200 Subject: [PATCH 07/42] fix build issues --- linux/CMakeLists.txt | 4 ++-- scripts/android/build_all.sh | 2 +- scripts/linux/build_all.sh | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index 53391e7ad..8fed408de 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -134,10 +134,10 @@ install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR} install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) -install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libmonero/scripts/linux/build/libcw_monero.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libmonero/scripts/monero_c/release/monero/x86_64-linux-gnu_libwallet2_api_c.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" RENAME "monero_libwallet2_api_c.so" COMPONENT Runtime) -install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libmonero/scripts/linux/build/libcw_wownero.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libmonero/scripts/monero_c/release/wownero/x86_64-linux-gnu_libwallet2_api_c.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" RENAME "wownero_libwallet2_api_c.so" COMPONENT Runtime) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libepiccash/scripts/linux/build/rust/target/x86_64-unknown-linux-gnu/release/libepic_cash_wallet.so" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" diff --git a/scripts/android/build_all.sh b/scripts/android/build_all.sh index 5da88e0e3..987c7df57 100755 --- a/scripts/android/build_all.sh +++ b/scripts/android/build_all.sh @@ -13,7 +13,7 @@ mkdir -p build PLUGINS_DIR=../../crypto_plugins (cd "${PLUGINS_DIR}"/flutter_liblelantus/scripts/android && ./build_all.sh ) & -(cd "${PLUGINS_DIR}"/flutter_libepiccash/scripts/android && ./build_all.sh ) & +(cd "${PLUGINS_DIR}"/flutter_libepiccash/scripts/android && ./install_ndk.sh && ./build_openssl.sh && ./build_all.sh ) & (cd "${PLUGINS_DIR}"/flutter_libmonero/scripts/android/ && ./build_all.sh ) && set_rust_to_1720 && (cd "${PLUGINS_DIR}"/frostdart/scripts/android && ./build_all.sh ) & diff --git a/scripts/linux/build_all.sh b/scripts/linux/build_all.sh index 2b6bd1ffd..5d07aa450 100755 --- a/scripts/linux/build_all.sh +++ b/scripts/linux/build_all.sh @@ -11,12 +11,12 @@ set_rust_to_1671 # flutter-elinux pub get # flutter-elinux build linux --dart-define="IS_ARM=true" mkdir -p build -./build_secure_storage_deps.sh & -(cd ../../crypto_plugins/flutter_liblelantus/scripts/linux && ./build_all.sh ) & -(cd ../../crypto_plugins/flutter_libepiccash/scripts/linux && ./build_all.sh ) & -(cd ../../crypto_plugins/flutter_libmonero/scripts/linux && ./build_monero_all.sh && ./build_sharedfile.sh ) & -set_rust_to_1720 & -(cd ../../crypto_plugins/frostdart/scripts/linux && ./build_all.sh ) & +./build_secure_storage_deps.sh +(cd ../../crypto_plugins/flutter_liblelantus/scripts/linux && ./build_all.sh ) +(cd ../../crypto_plugins/flutter_libepiccash/scripts/linux && ./build_all.sh ) +(cd ../../crypto_plugins/flutter_libmonero/scripts/linux && ./build_monero_all.sh && ./build_sharedfile.sh ) +set_rust_to_1720 +(cd ../../crypto_plugins/frostdart/scripts/linux && ./build_all.sh ) wait echo "Done building" From f614cfff5f9aa372fc8eb5b06f97985a20e6f2fb Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Fri, 26 Apr 2024 14:21:21 +0200 Subject: [PATCH 08/42] wownero support --- .../add_wallet_views/add_wallet_view/add_wallet_view.dart | 2 +- .../settings/settings_menu/nodes_settings.dart | 2 +- pubspec.lock | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart b/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart index d84bfc708..76e1ee0a2 100644 --- a/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart +++ b/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart @@ -131,7 +131,7 @@ class _AddWalletViewState extends ConsumerState { _coins.remove(Coin.monero); _coins.remove(Coin.wownero); } else if (Platform.isLinux) { - _coins.remove(Coin.wownero); + // _coins.remove(Coin.wownero); } // Remove FROST from the list of coins based on our frostEnabled preference. diff --git a/lib/pages_desktop_specific/settings/settings_menu/nodes_settings.dart b/lib/pages_desktop_specific/settings/settings_menu/nodes_settings.dart index eec6e1a5f..1edeac7a6 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/nodes_settings.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/nodes_settings.dart @@ -69,7 +69,7 @@ class _NodesSettings extends ConsumerState { _coins.remove(Coin.monero); _coins.remove(Coin.wownero); } else if (Platform.isLinux) { - _coins.remove(Coin.wownero); + // _coins.remove(Coin.wownero); } searchNodeController = TextEditingController(); diff --git a/pubspec.lock b/pubspec.lock index 479d5c45d..0845fd66c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1197,8 +1197,8 @@ packages: dependency: transitive description: path: "." - ref: "342bad5d91d8476f0e32a57ae944f2cfe34d4241" - resolved-ref: "342bad5d91d8476f0e32a57ae944f2cfe34d4241" + ref: "2e1d13765c1403a933c77972511a661f26d4af2e" + resolved-ref: "2e1d13765c1403a933c77972511a661f26d4af2e" url: "https://git.mrcyjanek.net/mrcyjanek/monero.dart" source: git version: "0.0.0" From ffa4c85d532b7a9251395583bfdd36525cecc64a Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Fri, 26 Apr 2024 17:51:51 +0200 Subject: [PATCH 09/42] additionalInfo backwards compat --- lib/wallets/wallet/impl/monero_wallet.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/wallets/wallet/impl/monero_wallet.dart b/lib/wallets/wallet/impl/monero_wallet.dart index e0d70db36..5f681c774 100644 --- a/lib/wallets/wallet/impl/monero_wallet.dart +++ b/lib/wallets/wallet/impl/monero_wallet.dart @@ -218,8 +218,8 @@ class MoneroWallet extends CryptonoteWallet with CwBasedInterface { final addressString = (CwBasedInterface.cwWalletBase as MoneroWalletBase?) ?.getTransactionAddress( - addressInfo!['accountIndex'] as int, - addressInfo['addressIndex'] as int, + addressInfo?['accountIndex'] as int? ?? 0, + addressInfo?['addressIndex'] as int? ?? 0, ); if (addressString != null) { From 19de471b85e9adede9a9c2c152a17c3a726b8c52 Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Sat, 27 Apr 2024 18:16:31 +0200 Subject: [PATCH 10/42] macos support --- macos/Podfile.lock | 54 -------------------------- macos/Runner.xcodeproj/project.pbxproj | 18 +++++++++ macos/monero_libwallet2_api_c.dylib | 1 + macos/wownero_libwallet2_api_c.dylib | 1 + pubspec.lock | 4 +- 5 files changed, 22 insertions(+), 56 deletions(-) create mode 120000 macos/monero_libwallet2_api_c.dylib create mode 120000 macos/wownero_libwallet2_api_c.dylib diff --git a/macos/Podfile.lock b/macos/Podfile.lock index 35c7171cb..57c4d3468 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -5,48 +5,6 @@ PODS: - connectivity_plus (0.0.1): - FlutterMacOS - ReachabilitySwift - - cw_monero (0.0.1): - - cw_monero/Boost (= 0.0.1) - - cw_monero/Monero (= 0.0.1) - - cw_monero/OpenSSL (= 0.0.1) - - cw_monero/Sodium (= 0.0.1) - - cw_monero/Unbound (= 0.0.1) - - FlutterMacOS - - cw_monero/Boost (0.0.1): - - FlutterMacOS - - cw_monero/Monero (0.0.1): - - FlutterMacOS - - cw_monero/OpenSSL (0.0.1): - - FlutterMacOS - - cw_monero/Sodium (0.0.1): - - FlutterMacOS - - cw_monero/Unbound (0.0.1): - - FlutterMacOS - - cw_shared_external (0.0.1): - - cw_shared_external/Boost (= 0.0.1) - - cw_shared_external/OpenSSL (= 0.0.1) - - FlutterMacOS - - cw_shared_external/Boost (0.0.1): - - FlutterMacOS - - cw_shared_external/OpenSSL (0.0.1): - - FlutterMacOS - - cw_wownero (0.0.1): - - cw_wownero/Boost (= 0.0.1) - - cw_wownero/OpenSSL (= 0.0.1) - - cw_wownero/Sodium (= 0.0.1) - - cw_wownero/Unbound (= 0.0.1) - - cw_wownero/Wownero (= 0.0.1) - - FlutterMacOS - - cw_wownero/Boost (0.0.1): - - FlutterMacOS - - cw_wownero/OpenSSL (0.0.1): - - FlutterMacOS - - cw_wownero/Sodium (0.0.1): - - FlutterMacOS - - cw_wownero/Unbound (0.0.1): - - FlutterMacOS - - cw_wownero/Wownero (0.0.1): - - FlutterMacOS - desktop_drop (0.0.1): - FlutterMacOS - device_info_plus (0.0.1): @@ -89,9 +47,6 @@ PODS: DEPENDENCIES: - coinlib_flutter (from `Flutter/ephemeral/.symlinks/plugins/coinlib_flutter/darwin`) - connectivity_plus (from `Flutter/ephemeral/.symlinks/plugins/connectivity_plus/macos`) - - cw_monero (from `Flutter/ephemeral/.symlinks/plugins/cw_monero/macos`) - - cw_shared_external (from `Flutter/ephemeral/.symlinks/plugins/cw_shared_external/macos`) - - cw_wownero (from `Flutter/ephemeral/.symlinks/plugins/cw_wownero/macos`) - desktop_drop (from `Flutter/ephemeral/.symlinks/plugins/desktop_drop/macos`) - device_info_plus (from `Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos`) - devicelocale (from `Flutter/ephemeral/.symlinks/plugins/devicelocale/macos`) @@ -121,12 +76,6 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/coinlib_flutter/darwin connectivity_plus: :path: Flutter/ephemeral/.symlinks/plugins/connectivity_plus/macos - cw_monero: - :path: Flutter/ephemeral/.symlinks/plugins/cw_monero/macos - cw_shared_external: - :path: Flutter/ephemeral/.symlinks/plugins/cw_shared_external/macos - cw_wownero: - :path: Flutter/ephemeral/.symlinks/plugins/cw_wownero/macos desktop_drop: :path: Flutter/ephemeral/.symlinks/plugins/desktop_drop/macos device_info_plus: @@ -169,9 +118,6 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: coinlib_flutter: 6abec900d67762a6e7ccfd567a3cd3ae00bbee35 connectivity_plus: 18d3c32514c886e046de60e9c13895109866c747 - cw_monero: 7acce7238d217e3993ecac6ec2dec07be728769a - cw_shared_external: c6adfd29c9be4d64f84e1fa9c541ccbcbdb6b457 - cw_wownero: bcd7f2ad6c0a3e8e2a51756fb14f0579b6f8b4ff desktop_drop: 69eeff437544aa619c8db7f4481b3a65f7696898 device_info_plus: 5401765fde0b8d062a2f8eb65510fb17e77cf07f devicelocale: 9f0f36ac651cabae2c33f32dcff4f32b61c38225 diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index eccafe6ba..cf58de9bd 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -31,6 +31,8 @@ B98151822A67402A009D013C /* mobileliblelantus.framework in Bundle Framework */ = {isa = PBXBuildFile; fileRef = B98151802A674022009D013C /* mobileliblelantus.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; B98151842A674143009D013C /* libsqlite3.0.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = B98151832A674143009D013C /* libsqlite3.0.tbd */; }; BFD0376C00E1FFD46376BB9D /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9206484E84CB0AD93E3E68CA /* Pods_RunnerTests.framework */; }; + CEA2021D2BDD4D7100FE1D27 /* wownero_libwallet2_api_c.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = CEA2021C2BDD4D7100FE1D27 /* wownero_libwallet2_api_c.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + CEA202202BDD4F0B00FE1D27 /* monero_libwallet2_api_c.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = CEA2021F2BDD4F0B00FE1D27 /* monero_libwallet2_api_c.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; F1FA2C4E2BA4B49F00BDA1BB /* frostdart.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F1FA2C4D2BA4B49F00BDA1BB /* frostdart.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; F1FA2C502BA4B4CA00BDA1BB /* frostdart.dylib in Resources */ = {isa = PBXBuildFile; fileRef = F1FA2C4F2BA4B4CA00BDA1BB /* frostdart.dylib */; }; F1FA2C512BA4B51E00BDA1BB /* frostdart.dylib in Bundle Framework */ = {isa = PBXBuildFile; fileRef = F1FA2C4D2BA4B49F00BDA1BB /* frostdart.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; @@ -67,6 +69,17 @@ name = "Bundle Framework"; runOnlyForDeploymentPostprocessing = 0; }; + CEA202192BDD4C3500FE1D27 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 12; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + CEA202202BDD4F0B00FE1D27 /* monero_libwallet2_api_c.dylib in CopyFiles */, + CEA2021D2BDD4D7100FE1D27 /* wownero_libwallet2_api_c.dylib in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ @@ -97,6 +110,8 @@ B98151802A674022009D013C /* mobileliblelantus.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = mobileliblelantus.framework; path = ../crypto_plugins/flutter_liblelantus/scripts/macos/mobileliblelantus/mobileliblelantus.framework; sourceTree = ""; }; B98151832A674143009D013C /* libsqlite3.0.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.0.tbd; path = usr/lib/libsqlite3.0.tbd; sourceTree = SDKROOT; }; BF5E76865ACB46314AC27D8F /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; + CEA2021C2BDD4D7100FE1D27 /* wownero_libwallet2_api_c.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = wownero_libwallet2_api_c.dylib; sourceTree = ""; }; + CEA2021F2BDD4F0B00FE1D27 /* monero_libwallet2_api_c.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = monero_libwallet2_api_c.dylib; sourceTree = ""; }; E6036BF01BF05EA773C76D22 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; F1FA2C4D2BA4B49F00BDA1BB /* frostdart.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = frostdart.dylib; path = ../crypto_plugins/frostdart/macos/frostdart.dylib; sourceTree = ""; }; F1FA2C4F2BA4B4CA00BDA1BB /* frostdart.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = frostdart.dylib; path = ../crypto_plugins/frostdart/macos/frostdart.dylib; sourceTree = ""; }; @@ -147,6 +162,8 @@ 33CC10E42044A3C60003C045 = { isa = PBXGroup; children = ( + CEA2021F2BDD4F0B00FE1D27 /* monero_libwallet2_api_c.dylib */, + CEA2021C2BDD4D7100FE1D27 /* wownero_libwallet2_api_c.dylib */, F1FA2C4F2BA4B4CA00BDA1BB /* frostdart.dylib */, 33FAB671232836740065AC1E /* Runner */, 33CEB47122A05771004F2AC0 /* Flutter */, @@ -259,6 +276,7 @@ 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, 529691D83C3BADE14E2EAC03 /* [CP] Embed Pods Frameworks */, + CEA202192BDD4C3500FE1D27 /* CopyFiles */, ); buildRules = ( ); diff --git a/macos/monero_libwallet2_api_c.dylib b/macos/monero_libwallet2_api_c.dylib new file mode 120000 index 000000000..da01b591e --- /dev/null +++ b/macos/monero_libwallet2_api_c.dylib @@ -0,0 +1 @@ +../crypto_plugins/flutter_libmonero/scripts/monero_c/release/monero/host-apple-darwin_libwallet2_api_c.dylib \ No newline at end of file diff --git a/macos/wownero_libwallet2_api_c.dylib b/macos/wownero_libwallet2_api_c.dylib new file mode 120000 index 000000000..f0a776dc1 --- /dev/null +++ b/macos/wownero_libwallet2_api_c.dylib @@ -0,0 +1 @@ +../crypto_plugins/flutter_libmonero/scripts/monero_c/release/wownero/host-apple-darwin_libwallet2_api_c.dylib \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index 0845fd66c..e6c510034 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1197,8 +1197,8 @@ packages: dependency: transitive description: path: "." - ref: "2e1d13765c1403a933c77972511a661f26d4af2e" - resolved-ref: "2e1d13765c1403a933c77972511a661f26d4af2e" + ref: "7ba955fd9d975c7228ee43a744294399b48f9993" + resolved-ref: "7ba955fd9d975c7228ee43a744294399b48f9993" url: "https://git.mrcyjanek.net/mrcyjanek/monero.dart" source: git version: "0.0.0" From 09cbcc7b661393f27076bea209eacdcb8b8a0ed2 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Sun, 28 Apr 2024 23:11:10 -0500 Subject: [PATCH 11/42] add 16 word polyseeds as an option for monero --- lib/utilities/constants.dart | 2 +- lib/wallets/wallet/impl/monero_wallet.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/utilities/constants.dart b/lib/utilities/constants.dart index f60a0fe1e..77c034be1 100644 --- a/lib/utilities/constants.dart +++ b/lib/utilities/constants.dart @@ -197,7 +197,7 @@ abstract class Constants { values.addAll([24, 12]); case Coin.monero: - values.addAll([25]); + values.addAll([16, 25]); break; case Coin.wownero: values.addAll([14, 25]); diff --git a/lib/wallets/wallet/impl/monero_wallet.dart b/lib/wallets/wallet/impl/monero_wallet.dart index 5f681c774..92da26d0d 100644 --- a/lib/wallets/wallet/impl/monero_wallet.dart +++ b/lib/wallets/wallet/impl/monero_wallet.dart @@ -392,7 +392,7 @@ class MoneroWallet extends CryptonoteWallet with CwBasedInterface { final mnemonic = await getMnemonic(); final seedLength = mnemonic.trim().split(" ").length; - if (seedLength != 25) { + if (seedLength != 25 && seedLength != 16) { throw Exception("Invalid monero mnemonic length found: $seedLength"); } From 7929d49e27d24eb294076c2118b9b83c6278621d Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Tue, 30 Apr 2024 09:55:24 +0200 Subject: [PATCH 12/42] polyseed support --- .../restore_options_view.dart | 28 ++++++++++++++----- lib/utilities/constants.dart | 2 +- lib/wallets/wallet/impl/monero_wallet.dart | 3 +- lib/wallets/wallet/impl/wownero_wallet.dart | 4 ++- 4 files changed, 27 insertions(+), 10 deletions(-) diff --git a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart index 44ac51aac..8b28a0466 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart @@ -311,7 +311,9 @@ class _RestoreOptionsViewState extends ConsumerState { SizedBox( height: isDesktop ? 40 : 24, ), - if (coin == Coin.monero || + if ((coin == Coin.monero && + ref.watch(mnemonicWordCountStateProvider.state).state == + 25) || coin == Coin.epicCash || (coin == Coin.wownero && ref.watch(mnemonicWordCountStateProvider.state).state == @@ -327,7 +329,9 @@ class _RestoreOptionsViewState extends ConsumerState { : STextStyles.smallMed12(context), textAlign: TextAlign.left, ), - if (coin == Coin.monero || + if ((coin == Coin.monero && + ref.watch(mnemonicWordCountStateProvider.state).state == + 25) || coin == Coin.epicCash || (coin == Coin.wownero && ref.watch(mnemonicWordCountStateProvider.state).state == @@ -335,7 +339,9 @@ class _RestoreOptionsViewState extends ConsumerState { SizedBox( height: isDesktop ? 16 : 8, ), - if (coin == Coin.monero || + if ((coin == Coin.monero && + ref.watch(mnemonicWordCountStateProvider.state).state == + 25) || coin == Coin.epicCash || (coin == Coin.wownero && ref.watch(mnemonicWordCountStateProvider.state).state == @@ -345,7 +351,9 @@ class _RestoreOptionsViewState extends ConsumerState { onTap: chooseDate, controller: _dateController, ), - if (coin == Coin.monero || + if ((coin == Coin.monero && + ref.watch(mnemonicWordCountStateProvider.state).state == + 25) || coin == Coin.epicCash || (coin == Coin.wownero && ref.watch(mnemonicWordCountStateProvider.state).state == @@ -356,7 +364,9 @@ class _RestoreOptionsViewState extends ConsumerState { onTap: chooseDesktopDate, controller: _dateController, ), - if (coin == Coin.monero || + if ((coin == Coin.monero && + ref.watch(mnemonicWordCountStateProvider.state).state == + 25) || coin == Coin.epicCash || (coin == Coin.wownero && ref.watch(mnemonicWordCountStateProvider.state).state == @@ -364,7 +374,9 @@ class _RestoreOptionsViewState extends ConsumerState { const SizedBox( height: 8, ), - if (coin == Coin.monero || + if ((coin == Coin.monero && + ref.watch(mnemonicWordCountStateProvider.state).state == + 25) || coin == Coin.epicCash || (coin == Coin.wownero && ref.watch(mnemonicWordCountStateProvider.state).state == @@ -385,7 +397,9 @@ class _RestoreOptionsViewState extends ConsumerState { ), ), ), - if (coin == Coin.monero || + if ((coin == Coin.monero && + ref.watch(mnemonicWordCountStateProvider.state).state == + 25) || coin == Coin.epicCash || (coin == Coin.wownero && ref.watch(mnemonicWordCountStateProvider.state).state == diff --git a/lib/utilities/constants.dart b/lib/utilities/constants.dart index db0543044..e0fd5e3df 100644 --- a/lib/utilities/constants.dart +++ b/lib/utilities/constants.dart @@ -184,7 +184,7 @@ abstract class Constants { values.addAll([24, 12]); case Coin.monero: - values.addAll([25]); + values.addAll([16, 25]); break; case Coin.wownero: values.addAll([14, 25]); diff --git a/lib/wallets/wallet/impl/monero_wallet.dart b/lib/wallets/wallet/impl/monero_wallet.dart index 5f681c774..9ed4b0da7 100644 --- a/lib/wallets/wallet/impl/monero_wallet.dart +++ b/lib/wallets/wallet/impl/monero_wallet.dart @@ -159,6 +159,7 @@ class MoneroWallet extends CryptonoteWallet with CwBasedInterface { type: WalletType.monero, trusted: node.trusted ?? false, ), + socksProxyAddress: null, ); } @@ -392,7 +393,7 @@ class MoneroWallet extends CryptonoteWallet with CwBasedInterface { final mnemonic = await getMnemonic(); final seedLength = mnemonic.trim().split(" ").length; - if (seedLength != 25) { + if (seedLength != 25 && seedLength != 16) { throw Exception("Invalid monero mnemonic length found: $seedLength"); } diff --git a/lib/wallets/wallet/impl/wownero_wallet.dart b/lib/wallets/wallet/impl/wownero_wallet.dart index 514f9e244..46ad5726a 100644 --- a/lib/wallets/wallet/impl/wownero_wallet.dart +++ b/lib/wallets/wallet/impl/wownero_wallet.dart @@ -149,6 +149,7 @@ class WowneroWallet extends CryptonoteWallet with CwBasedInterface { type: WalletType.wownero, trusted: node.trusted ?? false, ), + socksProxyAddress: null, ); } @@ -331,7 +332,8 @@ class WowneroWallet extends CryptonoteWallet with CwBasedInterface { // days: // 2))); // subtract a couple days to ensure we have a buffer for SWB // TODO(mrcyjanek): implement - final bufferedCreateHeight = 1; //getSeedHeightSync(wallet!.seed.trim()); + final bufferedCreateHeight = + 1; //getSeedHeightSync(wallet!.seed.trim()); await info.updateRestoreHeight( newRestoreHeight: bufferedCreateHeight, From 90fca36b779c56d56cf9cb28050d07bb3d50bcb9 Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Tue, 30 Apr 2024 16:12:46 +0200 Subject: [PATCH 13/42] tor proxy support --- lib/wallets/wallet/impl/monero_wallet.dart | 9 ++++++++- lib/wallets/wallet/impl/wownero_wallet.dart | 12 +++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/lib/wallets/wallet/impl/monero_wallet.dart b/lib/wallets/wallet/impl/monero_wallet.dart index 9ed4b0da7..ce81d1552 100644 --- a/lib/wallets/wallet/impl/monero_wallet.dart +++ b/lib/wallets/wallet/impl/monero_wallet.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:io'; import 'dart:math'; import 'package:cw_core/monero_transaction_priority.dart'; @@ -21,6 +22,7 @@ import 'package:isar/isar.dart'; import 'package:stackwallet/db/hive/db.dart'; import 'package:stackwallet/models/isar/models/blockchain_data/address.dart'; import 'package:stackwallet/models/isar/models/blockchain_data/transaction.dart'; +import 'package:stackwallet/services/tor_service.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; import 'package:stackwallet/utilities/enums/fee_rate_type_enum.dart'; import 'package:stackwallet/utilities/logger.dart'; @@ -153,13 +155,18 @@ class MoneroWallet extends CryptonoteWallet with CwBasedInterface { final node = getCurrentNode(); final host = Uri.parse(node.host).host; + ({InternetAddress host, int port})? proxy; + if (prefs.useTor) { + proxy = TorService.sharedInstance.getProxyInfo(); + } await CwBasedInterface.cwWalletBase?.connectToNode( node: Node( uri: "$host:${node.port}", type: WalletType.monero, trusted: node.trusted ?? false, ), - socksProxyAddress: null, + socksProxyAddress: + proxy == null ? null : "${proxy.host.address}:${proxy.port}", ); } diff --git a/lib/wallets/wallet/impl/wownero_wallet.dart b/lib/wallets/wallet/impl/wownero_wallet.dart index 46ad5726a..5c9e481a2 100644 --- a/lib/wallets/wallet/impl/wownero_wallet.dart +++ b/lib/wallets/wallet/impl/wownero_wallet.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:io'; import 'dart:math'; import 'package:cw_core/monero_transaction_priority.dart'; @@ -11,7 +12,6 @@ import 'package:cw_core/wallet_credentials.dart'; import 'package:cw_core/wallet_info.dart'; import 'package:cw_core/wallet_type.dart'; import 'package:cw_monero/api/exceptions/creation_transaction_exception.dart'; -import 'package:cw_wownero/api/wallet.dart'; import 'package:cw_wownero/pending_wownero_transaction.dart'; import 'package:cw_wownero/wownero_wallet.dart'; import 'package:decimal/decimal.dart'; @@ -23,6 +23,7 @@ import 'package:isar/isar.dart'; import 'package:stackwallet/db/hive/db.dart'; import 'package:stackwallet/models/isar/models/blockchain_data/address.dart'; import 'package:stackwallet/models/isar/models/blockchain_data/transaction.dart'; +import 'package:stackwallet/services/tor_service.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; import 'package:stackwallet/utilities/enums/fee_rate_type_enum.dart'; import 'package:stackwallet/utilities/logger.dart'; @@ -143,13 +144,18 @@ class WowneroWallet extends CryptonoteWallet with CwBasedInterface { final node = getCurrentNode(); final host = Uri.parse(node.host).host; + ({InternetAddress host, int port})? proxy; + if (prefs.useTor) { + proxy = TorService.sharedInstance.getProxyInfo(); + } await CwBasedInterface.cwWalletBase?.connectToNode( node: Node( uri: "$host:${node.port}", type: WalletType.wownero, trusted: node.trusted ?? false, ), - socksProxyAddress: null, + socksProxyAddress: + proxy == null ? null : "${proxy.host.address}:${proxy.port}", ); } @@ -332,7 +338,7 @@ class WowneroWallet extends CryptonoteWallet with CwBasedInterface { // days: // 2))); // subtract a couple days to ensure we have a buffer for SWB // TODO(mrcyjanek): implement - final bufferedCreateHeight = + const bufferedCreateHeight = 1; //getSeedHeightSync(wallet!.seed.trim()); await info.updateRestoreHeight( From 491bc2475be902ed6eba8e8926f679a37876f702 Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Tue, 30 Apr 2024 17:24:24 +0200 Subject: [PATCH 14/42] initial windows build support --- scripts/windows/build_all.sh | 6 +++--- scripts/windows/deps.sh | 4 ++-- windows/flutter/CMakeLists.txt | 7 ++++++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/scripts/windows/build_all.sh b/scripts/windows/build_all.sh index ee3c1b558..06c80bd54 100755 --- a/scripts/windows/build_all.sh +++ b/scripts/windows/build_all.sh @@ -7,9 +7,9 @@ source ../rust_version.sh set_rust_to_1671 mkdir -p build -(cd ../../crypto_plugins/flutter_libepiccash/scripts/windows && ./build_all.sh ) & -(cd ../../crypto_plugins/flutter_liblelantus/scripts/windows && ./build_all.sh ) & -(cd ../../crypto_plugins/flutter_libmonero/scripts/windows && ./build_all.sh) & +(cd ../../crypto_plugins/flutter_libepiccash/scripts/windows && ./build_all.sh ) +(cd ../../crypto_plugins/flutter_liblelantus/scripts/windows && ./build_all.sh ) +(cd ../../crypto_plugins/flutter_libmonero/scripts/windows && ./build_all.sh) wait echo "Done building" diff --git a/scripts/windows/deps.sh b/scripts/windows/deps.sh index 0f6642068..802ca8f8a 100644 --- a/scripts/windows/deps.sh +++ b/scripts/windows/deps.sh @@ -1,7 +1,7 @@ #!/bin/bash -(cd ../../crypto_plugins/flutter_libepiccash/scripts/windows && ./deps.sh ) & -(cd ../../crypto_plugins/flutter_liblelantus/scripts/windows && ./mxedeps.sh ) & +(cd ../../crypto_plugins/flutter_libepiccash/scripts/windows && ./deps.sh ) +(cd ../../crypto_plugins/flutter_liblelantus/scripts/windows && ./mxedeps.sh ) # (cd ../../crypto_plugins/flutter_libmonero/scripts/windows && ./monerodeps.sh && ./mxedeps.sh) & wait diff --git a/windows/flutter/CMakeLists.txt b/windows/flutter/CMakeLists.txt index 930d2071a..903f4899d 100644 --- a/windows/flutter/CMakeLists.txt +++ b/windows/flutter/CMakeLists.txt @@ -10,6 +10,11 @@ include(${EPHEMERAL_DIR}/generated_config.cmake) # https://github.com/flutter/flutter/issues/57146. set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") +# Set fallback configurations for older versions of the flutter tool. +if (NOT DEFINED FLUTTER_TARGET_PLATFORM) + set(FLUTTER_TARGET_PLATFORM "windows-x64") +endif() + # === Flutter Library === set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") @@ -92,7 +97,7 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} -E env ${FLUTTER_TOOL_ENVIRONMENT} "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" - windows-x64 $ + ${FLUTTER_TARGET_PLATFORM} $ VERBATIM ) add_custom_target(flutter_assemble DEPENDS From 76f0d20d2697bfe502c2b75be5588d867bc22026 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Tue, 30 Apr 2024 10:36:26 -0500 Subject: [PATCH 15/42] update flutter_libmonero to latest monerodart --- crypto_plugins/flutter_libmonero | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/flutter_libmonero b/crypto_plugins/flutter_libmonero index b25aa4845..e2168de1d 160000 --- a/crypto_plugins/flutter_libmonero +++ b/crypto_plugins/flutter_libmonero @@ -1 +1 @@ -Subproject commit b25aa48451aeb6f2ea4e9b3831789f6bdbfb90e1 +Subproject commit e2168de1d8f2cc3ab91dd031aa8f1580a1920358 From 25688a696e1d2c11f78cb52cba44c67eb65a6943 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Tue, 30 Apr 2024 11:18:08 -0500 Subject: [PATCH 16/42] pass nettype in flutter_libmonero and update its pubspec.lock --- crypto_plugins/flutter_libmonero | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/flutter_libmonero b/crypto_plugins/flutter_libmonero index e2168de1d..4be1ce1a4 160000 --- a/crypto_plugins/flutter_libmonero +++ b/crypto_plugins/flutter_libmonero @@ -1 +1 @@ -Subproject commit e2168de1d8f2cc3ab91dd031aa8f1580a1920358 +Subproject commit 4be1ce1a404b8488f03da77ae8d826e39d0cb846 From ef7afcb63402173a50e24ac377f07fafca7b5ed4 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Tue, 30 Apr 2024 13:14:03 -0500 Subject: [PATCH 17/42] update default monero seed length for ui display purposes --- lib/utilities/constants.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utilities/constants.dart b/lib/utilities/constants.dart index 77c034be1..8ea74f707 100644 --- a/lib/utilities/constants.dart +++ b/lib/utilities/constants.dart @@ -297,7 +297,7 @@ abstract class Constants { return 24; case Coin.monero: - return 25; + return 16; case Coin.bitcoinFrost: case Coin.bitcoinFrostTestNet: From 8ea347cacf50f4750e695c1ef4d4cec2912fcb4e Mon Sep 17 00:00:00 2001 From: sneurlax Date: Tue, 30 Apr 2024 14:44:00 -0500 Subject: [PATCH 18/42] initial flutter_libmonero windows support --- crypto_plugins/flutter_libmonero | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/flutter_libmonero b/crypto_plugins/flutter_libmonero index 4be1ce1a4..216c1a3ea 160000 --- a/crypto_plugins/flutter_libmonero +++ b/crypto_plugins/flutter_libmonero @@ -1 +1 @@ -Subproject commit 4be1ce1a404b8488f03da77ae8d826e39d0cb846 +Subproject commit 216c1a3ea1be8c97bd9148c5e47ef87db52b8515 From ed840ac2357b304770ed44ee19da428b5846fb9e Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Wed, 1 May 2024 16:42:54 +0200 Subject: [PATCH 19/42] windows support --- lib/main.dart | 8 ++----- .../add_wallet_view/add_wallet_view.dart | 6 ------ .../settings_menu/nodes_settings.dart | 6 ------ pubspec.lock | 4 ++-- windows/CMakeLists.txt | 21 +++++++++++++++++++ 5 files changed, 25 insertions(+), 20 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 54ccf3866..1d6a7128b 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -212,12 +212,8 @@ void main(List args) async { } } - if (!Platform.isWindows) { - monero.onStartup(); - } - if (!Platform.isLinux && !Platform.isWindows) { - wownero.onStartup(); - } + monero.onStartup(); + wownero.onStartup(); // SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, // overlays: [SystemUiOverlay.bottom]); diff --git a/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart b/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart index 54b94efb3..88bf55833 100644 --- a/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart +++ b/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart @@ -127,12 +127,6 @@ class _AddWalletViewState extends ConsumerState { _searchFieldController = TextEditingController(); _searchFocusNode = FocusNode(); // _coinsTestnet.remove(Coin.firoTestNet); - if (Platform.isWindows) { - _coins.remove(Coin.monero); - _coins.remove(Coin.wownero); - } else if (Platform.isLinux) { - // _coins.remove(Coin.wownero); - } coinEntities.addAll(_coins.map((e) => CoinEntity(e))); diff --git a/lib/pages_desktop_specific/settings/settings_menu/nodes_settings.dart b/lib/pages_desktop_specific/settings/settings_menu/nodes_settings.dart index 1edeac7a6..20e8a4696 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/nodes_settings.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/nodes_settings.dart @@ -65,12 +65,6 @@ class _NodesSettings extends ConsumerState { void initState() { _coins = _coins.toList(); _coins.remove(Coin.firoTestNet); - if (Platform.isWindows) { - _coins.remove(Coin.monero); - _coins.remove(Coin.wownero); - } else if (Platform.isLinux) { - // _coins.remove(Coin.wownero); - } searchNodeController = TextEditingController(); searchNodeFocusNode = FocusNode(); diff --git a/pubspec.lock b/pubspec.lock index 7d2bdde86..e52c01710 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1144,8 +1144,8 @@ packages: dependency: transitive description: path: "." - ref: "7ba955fd9d975c7228ee43a744294399b48f9993" - resolved-ref: "7ba955fd9d975c7228ee43a744294399b48f9993" + ref: "6a17a405a1a260fa228b2f4fc94044088a4335ac" + resolved-ref: "6a17a405a1a260fa228b2f4fc94044088a4335ac" url: "https://git.mrcyjanek.net/mrcyjanek/monero.dart" source: git version: "0.0.0" diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt index eddd46e4d..610881fcc 100644 --- a/windows/CMakeLists.txt +++ b/windows/CMakeLists.txt @@ -86,6 +86,27 @@ install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libepiccash install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_liblelantus/scripts/windows/build/libmobileliblelantus.dll" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libmonero/scripts/monero_c/release/monero/x86_64-w64-mingw32_libwallet2_api_c.dll" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" RENAME "monero_libwallet2_api_c.dll" + COMPONENT Runtime) + +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libmonero/scripts/monero_c/release/wownero/x86_64-w64-mingw32_libwallet2_api_c.dll" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" RENAME "wownero_libwallet2_api_c.dll" + COMPONENT Runtime) + +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libmonero/scripts/monero_c/release/wownero/x86_64-w64-mingw32_libgcc_s_seh-1.dll" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" RENAME "libgcc_s_seh-1.dll" + COMPONENT Runtime) + +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libmonero/scripts/monero_c/release/wownero/x86_64-w64-mingw32_libpolyseed.dll" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" RENAME "libpolyseed.dll" + COMPONENT Runtime) + +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libmonero/scripts/monero_c/release/wownero/x86_64-w64-mingw32_libssp-0.dll" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" RENAME "libssp-0.dll" + COMPONENT Runtime) + +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libmonero/scripts/monero_c/release/wownero/x86_64-w64-mingw32_libstdc++-6.dll" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" RENAME "libstdc++-6.dll" + COMPONENT Runtime) + +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../crypto_plugins/flutter_libmonero/scripts/monero_c/release/wownero/x86_64-w64-mingw32_libwinpthread-1.dll" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" RENAME "libwinpthread-1.dll" + COMPONENT Runtime) + if(PLUGIN_BUNDLED_LIBRARIES) install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" From 53bccd20d15e7677c5ca7776157d660363e7c443 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Wed, 1 May 2024 19:28:05 -0500 Subject: [PATCH 20/42] update flutter_libmonero ref --- crypto_plugins/flutter_libmonero | 2 +- pubspec.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crypto_plugins/flutter_libmonero b/crypto_plugins/flutter_libmonero index 216c1a3ea..a4a66396b 160000 --- a/crypto_plugins/flutter_libmonero +++ b/crypto_plugins/flutter_libmonero @@ -1 +1 @@ -Subproject commit 216c1a3ea1be8c97bd9148c5e47ef87db52b8515 +Subproject commit a4a66396bbfab7ac61a04eab0c0858f6900c83c3 diff --git a/pubspec.lock b/pubspec.lock index 5fbea128b..e6c510034 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1197,8 +1197,8 @@ packages: dependency: transitive description: path: "." - ref: "6a17a405a1a260fa228b2f4fc94044088a4335ac" - resolved-ref: "6a17a405a1a260fa228b2f4fc94044088a4335ac" + ref: "7ba955fd9d975c7228ee43a744294399b48f9993" + resolved-ref: "7ba955fd9d975c7228ee43a744294399b48f9993" url: "https://git.mrcyjanek.net/mrcyjanek/monero.dart" source: git version: "0.0.0" From 395fb2410047db238d49f6cf7f5ac98ec363d85f Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 3 May 2024 16:24:23 -0500 Subject: [PATCH 21/42] monerodart windows updates and submodule-pinning --- crypto_plugins/flutter_libmonero | 2 +- pubspec.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crypto_plugins/flutter_libmonero b/crypto_plugins/flutter_libmonero index a4a66396b..e06c5b92a 160000 --- a/crypto_plugins/flutter_libmonero +++ b/crypto_plugins/flutter_libmonero @@ -1 +1 @@ -Subproject commit a4a66396bbfab7ac61a04eab0c0858f6900c83c3 +Subproject commit e06c5b92a2a98b78d5506e6472a0fac1fbba9a10 diff --git a/pubspec.lock b/pubspec.lock index e6c510034..5fbea128b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1197,8 +1197,8 @@ packages: dependency: transitive description: path: "." - ref: "7ba955fd9d975c7228ee43a744294399b48f9993" - resolved-ref: "7ba955fd9d975c7228ee43a744294399b48f9993" + ref: "6a17a405a1a260fa228b2f4fc94044088a4335ac" + resolved-ref: "6a17a405a1a260fa228b2f4fc94044088a4335ac" url: "https://git.mrcyjanek.net/mrcyjanek/monero.dart" source: git version: "0.0.0" From e94793cb4650f27c3e91e12db697c2c161504957 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 3 May 2024 16:33:26 -0500 Subject: [PATCH 22/42] Update building.md Remove duplicate and join into one command --- docs/building.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/building.md b/docs/building.md index d4d3ad6f4..100367ce0 100644 --- a/docs/building.md +++ b/docs/building.md @@ -46,7 +46,7 @@ Install [Rust](https://www.rust-lang.org/tools/install) with command: ``` curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source ~/.bashrc -rustup install 1.67.1 +rustup install 1.67.1 1.72.0 1.73.0 rustup default 1.67.1 ``` From d5d5f1bcd2a035d562a94ee09b2115920e0a54dd Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 3 May 2024 16:41:56 -0500 Subject: [PATCH 23/42] Remove newline in building.md --- docs/building.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/building.md b/docs/building.md index 100367ce0..48943eba3 100644 --- a/docs/building.md +++ b/docs/building.md @@ -70,7 +70,6 @@ After installing the prerequisites listed above, download the code and init the git clone https://github.com/cypherstack/stack_wallet.git cd stack_wallet git submodule update --init --recursive - ``` Remove pre-installed system libraries for the following packages built by cryptography plugins in the crypto_plugins folder: `boost iconv libjson-dev libsecret openssl sodium unbound zmq`. You can use From 9035e2311d327f09d86c9f41da6cde016062c6f1 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 3 May 2024 17:06:43 -0500 Subject: [PATCH 24/42] Add g++ gcc gperf deps for monerodart See notes on https://github.com/cypherstack/stack_wallet/pull/818 --- docs/building.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/building.md b/docs/building.md index 48943eba3..af8c38c23 100644 --- a/docs/building.md +++ b/docs/building.md @@ -34,7 +34,7 @@ Make a Pixel 4 (API 30) x86_64 emulator with 2GB of storage space for emulation Install basic dependencies ``` -sudo apt-get install libssl-dev curl unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake libgit2-dev clang libncurses5-dev libncursesw5-dev zlib1g-dev llvm python3-distutils +sudo apt-get install libssl-dev curl unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake libgit2-dev clang libncurses5-dev libncursesw5-dev zlib1g-dev llvm python3-distutils g++ gcc gperf ``` The following *may* be needed for Android studio: From c4e1c3f23e3a00508ed06bb991b9b50aeb089b6e Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 3 May 2024 17:14:19 -0500 Subject: [PATCH 25/42] Remove redundant build script calls --- scripts/android/build_all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/android/build_all.sh b/scripts/android/build_all.sh index 3bc005cf1..4fb525ab7 100755 --- a/scripts/android/build_all.sh +++ b/scripts/android/build_all.sh @@ -13,7 +13,7 @@ mkdir -p build PLUGINS_DIR=../../crypto_plugins (cd "${PLUGINS_DIR}"/flutter_liblelantus/scripts/android && ./build_all.sh ) -(cd "${PLUGINS_DIR}"/flutter_libepiccash/scripts/android && ./install_ndk.sh && ./build_openssl.sh && ./build_all.sh ) +(cd "${PLUGINS_DIR}"/flutter_libepiccash/scripts/android && ./build_all.sh ) (cd "${PLUGINS_DIR}"/flutter_libmonero/scripts/android/ && ./build_all.sh ) set_rust_to_1720 (cd "${PLUGINS_DIR}"/frostdart/scripts/android && ./build_all.sh ) From ea0d380bc2d12a6839ffc00ff699acd90beb2860 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 3 May 2024 17:15:45 -0500 Subject: [PATCH 26/42] Delete .fvmrc Otherwise we'd have to update it. Only I use fvm on macos --- .fvmrc | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 .fvmrc diff --git a/.fvmrc b/.fvmrc deleted file mode 100644 index 5fb0c142c..000000000 --- a/.fvmrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "flutter": "3.16.0" -} \ No newline at end of file From 89a687b9715a8a69590f01da76b83c2a8424c4ee Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 3 May 2024 17:18:02 -0500 Subject: [PATCH 27/42] partial reversion of c78fba7b364bc69ecedc6c71405506f9c02fcc6b otherwise we will need to maintain it and I'm the only one using fvm on macos --- .vscode/settings.json | 1 - 1 file changed, 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index a86b03d61..eba0d6cd7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,3 @@ { "dart.lineLength": 80, - "dart.flutterSdkPath": ".fvm/versions/3.16.0" } \ No newline at end of file From bcb39c39065d04c3907855e1139358732b3c184c Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 3 May 2024 15:42:21 -0600 Subject: [PATCH 28/42] no need for class wide htt client property, and close the client before assigning a new one --- lib/wallets/wallet/impl/stellar_wallet.dart | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/wallets/wallet/impl/stellar_wallet.dart b/lib/wallets/wallet/impl/stellar_wallet.dart index edea60fe5..a2ad93083 100644 --- a/lib/wallets/wallet/impl/stellar_wallet.dart +++ b/lib/wallets/wallet/impl/stellar_wallet.dart @@ -46,7 +46,6 @@ class StellarWallet extends Bip39Wallet { // ============== Private ==================================================== stellar.StellarSDK? _stellarSdk; - HttpClient? _httpClient; Future _getBaseFee() async { final fees = await stellarSdk.feeStats.execute(); @@ -55,6 +54,7 @@ class StellarWallet extends Bip39Wallet { void _updateSdk() { final currentNode = getCurrentNode(); + HttpClient? _httpClient; // TODO [prio=med]: refactor out and call before requests in case Tor is enabled/disabled, listen to prefs change, or similar. if (prefs.useTor) { @@ -63,13 +63,21 @@ class StellarWallet extends Bip39Wallet { _httpClient = HttpClient(); SocksTCPClient.assignToHttpClient( - _httpClient!, [ProxySettings(proxyInfo.host, proxyInfo.port)]); - } else { - _httpClient = null; + _httpClient, + [ + ProxySettings( + proxyInfo.host, + proxyInfo.port, + ), + ], + ); } - _stellarSdk = stellar.StellarSDK("${currentNode.host}:${currentNode.port}", - httpClient: _httpClient); + _stellarSdk?.httpClient.close(); + _stellarSdk = stellar.StellarSDK( + "${currentNode.host}:${currentNode.port}", + httpClient: _httpClient, + ); } Future _accountExists(String accountId) async { From 8c082f3ed43d51cd66319fb3e6bb42d7a7044c1e Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 3 May 2024 18:04:57 -0600 Subject: [PATCH 29/42] untested stellar tor listener --- lib/wallets/wallet/impl/stellar_wallet.dart | 118 +++++++++++++++----- 1 file changed, 90 insertions(+), 28 deletions(-) diff --git a/lib/wallets/wallet/impl/stellar_wallet.dart b/lib/wallets/wallet/impl/stellar_wallet.dart index a2ad93083..657fd7676 100644 --- a/lib/wallets/wallet/impl/stellar_wallet.dart +++ b/lib/wallets/wallet/impl/stellar_wallet.dart @@ -3,6 +3,7 @@ import 'dart:convert'; import 'dart:io'; import 'package:isar/isar.dart'; +import 'package:mutex/mutex.dart'; import 'package:socks5_proxy/socks.dart'; import 'package:stackwallet/models/balance.dart'; import 'package:stackwallet/models/isar/models/blockchain_data/address.dart'; @@ -11,6 +12,9 @@ import 'package:stackwallet/models/isar/models/blockchain_data/v2/input_v2.dart' import 'package:stackwallet/models/isar/models/blockchain_data/v2/output_v2.dart'; import 'package:stackwallet/models/isar/models/blockchain_data/v2/transaction_v2.dart'; import 'package:stackwallet/models/paymint/fee_object_model.dart'; +import 'package:stackwallet/services/event_bus/events/global/tor_connection_status_changed_event.dart'; +import 'package:stackwallet/services/event_bus/events/global/tor_status_changed_event.dart'; +import 'package:stackwallet/services/event_bus/global_event_bus.dart'; import 'package:stackwallet/services/tor_service.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; import 'package:stackwallet/utilities/enums/fee_rate_type_enum.dart'; @@ -23,11 +27,47 @@ import 'package:stackwallet/wallets/wallet/intermediate/bip39_wallet.dart'; import 'package:stellar_flutter_sdk/stellar_flutter_sdk.dart' as stellar; class StellarWallet extends Bip39Wallet { - StellarWallet(CryptoCurrencyNetwork network) : super(Stellar(network)); + StellarWallet(CryptoCurrencyNetwork network) : super(Stellar(network)) { + final bus = GlobalEventBus.instance; - stellar.StellarSDK get stellarSdk { - if (_stellarSdk == null) { - _updateSdk(); + // Listen for tor status changes. + _torStatusListener = bus.on().listen( + (event) async { + switch (event.newStatus) { + case TorConnectionStatus.connecting: + if (!_torConnectingLock.isLocked) { + await _torConnectingLock.acquire(); + } + _requireMutex = true; + break; + + case TorConnectionStatus.connected: + case TorConnectionStatus.disconnected: + if (_torConnectingLock.isLocked) { + _torConnectingLock.release(); + } + _requireMutex = false; + break; + } + }, + ); + + // Listen for tor preference changes. + _torPreferenceListener = bus.on().listen( + (event) async { + _stellarSdk?.httpClient.close(); + _stellarSdk = null; + }, + ); + } + + Future get stellarSdk async { + if (_requireMutex) { + await _torConnectingLock.protect(() async { + _stellarSdk ??= _getFreshSdk(); + }); + } else { + _stellarSdk ??= _getFreshSdk(); } return _stellarSdk!; } @@ -44,19 +84,32 @@ class StellarWallet extends Bip39Wallet { } // ============== Private ==================================================== + // add finalizer to cancel stream subscription when all references to an + // instance of this becomes inaccessible + final _ = Finalizer( + (p0) { + p0._torPreferenceListener?.cancel(); + p0._torStatusListener?.cancel(); + }, + ); + + StreamSubscription? _torStatusListener; + StreamSubscription? _torPreferenceListener; + + final Mutex _torConnectingLock = Mutex(); + bool _requireMutex = false; stellar.StellarSDK? _stellarSdk; Future _getBaseFee() async { - final fees = await stellarSdk.feeStats.execute(); + final fees = await (await stellarSdk).feeStats.execute(); return int.parse(fees.lastLedgerBaseFee); } - void _updateSdk() { + stellar.StellarSDK _getFreshSdk() { final currentNode = getCurrentNode(); HttpClient? _httpClient; - // TODO [prio=med]: refactor out and call before requests in case Tor is enabled/disabled, listen to prefs change, or similar. if (prefs.useTor) { final ({InternetAddress host, int port}) proxyInfo = TorService.sharedInstance.getProxyInfo(); @@ -73,8 +126,7 @@ class StellarWallet extends Bip39Wallet { ); } - _stellarSdk?.httpClient.close(); - _stellarSdk = stellar.StellarSDK( + return stellar.StellarSDK( "${currentNode.host}:${currentNode.port}", httpClient: _httpClient, ); @@ -84,7 +136,8 @@ class StellarWallet extends Bip39Wallet { bool exists = false; try { - final receiverAccount = await stellarSdk.accounts.account(accountId); + final receiverAccount = + await (await stellarSdk).accounts.account(accountId); if (receiverAccount.accountId != "") { exists = true; } @@ -191,7 +244,8 @@ class StellarWallet extends Bip39Wallet { @override Future confirmSend({required TxData txData}) async { final senderKeyPair = await _getSenderKeyPair(index: 0); - final sender = await stellarSdk.accounts.account(senderKeyPair.accountId); + final sender = + await (await stellarSdk).accounts.account(senderKeyPair.accountId); final address = txData.recipients!.first.address; final amountToSend = txData.recipients!.first.amount; @@ -229,7 +283,7 @@ class StellarWallet extends Bip39Wallet { transaction.sign(senderKeyPair, stellarNetwork); try { - final response = await stellarSdk.submitTransaction(transaction); + final response = await (await stellarSdk).submitTransaction(transaction); if (!response.success) { throw Exception("${response.extras?.resultCodes?.transactionResultCode}" " ::: ${response.extras?.resultCodes?.operationsResultCodes}"); @@ -256,7 +310,7 @@ class StellarWallet extends Bip39Wallet { @override Future get fees async { - int fee = await _getBaseFee(); + final int fee = await _getBaseFee(); return FeeObject( numberOfBlocksFast: 1, numberOfBlocksAverage: 1, @@ -294,7 +348,8 @@ class StellarWallet extends Bip39Wallet { stellar.AccountResponse accountResponse; try { - accountResponse = await stellarSdk.accounts + accountResponse = await (await stellarSdk) + .accounts .account((await getCurrentReceivingAddress())!.value) .onError((error, stackTrace) => throw error!); } catch (e) { @@ -315,7 +370,7 @@ class StellarWallet extends Bip39Wallet { } } - for (stellar.Balance balance in accountResponse.balances) { + for (final stellar.Balance balance in accountResponse.balances) { switch (balance.assetType) { case stellar.Asset.TYPE_NATIVE: final swBalance = Balance( @@ -352,7 +407,8 @@ class StellarWallet extends Bip39Wallet { @override Future updateChainHeight() async { try { - final height = await stellarSdk.ledgers + final height = await (await stellarSdk) + .ledgers .order(stellar.RequestBuilderOrder.DESC) .limit(1) .execute() @@ -370,7 +426,8 @@ class StellarWallet extends Bip39Wallet { @override Future updateNode() async { - _updateSdk(); + _stellarSdk?.httpClient.close(); + _stellarSdk = _getFreshSdk(); } @override @@ -378,10 +435,11 @@ class StellarWallet extends Bip39Wallet { try { final myAddress = (await getCurrentReceivingAddress())!; - List transactionList = []; + final List transactionList = []; stellar.Page payments; try { - payments = await stellarSdk.payments + payments = await (await stellarSdk) + .payments .forAccount(myAddress.value) .order(stellar.RequestBuilderOrder.DESC) .execute(); @@ -401,7 +459,7 @@ class StellarWallet extends Bip39Wallet { rethrow; } } - for (stellar.OperationResponse response in payments.records!) { + for (final stellar.OperationResponse response in payments.records!) { // PaymentOperationResponse por; if (response is stellar.PaymentOperationResponse) { final por = response; @@ -431,7 +489,8 @@ class StellarWallet extends Bip39Wallet { final List outputs = []; final List inputs = []; - OutputV2 output = OutputV2.isarCantDoRequiredInDefaultConstructor( + final OutputV2 output = + OutputV2.isarCantDoRequiredInDefaultConstructor( scriptPubKeyHex: "00", valueStringSats: amount.raw.toString(), addresses: [ @@ -439,7 +498,7 @@ class StellarWallet extends Bip39Wallet { ], walletOwns: addressTo == myAddress.value, ); - InputV2 input = InputV2.isarCantDoRequiredInDefaultConstructor( + final InputV2 input = InputV2.isarCantDoRequiredInDefaultConstructor( scriptSigHex: null, scriptSigAsm: null, sequence: null, @@ -459,8 +518,9 @@ class StellarWallet extends Bip39Wallet { int height = 0; //Query the transaction linked to the payment, // por.transaction returns a null sometimes - stellar.TransactionResponse tx = - await stellarSdk.transactions.transaction(por.transactionHash!); + final stellar.TransactionResponse tx = await (await stellarSdk) + .transactions + .transaction(por.transactionHash!); if (tx.hash.isNotEmpty) { fee = tx.feeCharged!; @@ -511,7 +571,8 @@ class StellarWallet extends Bip39Wallet { final List outputs = []; final List inputs = []; - OutputV2 output = OutputV2.isarCantDoRequiredInDefaultConstructor( + final OutputV2 output = + OutputV2.isarCantDoRequiredInDefaultConstructor( scriptPubKeyHex: "00", valueStringSats: amount.raw.toString(), addresses: [ @@ -520,7 +581,7 @@ class StellarWallet extends Bip39Wallet { ], walletOwns: caor.sourceAccount! == myAddress.value, ); - InputV2 input = InputV2.isarCantDoRequiredInDefaultConstructor( + final InputV2 input = InputV2.isarCantDoRequiredInDefaultConstructor( scriptSigHex: null, scriptSigAsm: null, sequence: null, @@ -541,8 +602,9 @@ class StellarWallet extends Bip39Wallet { int fee = 0; int height = 0; - final tx = - await stellarSdk.transactions.transaction(caor.transactionHash!); + final tx = await (await stellarSdk) + .transactions + .transaction(caor.transactionHash!); if (tx.hash.isNotEmpty) { fee = tx.feeCharged!; height = tx.ledger; From 6b6e2097127f725445ef011eb784411f2de6ad99 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 3 May 2024 19:24:38 -0500 Subject: [PATCH 30/42] revert to official package with tor support merged --- pubspec.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index fb5a9f31c..86531ddad 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -156,10 +156,7 @@ dependencies: desktop_drop: ^0.4.1 nanodart: ^2.0.0 basic_utils: ^5.5.4 - stellar_flutter_sdk: # ^1.5.3 - git: # TODO [prio=low]: Revert to official package once Tor support is merged upstream. - url: https://github.com/cypherstack/stellar_flutter_sdk.git - ref: eca1d730e952cf6a6d64502f977cfc03876b75d4 # tor-backport branch (based on 1.5.3). + stellar_flutter_sdk: ^1.7.8 bip340: ^0.2.0 # tezart: ^2.0.5 tezart: From 0221841ee3d8769ef83a1462346d293cb6247efa Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 3 May 2024 19:56:27 -0500 Subject: [PATCH 31/42] listen to Tor status changes and update node accordingly --- lib/wallets/wallet/impl/monero_wallet.dart | 79 ++++++++++++++++++--- lib/wallets/wallet/impl/wownero_wallet.dart | 79 ++++++++++++++++++--- 2 files changed, 138 insertions(+), 20 deletions(-) diff --git a/lib/wallets/wallet/impl/monero_wallet.dart b/lib/wallets/wallet/impl/monero_wallet.dart index ce81d1552..9b83b150b 100644 --- a/lib/wallets/wallet/impl/monero_wallet.dart +++ b/lib/wallets/wallet/impl/monero_wallet.dart @@ -19,9 +19,13 @@ import 'package:flutter_libmonero/core/wallet_creation_service.dart'; import 'package:flutter_libmonero/monero/monero.dart' as xmr_dart; import 'package:flutter_libmonero/view_model/send/output.dart' as monero_output; import 'package:isar/isar.dart'; +import 'package:mutex/mutex.dart'; import 'package:stackwallet/db/hive/db.dart'; import 'package:stackwallet/models/isar/models/blockchain_data/address.dart'; import 'package:stackwallet/models/isar/models/blockchain_data/transaction.dart'; +import 'package:stackwallet/services/event_bus/events/global/tor_connection_status_changed_event.dart'; +import 'package:stackwallet/services/event_bus/events/global/tor_status_changed_event.dart'; +import 'package:stackwallet/services/event_bus/global_event_bus.dart'; import 'package:stackwallet/services/tor_service.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; import 'package:stackwallet/utilities/enums/fee_rate_type_enum.dart'; @@ -35,7 +39,38 @@ import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cw_based_inte import 'package:tuple/tuple.dart'; class MoneroWallet extends CryptonoteWallet with CwBasedInterface { - MoneroWallet(CryptoCurrencyNetwork network) : super(Monero(network)); + MoneroWallet(CryptoCurrencyNetwork network) : super(Monero(network)) { + final bus = GlobalEventBus.instance; + + // Listen for tor status changes. + _torStatusListener = bus.on().listen( + (event) async { + switch (event.newStatus) { + case TorConnectionStatus.connecting: + if (!_torConnectingLock.isLocked) { + await _torConnectingLock.acquire(); + } + _requireMutex = true; + break; + + case TorConnectionStatus.connected: + case TorConnectionStatus.disconnected: + if (_torConnectingLock.isLocked) { + _torConnectingLock.release(); + } + _requireMutex = false; + break; + } + }, + ); + + // Listen for tor preference changes. + _torPreferenceListener = bus.on().listen( + (event) async { + await updateNode(); + }, + ); + } @override Address addressFor({required int index, int account = 0}) { @@ -159,15 +194,31 @@ class MoneroWallet extends CryptonoteWallet with CwBasedInterface { if (prefs.useTor) { proxy = TorService.sharedInstance.getProxyInfo(); } - await CwBasedInterface.cwWalletBase?.connectToNode( - node: Node( - uri: "$host:${node.port}", - type: WalletType.monero, - trusted: node.trusted ?? false, - ), - socksProxyAddress: - proxy == null ? null : "${proxy.host.address}:${proxy.port}", - ); + if (_requireMutex) { + await _torConnectingLock.protect(() async { + await CwBasedInterface.cwWalletBase?.connectToNode( + node: Node( + uri: "$host:${node.port}", + type: WalletType.monero, + trusted: node.trusted ?? false, + ), + socksProxyAddress: + proxy == null ? null : "${proxy.host.address}:${proxy.port}", + ); + }); + } else { + await CwBasedInterface.cwWalletBase?.connectToNode( + node: Node( + uri: "$host:${node.port}", + type: WalletType.monero, + trusted: node.trusted ?? false, + ), + socksProxyAddress: + proxy == null ? null : "${proxy.host.address}:${proxy.port}", + ); + } + + return; } @override @@ -655,4 +706,12 @@ class MoneroWallet extends CryptonoteWallet with CwBasedInterface { return info.cachedBalance.total; } } + + // ============== Private ==================================================== + + StreamSubscription? _torStatusListener; + StreamSubscription? _torPreferenceListener; + + final Mutex _torConnectingLock = Mutex(); + bool _requireMutex = false; } diff --git a/lib/wallets/wallet/impl/wownero_wallet.dart b/lib/wallets/wallet/impl/wownero_wallet.dart index 5c9e481a2..51c9c159c 100644 --- a/lib/wallets/wallet/impl/wownero_wallet.dart +++ b/lib/wallets/wallet/impl/wownero_wallet.dart @@ -20,9 +20,13 @@ import 'package:flutter_libmonero/view_model/send/output.dart' as wownero_output; import 'package:flutter_libmonero/wownero/wownero.dart' as wow_dart; import 'package:isar/isar.dart'; +import 'package:mutex/mutex.dart'; import 'package:stackwallet/db/hive/db.dart'; import 'package:stackwallet/models/isar/models/blockchain_data/address.dart'; import 'package:stackwallet/models/isar/models/blockchain_data/transaction.dart'; +import 'package:stackwallet/services/event_bus/events/global/tor_connection_status_changed_event.dart'; +import 'package:stackwallet/services/event_bus/events/global/tor_status_changed_event.dart'; +import 'package:stackwallet/services/event_bus/global_event_bus.dart'; import 'package:stackwallet/services/tor_service.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; import 'package:stackwallet/utilities/enums/fee_rate_type_enum.dart'; @@ -36,7 +40,38 @@ import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cw_based_inte import 'package:tuple/tuple.dart'; class WowneroWallet extends CryptonoteWallet with CwBasedInterface { - WowneroWallet(CryptoCurrencyNetwork network) : super(Wownero(network)); + WowneroWallet(CryptoCurrencyNetwork network) : super(Wownero(network)) { + final bus = GlobalEventBus.instance; + + // Listen for tor status changes. + _torStatusListener = bus.on().listen( + (event) async { + switch (event.newStatus) { + case TorConnectionStatus.connecting: + if (!_torConnectingLock.isLocked) { + await _torConnectingLock.acquire(); + } + _requireMutex = true; + break; + + case TorConnectionStatus.connected: + case TorConnectionStatus.disconnected: + if (_torConnectingLock.isLocked) { + _torConnectingLock.release(); + } + _requireMutex = false; + break; + } + }, + ); + + // Listen for tor preference changes. + _torPreferenceListener = bus.on().listen( + (event) async { + await updateNode(); + }, + ); + } @override Address addressFor({required int index, int account = 0}) { @@ -148,15 +183,31 @@ class WowneroWallet extends CryptonoteWallet with CwBasedInterface { if (prefs.useTor) { proxy = TorService.sharedInstance.getProxyInfo(); } - await CwBasedInterface.cwWalletBase?.connectToNode( - node: Node( - uri: "$host:${node.port}", - type: WalletType.wownero, - trusted: node.trusted ?? false, - ), - socksProxyAddress: - proxy == null ? null : "${proxy.host.address}:${proxy.port}", - ); + if (_requireMutex) { + await _torConnectingLock.protect(() async { + await CwBasedInterface.cwWalletBase?.connectToNode( + node: Node( + uri: "$host:${node.port}", + type: WalletType.wownero, + trusted: node.trusted ?? false, + ), + socksProxyAddress: + proxy == null ? null : "${proxy.host.address}:${proxy.port}", + ); + }); + } else { + await CwBasedInterface.cwWalletBase?.connectToNode( + node: Node( + uri: "$host:${node.port}", + type: WalletType.wownero, + trusted: node.trusted ?? false, + ), + socksProxyAddress: + proxy == null ? null : "${proxy.host.address}:${proxy.port}", + ); + } + + return; } @override @@ -703,4 +754,12 @@ class WowneroWallet extends CryptonoteWallet with CwBasedInterface { return info.cachedBalance.total; } } + + // ============== Private ==================================================== + + StreamSubscription? _torStatusListener; + StreamSubscription? _torPreferenceListener; + + final Mutex _torConnectingLock = Mutex(); + bool _requireMutex = false; } From 6883f3d0931e5019d999c76f7c112c07d6ccab17 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 3 May 2024 19:56:39 -0500 Subject: [PATCH 32/42] warnings and formatting --- lib/wallets/wallet/impl/monero_wallet.dart | 16 ++++++++-------- lib/wallets/wallet/impl/wownero_wallet.dart | 18 +++++++++--------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/wallets/wallet/impl/monero_wallet.dart b/lib/wallets/wallet/impl/monero_wallet.dart index 9b83b150b..3f02954d8 100644 --- a/lib/wallets/wallet/impl/monero_wallet.dart +++ b/lib/wallets/wallet/impl/monero_wallet.dart @@ -74,7 +74,7 @@ class MoneroWallet extends CryptonoteWallet with CwBasedInterface { @override Address addressFor({required int index, int account = 0}) { - String address = (CwBasedInterface.cwWalletBase as MoneroWalletBase) + final String address = (CwBasedInterface.cwWalletBase as MoneroWalletBase) .getTransactionAddress(account, index); final newReceivingAddress = Address( @@ -438,7 +438,7 @@ class MoneroWallet extends CryptonoteWallet with CwBasedInterface { // clear blockchain info await mainDB.deleteWalletBlockchainData(walletId); - var restoreHeight = + final restoreHeight = CwBasedInterface.cwWalletBase?.walletInfo.restoreHeight; highestPercentCached = 0; await CwBasedInterface.cwWalletBase?.rescan(height: restoreHeight ?? 0); @@ -467,7 +467,7 @@ class MoneroWallet extends CryptonoteWallet with CwBasedInterface { .createMoneroWalletService(DB.instance.moneroWalletInfoBox); WalletInfo walletInfo; WalletCredentials credentials; - String name = walletId; + final String name = walletId; final dirPath = await pathForWalletDir(name: name, type: WalletType.monero); final path = await pathForWallet(name: name, type: WalletType.monero); @@ -569,12 +569,12 @@ class MoneroWallet extends CryptonoteWallet with CwBasedInterface { isSendAll = true; } - List outputs = []; + final List outputs = []; for (final recipient in txData.recipients!) { final output = monero_output.Output(CwBasedInterface.cwWalletBase!); output.address = recipient.address; output.sendAll = isSendAll; - String amountToSend = recipient.amount.decimal.toString(); + final String amountToSend = recipient.amount.decimal.toString(); output.setCryptoAmount(amountToSend); outputs.add(output); } @@ -594,7 +594,7 @@ class MoneroWallet extends CryptonoteWallet with CwBasedInterface { level: LogLevel.Warning); } - PendingMoneroTransaction pendingMoneroTransaction = + final PendingMoneroTransaction pendingMoneroTransaction = await (awaitPendingTransaction!) as PendingMoneroTransaction; final realFee = Amount.fromDecimal( Decimal.parse(pendingMoneroTransaction.feeFormatted), @@ -676,7 +676,7 @@ class MoneroWallet extends CryptonoteWallet with CwBasedInterface { ?.entries; if (balanceEntries != null) { int bal = 0; - for (var element in balanceEntries) { + for (final element in balanceEntries) { bal = bal + element.value.fullBalance; } return Amount( @@ -689,7 +689,7 @@ class MoneroWallet extends CryptonoteWallet with CwBasedInterface { .transactionHistory! .transactions; int transactionBalance = 0; - for (var tx in transactions!.entries) { + for (final tx in transactions!.entries) { if (tx.value.direction == TransactionDirection.incoming) { transactionBalance += tx.value.amount!; } else { diff --git a/lib/wallets/wallet/impl/wownero_wallet.dart b/lib/wallets/wallet/impl/wownero_wallet.dart index 51c9c159c..b9ec28b8d 100644 --- a/lib/wallets/wallet/impl/wownero_wallet.dart +++ b/lib/wallets/wallet/impl/wownero_wallet.dart @@ -75,7 +75,7 @@ class WowneroWallet extends CryptonoteWallet with CwBasedInterface { @override Address addressFor({required int index, int account = 0}) { - String address = (CwBasedInterface.cwWalletBase as WowneroWalletBase) + final String address = (CwBasedInterface.cwWalletBase as WowneroWalletBase) .getTransactionAddress(account, index); final newReceivingAddress = Address( @@ -257,7 +257,7 @@ class WowneroWallet extends CryptonoteWallet with CwBasedInterface { final List> txnsData = []; if (transactions != null) { - for (var tx in transactions.entries) { + for (final tx in transactions.entries) { Address? address; TransactionType type; if (tx.value.direction == TransactionDirection.incoming) { @@ -479,7 +479,7 @@ class WowneroWallet extends CryptonoteWallet with CwBasedInterface { // clear blockchain info await mainDB.deleteWalletBlockchainData(walletId); - var restoreHeight = + final restoreHeight = CwBasedInterface.cwWalletBase?.walletInfo.restoreHeight; highestPercentCached = 0; await CwBasedInterface.cwWalletBase?.rescan(height: restoreHeight ?? 0); @@ -515,7 +515,7 @@ class WowneroWallet extends CryptonoteWallet with CwBasedInterface { .createWowneroWalletService(DB.instance.moneroWalletInfoBox); WalletInfo walletInfo; WalletCredentials credentials; - String name = walletId; + final String name = walletId; final dirPath = await pathForWalletDir(name: name, type: WalletType.wownero); final path = await pathForWallet(name: name, type: WalletType.wownero); @@ -617,13 +617,13 @@ class WowneroWallet extends CryptonoteWallet with CwBasedInterface { isSendAll = true; } - List outputs = []; + final List outputs = []; for (final recipient in txData.recipients!) { final output = wownero_output.Output(CwBasedInterface.cwWalletBase!); output.address = recipient.address; output.sendAll = isSendAll; - String amountToSend = recipient.amount.decimal.toString(); + final String amountToSend = recipient.amount.decimal.toString(); output.setCryptoAmount(amountToSend); outputs.add(output); } @@ -643,7 +643,7 @@ class WowneroWallet extends CryptonoteWallet with CwBasedInterface { level: LogLevel.Warning); } - PendingWowneroTransaction pendingWowneroTransaction = + final PendingWowneroTransaction pendingWowneroTransaction = await (awaitPendingTransaction!) as PendingWowneroTransaction; final realFee = Amount.fromDecimal( Decimal.parse(pendingWowneroTransaction.feeFormatted), @@ -726,7 +726,7 @@ class WowneroWallet extends CryptonoteWallet with CwBasedInterface { ?.entries; if (balanceEntries != null) { int bal = 0; - for (var element in balanceEntries) { + for (final element in balanceEntries) { bal = bal + element.value.fullBalance; } return Amount( @@ -737,7 +737,7 @@ class WowneroWallet extends CryptonoteWallet with CwBasedInterface { final transactions = CwBasedInterface.cwWalletBase!.transactionHistory!.transactions; int transactionBalance = 0; - for (var tx in transactions!.entries) { + for (final tx in transactions!.entries) { if (tx.value.direction == TransactionDirection.incoming) { transactionBalance += tx.value.amount!; } else { From e472f9d6a9e4b864d1560dcd6debd2354cc164aa Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 3 May 2024 20:04:31 -0500 Subject: [PATCH 33/42] update tezart's dio dep --- pubspec.lock | 23 +++++++++++------------ pubspec.yaml | 2 +- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index e81aae914..4baa4c14c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -495,10 +495,10 @@ packages: dependency: transitive description: name: dio - sha256: "7d328c4d898a61efc3cd93655a0955858e29a0aa647f0f9e02d59b3bb275e2e8" + sha256: "11e40df547d418cc0c4900a9318b26304e665da6fa4755399a9ff9efd09034b5" url: "https://pub.dev" source: hosted - version: "4.0.6" + version: "5.4.3+1" dropdown_button2: dependency: "direct main" description: @@ -1414,10 +1414,10 @@ packages: dependency: transitive description: name: pretty_dio_logger - sha256: "948f7eeb36e7aa0760b51c1a8e3331d4b21e36fabd39efca81f585ed93893544" + sha256: "00b80053063935cf9a6190da344c5373b9d0e92da4c944c878ff2fbef0ef6dc2" url: "https://pub.dev" source: hosted - version: "1.2.0-beta-1" + version: "1.3.1" process: dependency: transitive description: @@ -1661,12 +1661,11 @@ packages: stellar_flutter_sdk: dependency: "direct main" description: - path: "." - ref: eca1d730e952cf6a6d64502f977cfc03876b75d4 - resolved-ref: eca1d730e952cf6a6d64502f977cfc03876b75d4 - url: "https://github.com/cypherstack/stellar_flutter_sdk.git" - source: git - version: "1.5.3" + name: stellar_flutter_sdk + sha256: "574e8f40a1a1a9b18a735272196c8d3c8168a669efc8460a4d5d6f45151e8dce" + url: "https://pub.dev" + source: hosted + version: "1.7.8" stream_channel: dependency: "direct main" description: @@ -1743,8 +1742,8 @@ packages: dependency: "direct main" description: path: "." - ref: "1fb2669e2b530367a449217e952f220d5e667043" - resolved-ref: "1fb2669e2b530367a449217e952f220d5e667043" + ref: f31f8f857665d85338824ae171aba4c629c3ba6f + resolved-ref: f31f8f857665d85338824ae171aba4c629c3ba6f url: "https://github.com/cypherstack/tezart.git" source: git version: "2.0.5" diff --git a/pubspec.yaml b/pubspec.yaml index 86531ddad..5985ffdf0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -162,7 +162,7 @@ dependencies: tezart: git: url: https://github.com/cypherstack/tezart.git - ref: 1fb2669e2b530367a449217e952f220d5e667043 + ref: f31f8f857665d85338824ae171aba4c629c3ba6f socks5_proxy: ^1.0.3+dev.3 convert: ^3.1.1 flutter_hooks: ^0.20.3 From 1e946a76b9de126faa6828e49cb39698ad086ef6 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 3 May 2024 20:18:47 -0500 Subject: [PATCH 34/42] bump build number --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 5985ffdf0..6f613420c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: Stack Wallet # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 2.0.0+219 +version: 2.0.0+220 environment: sdk: ">=3.3.3 <4.0.0" From a3950c54781fb4b8956167ceb5cf504b3ff5bc4e Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 3 May 2024 20:31:04 -0500 Subject: [PATCH 35/42] tezart dio fix --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 6f613420c..bfa794af0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -162,7 +162,7 @@ dependencies: tezart: git: url: https://github.com/cypherstack/tezart.git - ref: f31f8f857665d85338824ae171aba4c629c3ba6f + ref: 13fa937ea9a9fc34caf047e068df9535f65c27ad socks5_proxy: ^1.0.3+dev.3 convert: ^3.1.1 flutter_hooks: ^0.20.3 From 85fc443f2ce3d2bfe8887fcbf0c76f6bc2b1208f Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 3 May 2024 20:08:29 -0600 Subject: [PATCH 36/42] tagged libsecret version --- scripts/linux/build_secure_storage_deps.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/linux/build_secure_storage_deps.sh b/scripts/linux/build_secure_storage_deps.sh index e63e38665..aff3097dc 100755 --- a/scripts/linux/build_secure_storage_deps.sh +++ b/scripts/linux/build_secure_storage_deps.sh @@ -1,6 +1,7 @@ #!/bin/bash LINUX_DIRECTORY=$(pwd) JSONCPP_TAG=1.7.4 +LIBSECRET_TAG=0.21.4 mkdir -p build # Build JsonCPP @@ -24,8 +25,9 @@ cd "$LINUX_DIRECTORY" || exit 1 #pip3 install --user meson markdown tomli --upgrade # pip3 install --user gi-docgen cd build || exit 1 -git -C libsecret pull || git clone https://gitlab.gnome.org/GNOME/libsecret.git libsecret +git -C libsecret pull origin $LIBSECRET_TAG || git clone https://gitlab.gnome.org/GNOME/libsecret.git libsecret cd libsecret || exit 1 +git checkout $LIBSECRET_TAG if ! [ -x "$(command -v meson)" ]; then echo 'Error: meson is not installed.' >&2 exit 1 From 5cf153b9a14a705b7b969141ab44399ad370bc66 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 3 May 2024 23:00:03 -0500 Subject: [PATCH 37/42] brew sodium->libsodium --- docs/building.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/building.md b/docs/building.md index 3154526df..33509a8cd 100644 --- a/docs/building.md +++ b/docs/building.md @@ -182,7 +182,7 @@ Download and install [Homebrew](https://brew.sh/). The following command can in After installing Homebrew, install the following packages: ``` -brew install autoconf automake boost berkeley-db ca-certificates cbindgen cmake cmake cocoapods curl git libssh2 make openssl@1.1 openssl@3 perl pkg-config rustup-init sodium unbound unzip xz zmq +brew install autoconf automake boost berkeley-db ca-certificates cbindgen cmake cocoapods curl git libssh2 libsodium make openssl@1.1 openssl@3 perl pkg-config rustup-init unbound unzip xz zmq ``` The following brew formula *may* be needed: From ab234b72e697fcbd500290f4f6f9fa4f124538c9 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 3 May 2024 23:02:11 -0500 Subject: [PATCH 38/42] flutter 3.19 beta->3.19.5 --- docs/building.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/building.md b/docs/building.md index 33509a8cd..dc65fe6cc 100644 --- a/docs/building.md +++ b/docs/building.md @@ -12,7 +12,7 @@ Here you will find instructions on how to install the necessary tools for buildi The following instructions are for building and running on a Linux host. Alternatively, see the [Mac](#mac-host) and/or [Windows](#windows-host) section. This entire section (except for the Android Studio section) needs to be completed in WSL if building on a Windows host. ### Flutter -Install Flutter 3.19 beta (3.19.0-0.1.pre) by following these instructions: https://docs.flutter.dev/get-started/install/linux/desktop?tab=download#install-the-flutter-sdk. You can also clone https://github.com/flutter/flutter, check out the `3.19.0-0.1.pre` tag, and add its `flutter/bin` folder to your PATH. Run `flutter doctor` in a terminal to confirm its installation. +Install Flutter 3.19.5 by following these instructions: https://docs.flutter.dev/get-started/install/linux/desktop?tab=download#install-the-flutter-sdk. You can also clone https://github.com/flutter/flutter, check out the `3.19.5` tag, and add its `flutter/bin` folder to your PATH. Run `flutter doctor` in a terminal to confirm its installation. ### Android Studio Install Android Studio. Follow instructions here [https://developer.android.com/studio/install#linux](https://developer.android.com/studio/install#linux) or install via snap: From dd935fec9b869950cca1d41e2fd4fd9aa5cc1fcb Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Mon, 6 May 2024 10:13:37 +0200 Subject: [PATCH 39/42] remove android symlinks --- .gitignore | 8 +++++++- android/app/src/main/jniLibs/arm64-v8a/.gitkeep | 0 .../main/jniLibs/arm64-v8a/libmonero_libwallet2_api_c.so | 1 - android/app/src/main/jniLibs/armeabi-v7a/.gitkeep | 0 .../jniLibs/armeabi-v7a/libmonero_libwallet2_api_c.so | 1 - android/app/src/main/jniLibs/x86_64/.gitkeep | 0 .../src/main/jniLibs/x86_64/libmonero_libwallet2_api_c.so | 1 - 7 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 android/app/src/main/jniLibs/arm64-v8a/.gitkeep delete mode 120000 android/app/src/main/jniLibs/arm64-v8a/libmonero_libwallet2_api_c.so create mode 100644 android/app/src/main/jniLibs/armeabi-v7a/.gitkeep delete mode 120000 android/app/src/main/jniLibs/armeabi-v7a/libmonero_libwallet2_api_c.so create mode 100644 android/app/src/main/jniLibs/x86_64/.gitkeep delete mode 120000 android/app/src/main/jniLibs/x86_64/libmonero_libwallet2_api_c.so diff --git a/.gitignore b/.gitignore index 144745e55..8377786de 100644 --- a/.gitignore +++ b/.gitignore @@ -61,4 +61,10 @@ secp256k1.dll /libisar.so # FVM Version Cache -.fvm/ \ No newline at end of file +.fvm/ +android/app/src/main/jniLibs/arm64-v8a/libwownero_wallet2_api_c.so +android/app/src/main/jniLibs/arm64-v8a/libmonero_wallet2_api_c.so +android/app/src/main/jniLibs/armeabi-v7a/libmonero_wallet2_api_c.so +android/app/src/main/jniLibs/armeabi-v7a/libwownero_wallet2_api_c.so +android/app/src/main/jniLibs/x86_64/libmonero_wallet2_api_c.so +android/app/src/main/jniLibs/x86_64/libwownero_wallet2_api_c.so diff --git a/android/app/src/main/jniLibs/arm64-v8a/.gitkeep b/android/app/src/main/jniLibs/arm64-v8a/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/android/app/src/main/jniLibs/arm64-v8a/libmonero_libwallet2_api_c.so b/android/app/src/main/jniLibs/arm64-v8a/libmonero_libwallet2_api_c.so deleted file mode 120000 index 49289969b..000000000 --- a/android/app/src/main/jniLibs/arm64-v8a/libmonero_libwallet2_api_c.so +++ /dev/null @@ -1 +0,0 @@ -../../../../../../crypto_plugins/flutter_libmonero/scripts/monero_c/release/monero/aarch64-linux-android_libwallet2_api_c.so \ No newline at end of file diff --git a/android/app/src/main/jniLibs/armeabi-v7a/.gitkeep b/android/app/src/main/jniLibs/armeabi-v7a/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/android/app/src/main/jniLibs/armeabi-v7a/libmonero_libwallet2_api_c.so b/android/app/src/main/jniLibs/armeabi-v7a/libmonero_libwallet2_api_c.so deleted file mode 120000 index a69eec096..000000000 --- a/android/app/src/main/jniLibs/armeabi-v7a/libmonero_libwallet2_api_c.so +++ /dev/null @@ -1 +0,0 @@ -../../../../../../crypto_plugins/flutter_libmonero/scripts/monero_c/release/monero/arm-linux-androideabi_libwallet2_api_c.so \ No newline at end of file diff --git a/android/app/src/main/jniLibs/x86_64/.gitkeep b/android/app/src/main/jniLibs/x86_64/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/android/app/src/main/jniLibs/x86_64/libmonero_libwallet2_api_c.so b/android/app/src/main/jniLibs/x86_64/libmonero_libwallet2_api_c.so deleted file mode 120000 index 5c18d1cee..000000000 --- a/android/app/src/main/jniLibs/x86_64/libmonero_libwallet2_api_c.so +++ /dev/null @@ -1 +0,0 @@ -../../../../../../crypto_plugins/flutter_libmonero/scripts/monero_c/release/monero/x86_64-linux-android_libwallet2_api_c.so \ No newline at end of file From 143a1997c956925b1d69f871287e546b67c2d93c Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Tue, 7 May 2024 16:00:30 +0200 Subject: [PATCH 40/42] update build scripts for macos --- .gitignore | 2 ++ macos/monero_libwallet2_api_c.dylib | 1 - macos/wownero_libwallet2_api_c.dylib | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 120000 macos/monero_libwallet2_api_c.dylib delete mode 120000 macos/wownero_libwallet2_api_c.dylib diff --git a/.gitignore b/.gitignore index 8377786de..90ad3f2d6 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,5 @@ android/app/src/main/jniLibs/armeabi-v7a/libmonero_wallet2_api_c.so android/app/src/main/jniLibs/armeabi-v7a/libwownero_wallet2_api_c.so android/app/src/main/jniLibs/x86_64/libmonero_wallet2_api_c.so android/app/src/main/jniLibs/x86_64/libwownero_wallet2_api_c.so +macos/monero_wallet2_api_c.dylib +macos/wownero_wallet2_api_c.dylib diff --git a/macos/monero_libwallet2_api_c.dylib b/macos/monero_libwallet2_api_c.dylib deleted file mode 120000 index da01b591e..000000000 --- a/macos/monero_libwallet2_api_c.dylib +++ /dev/null @@ -1 +0,0 @@ -../crypto_plugins/flutter_libmonero/scripts/monero_c/release/monero/host-apple-darwin_libwallet2_api_c.dylib \ No newline at end of file diff --git a/macos/wownero_libwallet2_api_c.dylib b/macos/wownero_libwallet2_api_c.dylib deleted file mode 120000 index f0a776dc1..000000000 --- a/macos/wownero_libwallet2_api_c.dylib +++ /dev/null @@ -1 +0,0 @@ -../crypto_plugins/flutter_libmonero/scripts/monero_c/release/wownero/host-apple-darwin_libwallet2_api_c.dylib \ No newline at end of file From e33712f3db98cad526c0f59bc05d417ef0ae4194 Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Tue, 7 May 2024 16:03:10 +0200 Subject: [PATCH 41/42] other things from review --- .fvmrc | 3 --- .vscode/settings.json | 1 - 2 files changed, 4 deletions(-) delete mode 100644 .fvmrc diff --git a/.fvmrc b/.fvmrc deleted file mode 100644 index 5fb0c142c..000000000 --- a/.fvmrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "flutter": "3.16.0" -} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index a86b03d61..eba0d6cd7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,3 @@ { "dart.lineLength": 80, - "dart.flutterSdkPath": ".fvm/versions/3.16.0" } \ No newline at end of file From 039a723af3f2b0362b260e28e3ba0ea29b76a6ed Mon Sep 17 00:00:00 2001 From: sneurlax Date: Tue, 7 May 2024 11:26:51 -0500 Subject: [PATCH 42/42] flutter_libmonero updates --- crypto_plugins/flutter_libmonero | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto_plugins/flutter_libmonero b/crypto_plugins/flutter_libmonero index e06c5b92a..88a5d9f91 160000 --- a/crypto_plugins/flutter_libmonero +++ b/crypto_plugins/flutter_libmonero @@ -1 +1 @@ -Subproject commit e06c5b92a2a98b78d5506e6472a0fac1fbba9a10 +Subproject commit 88a5d9f91a27f87a9c44238f1ddfaa619d2fc7b6