From 09a26661ffac53fa0acb68075995927e12906147 Mon Sep 17 00:00:00 2001 From: KewbitXMR Date: Thu, 19 Sep 2024 15:51:39 +0100 Subject: [PATCH] fdroid test --- ios/Flutter/Debug.xcconfig | 1 + ios/Flutter/Release.xcconfig | 1 + ios/Podfile | 44 +++++++++++++++++++++++++ lib/services/tor_service.dart | 24 +++++++------- linux/flutter/generated_plugins.cmake | 1 + macos/Flutter/Flutter-Debug.xcconfig | 1 + macos/Flutter/Flutter-Release.xcconfig | 1 + macos/Podfile | 43 ++++++++++++++++++++++++ metadata/org.kewbit.havenoPlus.yml | 23 +++++++++++++ pubspec.lock | 12 +++++-- pubspec.yaml | 3 +- windows/flutter/generated_plugins.cmake | 1 + 12 files changed, 140 insertions(+), 15 deletions(-) create mode 100755 ios/Podfile create mode 100755 macos/Podfile create mode 100644 metadata/org.kewbit.havenoPlus.yml diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index 592ceee..ec97fc6 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index 592ceee..c4855bf 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Podfile b/ios/Podfile new file mode 100755 index 0000000..d97f17e --- /dev/null +++ b/ios/Podfile @@ -0,0 +1,44 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '12.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/lib/services/tor_service.dart b/lib/services/tor_service.dart index 777c75c..172a895 100644 --- a/lib/services/tor_service.dart +++ b/lib/services/tor_service.dart @@ -20,7 +20,7 @@ class TorService { Future startService() async { try { - await _tor.startService("ControlPort 9051\nCookieAuthentication 0"); + //await _tor.startService("ControlPort 9051\nCookieAuthentication 0"); debugPrint("Tor service started"); _statusController.add("Tor service started."); } catch (e) { @@ -31,7 +31,7 @@ class TorService { Future stopService() async { try { - await _tor.stopService(); + //await _tor.stopService(); _statusController.add("Tor service stopped."); } catch (e) { _statusController.add("Failed to stop Tor: $e"); @@ -40,12 +40,12 @@ class TorService { Future initializeDaemonHiddenService({required String hostname, required String privateKey}) async { try { - final hiddenServiceInfo = await _tor.initializeHiddenService( - listenPort: 3201, - exposePort: 12134, - privateKey: privateKey, - ); - _statusController.add("Hidden service initialized: $hiddenServiceInfo"); + //final hiddenServiceInfo = await _tor.initializeHiddenService( + // listenPort: 3201, + // exposePort: 12134, + // privateKey: privateKey, + //); + //_statusController.add("Hidden service initialized: $hiddenServiceInfo"); } catch (e) { _statusController.add("Failed to initialize hidden service: $e"); } @@ -80,10 +80,10 @@ class TorService { void listenToTorServiceEvents() { - _torStatusSubscription = _tor.torServiceEvents.listen((event) { - _statusController.add("Tor event: $event"); - debugPrint(event); - }); + //_torStatusSubscription = _tor.torServiceEvents.listen((event) { + // _statusController.add("Tor event: $event"); + // debugPrint(event); + //}); } void dispose() { diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index f16b4c3..4aea231 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + tor ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/macos/Flutter/Flutter-Debug.xcconfig b/macos/Flutter/Flutter-Debug.xcconfig index c2efd0b..4b81f9b 100644 --- a/macos/Flutter/Flutter-Debug.xcconfig +++ b/macos/Flutter/Flutter-Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Flutter/Flutter-Release.xcconfig b/macos/Flutter/Flutter-Release.xcconfig index c2efd0b..5caa9d1 100644 --- a/macos/Flutter/Flutter-Release.xcconfig +++ b/macos/Flutter/Flutter-Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Podfile b/macos/Podfile new file mode 100755 index 0000000..c795730 --- /dev/null +++ b/macos/Podfile @@ -0,0 +1,43 @@ +platform :osx, '10.14' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/metadata/org.kewbit.havenoPlus.yml b/metadata/org.kewbit.havenoPlus.yml new file mode 100644 index 0000000..cf49677 --- /dev/null +++ b/metadata/org.kewbit.havenoPlus.yml @@ -0,0 +1,23 @@ +Categories: Internet +License: GPL-3.0-or-later +SourceCode: https://github.com/KewbitXMR/haveno-plus +IssueTracker: https://github.com/KewbitXMR/haveno-plus/issues +Changelog: https://github.com/KewbitXMR/haveno-plus/releases +AutoName: Haveno +Summary: A decentralized exchange app for Monero +Description: |- + Haveno is a decentralized peer-to-peer exchange, allowing users to trade privately using Monero and other traditional currencies. + +RepoType: git +Repo: https://github.com/KewbitXMR/haveno-plus.git + +Builds: + - versionName: '0.0.1' + versionCode: 1 + commit: v0.0.1 + subdir: android + gradle: + - yes + +AutoUpdateMode: Version v%v +UpdateCheckMode: Tags diff --git a/pubspec.lock b/pubspec.lock index 9d2a945..f739acf 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -380,10 +380,10 @@ packages: dependency: "direct main" description: name: path_provider - sha256: c9e7d3a4cd1410877472158bee69963a4579f78b68c65a2b7d40d1a7a88bb161 + sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378 url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.4" path_provider_android: dependency: transitive description: @@ -549,6 +549,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.0" + tor: + dependency: "direct main" + description: + name: tor + sha256: eeed80e5c912a1806c2f81825c12e84f4dc5a0b50aebedea59e3a8ba53df3142 + url: "https://pub.dev" + source: hosted + version: "0.0.8" typed_data: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 51f523c..914bc28 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: haveno_flutter_app description: "A new Flutter project." publish_to: 'none' -version: 1.0.0+1 +version: 0.0.1+2 environment: sdk: '>=3.4.3 <4.0.0' @@ -34,6 +34,7 @@ dependencies: fixnum: ^1.1.0 intl: ^0.17.0 badges: ^3.1.2 + tor: ^0.0.8 dev_dependencies: flutter_test: diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 88b22e5..5dd5c3d 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + tor ) set(PLUGIN_BUNDLED_LIBRARIES)