feat: use better embedded Tor (#2453)

* feat: use better embedded Tor * update docs [skip ci] * fix: update torch properly add minimum os version for iOS * fix: use of invalid thread api on iOS * fix: disable use of lzma and zstd system libraries * fix: update torch_dart to work on linux

cyan committed Sep 5, 2025 at 16:07 UTC 2dc95b2bf0d778bf0760af56867224b216887413
42 files changed +293 -191
.github/workflows/pr_test_build_android.yml
+11
@@ -219,6 +219,17 @@ jobs:
219 popd
220 cp /opt/generic_cache/key.jks android/app
221
222 + - name: Fetch prebuilt Torch
223 + run: |
224 + set -x -e
225 + pushd scripts
226 + wget https://github.com/MrCyjaneK/torch_dart/releases/download/4f987d4-1-ge071fcf-1-gc282f09-1-g4c290aa-1-gabdf653/torch_dart-4f987d4-1-ge071fcf-1-gc282f09-1-g4c290aa-1-gabdf653.tar.gz -O torch_dart.tar.gz
227 + mkdir torch_dart
228 + pushd torch_dart
229 + tar -xzf ../torch_dart.tar.gz
230 + popd
231 + popd
232 +
233 - name: Execute Build and Setup Commands
234 run: |
235 pushd scripts/android
.github/workflows/pr_test_build_linux.yml
+11
@@ -203,6 +203,17 @@ jobs:
203 ln -sf "$MONEROC_CACHE_DIR_ROOT/_cache/wownero/contrib/depends/sources" "$PWD/wownero/contrib/depends/sources"
204 popd
205
206 + - name: Fetch prebuilt Torch
207 + run: |
208 + set -x -e
209 + pushd scripts
210 + wget https://github.com/MrCyjaneK/torch_dart/releases/download/4f987d4-1-ge071fcf-1-gc282f09-1-g4c290aa-1-gabdf653/torch_dart-4f987d4-1-ge071fcf-1-gc282f09-1-g4c290aa-1-gabdf653.tar.gz -O torch_dart.tar.gz
211 + mkdir torch_dart
212 + pushd torch_dart
213 + tar -xzf ../torch_dart.tar.gz
214 + popd
215 + popd
216 +
217 - name: Execute Build and Setup Commands
218 run: |
219 pushd scripts/linux
.gitignore
+2
@@ -228,3 +228,5 @@ flatpak-build/
228 **/linux/flutter/generated_plugin_registrant.cc
229 **/linux/flutter/generated_plugin_registrant.h
230 **/linux/flutter/generated_plugins.cmake
231 +
232 +scripts/torch_dart/
\ No newline at end of file
cw_bitcoin/pubspec.lock
+5 -7
@@ -1061,15 +1061,13 @@ packages:
1061 url: "https://pub.dev"
1062 source: hosted
1063 version: "1.0.2"
1064 - tor_binary:
1064 + torch_dart:
1065 dependency: transitive
1066 description:
1067 - path: "."
1068 - ref: cb811c610871a9517d47134b87c2f590c15c96c5
1069 - resolved-ref: cb811c610871a9517d47134b87c2f590c15c96c5
1070 - url: "https://github.com/MrCyjaneK/flutter-tor_binary"
1071 - source: git
1072 - version: "4.7.14"
1067 + path: "../scripts/torch_dart"
1068 + relative: true
1069 + source: path
1070 + version: "0.0.1"
1071 tuple:
1072 dependency: transitive
1073 description:
cw_core/lib/node.dart
+3 -3
@@ -274,14 +274,14 @@ class Node extends HiveObject with Keyable {
274 }
275
276 Future<bool> requestNodeWithProxy() async {
277 - if (!isValidProxyAddress && !CakeTor.instance.enabled) {
277 + if (!isValidProxyAddress && !CakeTor.instance!.enabled) {
278 return false;
279 }
280
281 String? proxy = socksProxyAddress;
282
283 - if ((proxy?.isEmpty ?? true) && CakeTor.instance.enabled) {
284 - proxy = "${InternetAddress.loopbackIPv4.address}:${CakeTor.instance.port}";
283 + if ((proxy?.isEmpty ?? true) && CakeTor.instance!.enabled) {
284 + proxy = "${InternetAddress.loopbackIPv4.address}:${CakeTor.instance!.port}";
285 }
286 printV("proxy: $proxy");
287 if (proxy == null) {
cw_core/lib/utils/proxy_socket/abstract.dart
+2 -2
@@ -17,10 +17,10 @@ class ProxyAddress {
17
18 abstract class ProxySocket {
19 static Future<ProxySocket> connect(bool sslEnabled, ProxyAddress address, {Duration? connectionTimeout}) async {
20 - if (CakeTor.instance.started) {
20 + if (CakeTor.instance!.started) {
21 var socksSocket = await SOCKSSocket.create(
22 proxyHost: InternetAddress.loopbackIPv4.address,
23 - proxyPort: CakeTor.instance.port,
23 + proxyPort: CakeTor.instance!.port,
24 sslEnabled: sslEnabled,
25 );
26 await socksSocket.connect();
cw_core/lib/utils/proxy_wrapper.dart
+11 -13
@@ -5,8 +5,6 @@ import 'dart:typed_data';
5 import 'package:cw_core/utils/proxy_logger/abstract.dart';
6 import 'package:cw_core/utils/proxy_socket/abstract.dart';
7 import 'package:cw_core/utils/tor/abstract.dart';
8 -import 'package:cw_core/utils/tor/android.dart';
9 -import 'package:cw_core/utils/tor/disabled.dart';
8 import 'package:http/http.dart';
9 import 'package:socks5_proxy/socks_client.dart';
10 import 'package:http/io_client.dart' as ioc;
@@ -37,7 +35,7 @@ class ProxyWrapper {
35 }
36
37 RequestNetwork requestNetwork() {
40 - return CakeTor.instance.started ? RequestNetwork.tor : RequestNetwork.clearnet;
38 + return CakeTor.instance!.started ? RequestNetwork.tor : RequestNetwork.clearnet;
39 }
40
41 ioc.IOClient getHttpIOClient({int? portOverride, bool internal = false}) {
@@ -56,7 +54,7 @@ class ProxyWrapper {
54 return ioc.IOClient(httpClient);
55 }
56
59 - int getPort() => CakeTor.instance.port;
57 + int getPort() => CakeTor.instance!.port;
58
59 @Deprecated('Use ProxyWrapper().get/post/put methods instead, and provide proper clearnet and onion uri.')
60 HttpClient getHttpClient({int? portOverride, bool internal = false}) {
@@ -70,13 +68,13 @@ class ProxyWrapper {
68 error: null
69 );
70 }
73 - if (CakeTor.instance.started) {
71 + if (CakeTor.instance!.started) {
72 // Assign connection factory.
73 final client = HttpClient();
74 SocksTCPClient.assignToHttpClient(client, [
75 ProxySettings(
76 InternetAddress.loopbackIPv4,
79 - CakeTor.instance.port,
77 + CakeTor.instance!.port,
78 password: null,
79 ),
80 ]);
@@ -154,9 +152,9 @@ class ProxyWrapper {
152 Uri? onionUri,
153 }) async {
154 ioc.IOClient? torClient;
157 - bool torEnabled = CakeTor.instance.started;
155 + bool torEnabled = CakeTor.instance!.started;
156
159 - if (CakeTor.instance.started) {
157 + if (CakeTor.instance!.started) {
158 torEnabled = true;
159 } else {
160 torEnabled = false;
@@ -238,7 +236,7 @@ class ProxyWrapper {
236 ioc.IOClient clearnetClient = ioc.IOClient(cleatnetHttpClient);
237
238
241 - bool torEnabled = CakeTor.instance.started;
239 + bool torEnabled = CakeTor.instance!.started;
240
241 if (torEnabled) {
242 try {
@@ -309,7 +307,7 @@ class ProxyWrapper {
307 String? body,
308 }) async {
309 ioc.IOClient? torClient;
312 - bool torEnabled = CakeTor.instance.started;
310 + bool torEnabled = CakeTor.instance!.started;
311
312 if (torEnabled) {
313 try {
@@ -375,9 +373,9 @@ class ProxyWrapper {
373 Uri? onionUri,
374 }) async {
375 ioc.IOClient? torClient;
378 - bool torEnabled = CakeTor.instance.started;
376 + bool torEnabled = CakeTor.instance!.started;
377
380 - if (CakeTor.instance.started) {
378 + if (CakeTor.instance!.started) {
379 torEnabled = true;
380 } else {
381 torEnabled = false;
@@ -443,5 +441,5 @@ class ProxyWrapper {
441
442
443 class CakeTor {
446 - static final CakeTorInstance instance = CakeTorInstance.getInstance();
444 + static CakeTorInstance? instance;
445 }
cw_core/lib/utils/tor/abstract.dart
+10 -5
@@ -1,9 +1,9 @@
1 import 'dart:io';
2
3 import 'package:cw_core/utils/print_verbose.dart';
4 -import 'package:cw_core/utils/tor/android.dart';
4 import 'package:cw_core/utils/tor/disabled.dart';
5 import 'package:cw_core/utils/tor/socks.dart';
6 +import 'package:cw_core/utils/tor/torch.dart';
7
8 abstract class CakeTorInstance {
9 bool get started;
@@ -17,10 +17,7 @@ abstract class CakeTorInstance {
17 Future<void> start();
18 Future<void> stop();
19
20 - static CakeTorInstance getInstance() {
21 - if (Platform.isAndroid) {
22 - return CakeTorAndroid();
23 - }
20 + static Future<CakeTorInstance> getInstance() async {
21 if (Platform.isLinux) {
22 try {
23 String? socksServer;
@@ -46,6 +43,14 @@ abstract class CakeTorInstance {
43 printV("Failed to identify linux version - /etc/os-release missing");
44 }
45 }
46 + try {
47 + final torch = await CakeTorTorch.getInstance();
48 + if (torch != null) {
49 + return torch;
50 + }
51 + } catch (e) {
52 + printV("Failed to initialize torch: $e");
53 + }
54 return CakeTorDisabled();
55 }
56
cw_core/lib/utils/tor/torch.dart renamed
+34 -29
@@ -1,18 +1,32 @@
1 +import 'dart:async';
2 import 'dart:convert';
3 import 'dart:io';
4 +import 'dart:isolate';
5
6 import 'package:cw_core/utils/print_verbose.dart';
7 import 'package:cw_core/utils/tor/abstract.dart';
8 import 'package:path_provider/path_provider.dart';
9 import 'package:path/path.dart' as p;
8 -import 'package:tor_binary/tor_binary_platform_interface.dart';
10 +import 'package:torch_dart/abstract_tor.dart';
11 +
12 +class CakeTorTorch implements CakeTorInstance {
13 + final List<Tor> _torList;
14 +
15 + CakeTorTorch(this._torList);
16 +
17 + static Future<CakeTorTorch?> getInstance() async {
18 + final list = await Tor.getTorList();
19 + if (list.isEmpty) {
20 + return null;
21 + }
22 + return CakeTorTorch(list);
23 + }
24
10 -class CakeTorAndroid implements CakeTorInstance {
25 @override
12 - bool get bootstrapped => _proc != null;
26 + bool get bootstrapped => isTorRunning;
27
28 @override
15 - bool get enabled => _proc != null;
29 + bool get enabled => isTorRunning;
30
31 @override
32 int get port => 42142;
@@ -23,63 +37,54 @@ class CakeTorAndroid implements CakeTorInstance {
37 }
38
39 @override
26 - bool get started => _proc != null;
40 + bool started = false;
41 +
42 + static bool isTorRunning = false;
43
44 @override
45 Future<void> stop() async {
30 - _proc?.kill();
31 - await _proc?.exitCode;
32 - _proc = null;
46 + started = false;
47 }
48
35 - static Process? _proc;
36 -
49 Future<void> _runEmbeddedTor() async {
50 final dir = await getApplicationCacheDirectory();
51
40 - final torBinPath = p.join((await TorBinaryPlatform.instance.getBinaryPath())!, "libtor.so");
41 - printV("torPath: $torBinPath");
52 + final torList = await Tor.getTorList();
53 + printV("tor version: ${torList.first.version}");
54
43 - if (started) {
55 + if (isTorRunning) {
56 + started = true;
57 printV("Proxy is running");
58 return;
59 }
60 + isTorRunning = true;
61 + started = true;
62
63 printV("Starting embedded tor");
64 printV("app docs: $dir");
65 final torrc = """
66 SocksPort $port
52 -Log notice file ${p.join(dir.path, "tor.log")}
67 +Log notice stdout
68 RunAsDaemon 0
69 DataDirectory ${p.join(dir.path, "tor-data")}
70 """;
71 final torrcPath = p.join(dir.absolute.path, "torrc");
72 File(torrcPath).writeAsStringSync(torrc);
73
59 - if (_proc != null) {
60 - try {
61 - _proc?.kill();
62 - await _proc?.exitCode;
63 - _proc = null;
64 - } catch (e) {
65 - printV(e);
66 - }
67 - }
68 - printV("path: $torBinPath -f $torrcPath");
69 - _proc = await Process.start(torBinPath, ["-f", torrcPath]);
70 - _proc?.stdout.transform(utf8.decoder).forEach(printV);
71 - _proc?.stderr.transform(utf8.decoder).forEach(printV);
74 + final tor = _torList.first;
75 + tor.start(["nonexistent", "-f", torrcPath]);
76 }
77
78 @override
79 String toString() {
80 return """
77 -CakeTorAndroid(
81 +CakeTorTorch(
82 port: $port,
83 started: $started,
84 bootstrapped: $bootstrapped,
85 enabled: $enabled,
82 - proc: $_proc,
86 + torList:
87 + - ${_torList.map((e) => e.version).join(",\n - ")}
88 )
89 """;
90 }
cw_core/pubspec.lock
+6 -8
@@ -730,15 +730,13 @@ packages:
730 url: "https://pub.dev"
731 source: hosted
732 version: "1.0.1"
733 - tor_binary:
733 + torch_dart:
734 dependency: "direct main"
735 description:
736 - path: "."
737 - ref: cb811c610871a9517d47134b87c2f590c15c96c5
738 - resolved-ref: cb811c610871a9517d47134b87c2f590c15c96c5
739 - url: "https://github.com/MrCyjaneK/flutter-tor_binary"
740 - source: git
741 - version: "4.7.14"
736 + path: "../scripts/torch_dart"
737 + relative: true
738 + source: path
739 + version: "0.0.1"
740 tuple:
741 dependency: transitive
742 description:
@@ -828,5 +826,5 @@ packages:
826 source: hosted
827 version: "3.1.3"
828 sdks:
831 - dart: ">=3.6.0 <4.0.0"
829 + dart: ">=3.6.2 <4.0.0"
830 flutter: ">=3.27.0"
cw_core/pubspec.yaml
+2 -4
@@ -38,10 +38,8 @@ dependencies:
38 git:
39 url: https://github.com/sneurlax/socks_socket
40 ref: e6232c53c1595469931ababa878759a067c02e94
41 - tor_binary:
42 - git:
43 - url: https://github.com/MrCyjaneK/flutter-tor_binary
44 - ref: cb811c610871a9517d47134b87c2f590c15c96c5
41 + torch_dart:
42 + path: ../scripts/torch_dart
43
44 dev_dependencies:
45 flutter_test:
cw_decred/pubspec.lock
+6 -8
@@ -761,15 +761,13 @@ packages:
761 url: "https://pub.dev"
762 source: hosted
763 version: "1.0.2"
764 - tor_binary:
764 + torch_dart:
765 dependency: transitive
766 description:
767 - path: "."
768 - ref: cb811c610871a9517d47134b87c2f590c15c96c5
769 - resolved-ref: cb811c610871a9517d47134b87c2f590c15c96c5
770 - url: "https://github.com/MrCyjaneK/flutter-tor_binary"
771 - source: git
772 - version: "4.7.14"
767 + path: "../scripts/torch_dart"
768 + relative: true
769 + source: path
770 + version: "0.0.1"
771 tuple:
772 dependency: transitive
773 description:
@@ -867,5 +865,5 @@ packages:
865 source: hosted
866 version: "2.2.2"
867 sdks:
870 - dart: ">=3.6.0 <4.0.0"
868 + dart: ">=3.6.2 <4.0.0"
869 flutter: ">=3.24.0"
cw_monero/lib/monero_wallet.dart
+6 -6
@@ -229,12 +229,12 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
229 @override
230 Future<void> connectToNode({required Node node}) async {
231 String socksProxy = node.socksProxyAddress ?? '';
232 - printV("bootstrapped: ${CakeTor.instance.bootstrapped}");
233 - printV(" enabled: ${CakeTor.instance.enabled}");
234 - printV(" port: ${CakeTor.instance.port}");
235 - printV(" started: ${CakeTor.instance.started}");
236 - if (CakeTor.instance.enabled) {
237 - socksProxy = "127.0.0.1:${CakeTor.instance.port}";
232 + printV("bootstrapped: ${CakeTor.instance!.bootstrapped}");
233 + printV(" enabled: ${CakeTor.instance!.enabled}");
234 + printV(" port: ${CakeTor.instance!.port}");
235 + printV(" started: ${CakeTor.instance!.started}");
236 + if (CakeTor.instance!.enabled) {
237 + socksProxy = "127.0.0.1:${CakeTor.instance!.port}";
238 }
239 try {
240 syncStatus = ConnectingSyncStatus();
cw_monero/pubspec.lock
+6 -8
@@ -874,15 +874,13 @@ packages:
874 url: "https://pub.dev"
875 source: hosted
876 version: "1.0.1"
877 - tor_binary:
877 + torch_dart:
878 dependency: transitive
879 description:
880 - path: "."
881 - ref: cb811c610871a9517d47134b87c2f590c15c96c5
882 - resolved-ref: cb811c610871a9517d47134b87c2f590c15c96c5
883 - url: "https://github.com/MrCyjaneK/flutter-tor_binary"
884 - source: git
885 - version: "4.7.14"
880 + path: "../scripts/torch_dart"
881 + relative: true
882 + source: path
883 + version: "0.0.1"
884 tuple:
885 dependency: transitive
886 description:
@@ -996,5 +994,5 @@ packages:
994 source: hosted
995 version: "3.1.3"
996 sdks:
999 - dart: ">=3.6.0 <4.0.0"
997 + dart: ">=3.6.2 <4.0.0"
998 flutter: ">=3.24.0"
cw_nano/pubspec.lock
+6 -8
@@ -879,15 +879,13 @@ packages:
879 url: "https://pub.dev"
880 source: hosted
881 version: "1.0.1"
882 - tor_binary:
882 + torch_dart:
883 dependency: transitive
884 description:
885 - path: "."
886 - ref: cb811c610871a9517d47134b87c2f590c15c96c5
887 - resolved-ref: cb811c610871a9517d47134b87c2f590c15c96c5
888 - url: "https://github.com/MrCyjaneK/flutter-tor_binary"
889 - source: git
890 - version: "4.7.14"
885 + path: "../scripts/torch_dart"
886 + relative: true
887 + source: path
888 + version: "0.0.1"
889 tuple:
890 dependency: transitive
891 description:
@@ -977,5 +975,5 @@ packages:
975 source: hosted
976 version: "3.1.3"
977 sdks:
980 - dart: ">=3.6.0 <4.0.0"
978 + dart: ">=3.6.2 <4.0.0"
979 flutter: ">=3.27.0"
cw_wownero/lib/wownero_wallet.dart
+6 -6
@@ -203,12 +203,12 @@ abstract class WowneroWalletBase
203 @override
204 Future<void> connectToNode({required Node node}) async {
205 String socksProxy = node.socksProxyAddress ?? '';
206 - printV("bootstrapped: ${CakeTor.instance.bootstrapped}");
207 - printV(" enabled: ${CakeTor.instance.enabled}");
208 - printV(" port: ${CakeTor.instance.port}");
209 - printV(" started: ${CakeTor.instance.started}");
210 - if (CakeTor.instance.enabled) {
211 - socksProxy = "127.0.0.1:${CakeTor.instance.port}";
206 + printV("bootstrapped: ${CakeTor.instance!.bootstrapped}");
207 + printV(" enabled: ${CakeTor.instance!.enabled}");
208 + printV(" port: ${CakeTor.instance!.port}");
209 + printV(" started: ${CakeTor.instance!.started}");
210 + if (CakeTor.instance!.enabled) {
211 + socksProxy = "127.0.0.1:${CakeTor.instance!.port}";
212 }
213 try {
214 syncStatus = ConnectingSyncStatus();
cw_wownero/pubspec.lock
+6 -8
@@ -778,15 +778,13 @@ packages:
778 url: "https://pub.dev"
779 source: hosted
780 version: "1.0.1"
781 - tor_binary:
781 + torch_dart:
782 dependency: transitive
783 description:
784 - path: "."
785 - ref: cb811c610871a9517d47134b87c2f590c15c96c5
786 - resolved-ref: cb811c610871a9517d47134b87c2f590c15c96c5
787 - url: "https://github.com/MrCyjaneK/flutter-tor_binary"
788 - source: git
789 - version: "4.7.14"
784 + path: "../scripts/torch_dart"
785 + relative: true
786 + source: path
787 + version: "0.0.1"
788 tuple:
789 dependency: transitive
790 description:
@@ -876,5 +874,5 @@ packages:
874 source: hosted
875 version: "3.1.3"
876 sdks:
879 - dart: ">=3.6.0 <4.0.0"
877 + dart: ">=3.6.2 <4.0.0"
878 flutter: ">=3.24.0"
cw_zano/pubspec.lock
+6 -8
@@ -775,15 +775,13 @@ packages:
775 url: "https://pub.dev"
776 source: hosted
777 version: "1.0.2"
778 - tor_binary:
778 + torch_dart:
779 dependency: transitive
780 description:
781 - path: "."
782 - ref: cb811c610871a9517d47134b87c2f590c15c96c5
783 - resolved-ref: cb811c610871a9517d47134b87c2f590c15c96c5
784 - url: "https://github.com/MrCyjaneK/flutter-tor_binary"
785 - source: git
786 - version: "4.7.14"
781 + path: "../scripts/torch_dart"
782 + relative: true
783 + source: path
784 + version: "0.0.1"
785 tuple:
786 dependency: transitive
787 description:
@@ -873,5 +871,5 @@ packages:
871 source: hosted
872 version: "3.1.3"
873 sdks:
876 - dart: ">=3.6.0 <4.0.0"
874 + dart: ">=3.6.2 <4.0.0"
875 flutter: ">=3.24.0"
docs/builds/ANDROID.md
+1
@@ -22,6 +22,7 @@ cd cake_wallet
22 docker run -v$(pwd):$(pwd) -w $(pwd) -i --rm ghcr.io/cake-tech/cake_wallet:debian12-flutter3.27.4-ndkr28-go1.24.1-ruststablenightly bash -x << EOF
23 set -x -e
24 pushd scripts/android
25 + ./build_torch.sh
26 source ./app_env.sh cakewallet
27 # source ./app_env.sh monero.com # Uncomment this line to build monero.com
28 ./app_config.sh
ios/Podfile.lock
+45 -28
@@ -43,6 +43,7 @@ PODS:
43 - DKPhotoGallery/Resource (0.0.19):
44 - SDWebImage
45 - SwiftyGif
46 + - dnssec_proof (0.0.1)
47 - fast_scanner (5.1.1):
48 - Flutter
49 - file_picker (0.0.1):
@@ -66,6 +67,8 @@ PODS:
67 - Flutter
68 - fluttertoast (0.0.2):
69 - Flutter
70 + - image_picker_ios (0.0.1):
71 + - Flutter
72 - in_app_review (2.0.0):
73 - Flutter
74 - integration_test (0.0.1):
@@ -95,6 +98,8 @@ PODS:
98 - sp_scanner (0.0.1):
99 - Flutter
100 - SwiftyGif (5.4.5)
101 + - torch_dart (0.0.1):
102 + - Flutter
103 - uni_links (0.0.1):
104 - Flutter
105 - universal_ble (0.0.1):
@@ -114,6 +119,7 @@ DEPENDENCIES:
119 - device_display_brightness (from `.symlinks/plugins/device_display_brightness/ios`)
120 - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
121 - devicelocale (from `.symlinks/plugins/devicelocale/ios`)
122 + - dnssec_proof (from `.symlinks/plugins/dnssec_proof/ios`)
123 - fast_scanner (from `.symlinks/plugins/fast_scanner/ios`)
124 - file_picker (from `.symlinks/plugins/file_picker/ios`)
125 - Flutter (from `Flutter`)
@@ -123,6 +129,7 @@ DEPENDENCIES:
129 - flutter_mailer (from `.symlinks/plugins/flutter_mailer/ios`)
130 - flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
131 - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
132 + - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
133 - in_app_review (from `.symlinks/plugins/in_app_review/ios`)
134 - integration_test (from `.symlinks/plugins/integration_test/ios`)
135 - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
@@ -134,6 +141,7 @@ DEPENDENCIES:
141 - share_plus (from `.symlinks/plugins/share_plus/ios`)
142 - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
143 - sp_scanner (from `.symlinks/plugins/sp_scanner/ios`)
144 + - torch_dart (from `.symlinks/plugins/torch_dart/ios`)
145 - uni_links (from `.symlinks/plugins/uni_links/ios`)
146 - universal_ble (from `.symlinks/plugins/universal_ble/darwin`)
147 - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
@@ -162,6 +170,8 @@ EXTERNAL SOURCES:
170 :path: ".symlinks/plugins/device_info_plus/ios"
171 devicelocale:
172 :path: ".symlinks/plugins/devicelocale/ios"
173 + dnssec_proof:
174 + :path: ".symlinks/plugins/dnssec_proof/ios"
175 fast_scanner:
176 :path: ".symlinks/plugins/fast_scanner/ios"
177 file_picker:
@@ -180,6 +190,8 @@ EXTERNAL SOURCES:
190 :path: ".symlinks/plugins/flutter_secure_storage/ios"
191 fluttertoast:
192 :path: ".symlinks/plugins/fluttertoast/ios"
193 + image_picker_ios:
194 + :path: ".symlinks/plugins/image_picker_ios/ios"
195 in_app_review:
196 :path: ".symlinks/plugins/in_app_review/ios"
197 integration_test:
@@ -202,6 +214,8 @@ EXTERNAL SOURCES:
214 :path: ".symlinks/plugins/shared_preferences_foundation/darwin"
215 sp_scanner:
216 :path: ".symlinks/plugins/sp_scanner/ios"
217 + torch_dart:
218 + :path: ".symlinks/plugins/torch_dart/ios"
219 uni_links:
220 :path: ".symlinks/plugins/uni_links/ios"
221 universal_ble:
@@ -212,42 +226,45 @@ EXTERNAL SOURCES:
226 :path: ".symlinks/plugins/wakelock_plus/ios"
227
228 SPEC CHECKSUMS:
215 - connectivity_plus: 2a701ffec2c0ae28a48cf7540e279787e77c447d
229 + connectivity_plus: cb623214f4e1f6ef8fe7403d580fdad517d2f7dd
230 CryptoSwift: e64e11850ede528a02a0f3e768cec8e9d92ecb90
217 - cw_decred: 9c0e1df74745b51a1289ec5e91fb9e24b68fa14a
218 - cw_mweb: 22cd01dfb8ad2d39b15332006f22046aaa8352a3
219 - device_display_brightness: 1510e72c567a1f6ce6ffe393dcd9afd1426034f7
220 - device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6
221 - devicelocale: 35ba84dc7f45f527c3001535d8c8d104edd5d926
231 + cw_decred: a02cf30175a46971c1e2fa22c48407534541edc6
232 + cw_mweb: 3aea2fb35b2bd04d8b2d21b83216f3b8fb768d85
233 + device_display_brightness: 04374ebd653619292c1d996f00f42877ea19f17f
234 + device_info_plus: 335f3ce08d2e174b9fdc3db3db0f4e3b1f66bd89
235 + devicelocale: bd64aa714485a8afdaded0892c1e7d5b7f680cf8
236 DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
237 DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
224 - fast_scanner: 44c00940355a51258cd6c2085734193cd23d95bc
225 - file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655
238 + dnssec_proof: d461cac7bd3301eb7447f87936745a0c1ae0a67e
239 + fast_scanner: 2cb1ad3e69e645e9980fb4961396ce5804caa3e3
240 + file_picker: 9b3292d7c8bc68c8a7bf8eb78f730e49c8efc517
241 Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
227 - flutter_inappwebview_ios: 6f63631e2c62a7c350263b13fa5427aedefe81d4
228 - flutter_local_authentication: 1172a4dd88f6306dadce067454e2c4caf07977bb
229 - flutter_local_notifications: ff50f8405aaa0ccdc7dcfb9022ca192e8ad9688f
230 - flutter_mailer: 2ef5a67087bc8c6c4cefd04a178bf1ae2c94cd83
231 - flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be
232 - fluttertoast: 21eecd6935e7064cc1fcb733a4c5a428f3f24f0f
233 - in_app_review: a31b5257259646ea78e0e35fc914979b0031d011
234 - integration_test: 252f60fa39af5e17c3aa9899d35d908a0721b573
242 + flutter_inappwebview_ios: b89ba3482b96fb25e00c967aae065701b66e9b99
243 + flutter_local_authentication: 989278c681612f1ee0e36019e149137f114b9d7f
244 + flutter_local_notifications: a5a732f069baa862e728d839dd2ebb904737effb
245 + flutter_mailer: 3a8cd4f36c960fb04528d5471097270c19fec1c4
246 + flutter_secure_storage: 2c2ff13db9e0a5647389bff88b0ecac56e3f3418
247 + fluttertoast: 2c67e14dce98bbdb200df9e1acf610d7a6264ea1
248 + image_picker_ios: 7fe1ff8e34c1790d6fff70a32484959f563a928a
249 + in_app_review: 5596fe56fab799e8edb3561c03d053363ab13457
250 + integration_test: 4a889634ef21a45d28d50d622cf412dc6d9f586e
251 OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
236 - package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4
237 - path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
252 + package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
253 + path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564
254 payjoin_flutter: d9d4c8aa16bd5dfedb9b21d0edc8199e0187d96e
239 - permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
240 - reown_yttrium: c0e87e5965fa60a3559564cc35cffbba22976089
255 + permission_handler_apple: 4ed2196e43d0651e8ff7ca3483a069d469701f2d
256 + reown_yttrium: cee334ade64725b1d83f7b34c706a6aae2696d58
257 SDWebImage: 73c6079366fea25fa4bb9640d5fb58f0893facd8
242 - sensitive_clipboard: d4866e5d176581536c27bb1618642ee83adca986
243 - share_plus: 8b6f8b3447e494cca5317c8c3073de39b3600d1f
244 - shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
245 - sp_scanner: eaa617fa827396b967116b7f1f43549ca62e9a12
258 + sensitive_clipboard: 161e9abc3d56b3131309d8a321eb4690a803c16b
259 + share_plus: 50da8cb520a8f0f65671c6c6a99b3617ed10a58a
260 + shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7
261 + sp_scanner: b1bc9321690980bdb44bba7ec85d5543e716d1b5
262 SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
247 - uni_links: d97da20c7701486ba192624d99bffaaffcfc298a
248 - universal_ble: cf52a7b3fd2e7c14d6d7262e9fdadb72ab6b88a6
249 - url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
250 - wakelock_plus: 76957ab028e12bfa4e66813c99e46637f367fc7e
263 + torch_dart: f4620705d10f05492fab047f2fa1c3a600e7d17d
264 + uni_links: ed8c961e47ed9ce42b6d91e1de8049e38a4b3152
265 + universal_ble: ff19787898040d721109c6324472e5dd4bc86adc
266 + url_launcher_ios: 694010445543906933d732453a59da0a173ae33d
267 + wakelock_plus: e29112ab3ef0b318e58cfa5c32326458be66b556
268 YttriumWrapper: 31e937fe9fbe0f1314d2ca6be9ce9b379a059966
269
270 PODFILE CHECKSUM: 5296465b1c6d14d506230356756826012f65d97a
lib/main.dart
+6
@@ -47,6 +47,7 @@ import 'package:cw_core/unspent_coins_info.dart';
47 import 'package:cw_core/utils/print_verbose.dart';
48 import 'package:cw_core/utils/proxy_logger/memory_proxy_logger.dart';
49 import 'package:cw_core/utils/proxy_wrapper.dart';
50 +import 'package:cw_core/utils/tor/abstract.dart';
51 import 'package:cw_core/wallet_info.dart';
52 import 'package:cw_core/wallet_type.dart';
53 import 'package:flutter/foundation.dart';
@@ -85,6 +86,11 @@ Future<void> runAppWithZone({Key? topLevelKey}) async {
86 return true;
87 };
88 await FlutterDaemon().unmarkBackgroundSync();
89 + try {
90 + CakeTor.instance = await CakeTorInstance.getInstance();
91 + } catch (e) {
92 + printV("Failed to initialize tor: $e");
93 + }
94 await initializeAppAtRoot();
95
96 if (kDebugMode) {
lib/src/screens/wallet_connect/wc_pairing_detail_page.dart
+1 -1
@@ -155,7 +155,7 @@ class WCCDetailsWidget extends BasePage {
155 backgroundImage: (pairing.peerMetadata!.icons.isNotEmpty
156 ? NetworkImage(pairing.peerMetadata!.icons[0])
157 : AssetImage(
158 - CakeTor.instance.enabled
158 + CakeTor.instance!.enabled
159 ? 'assets/images/tor_logo.svg'
160 : 'assets/images/app_logo.png')) as ImageProvider<Object>,
161 ),
lib/src/widgets/provider_optoin_tile.dart
+1 -1
@@ -267,7 +267,7 @@ class Badge extends StatelessWidget {
267
268 Widget getImage(String imagePath, {double? height, double? width, Color? imageColor}) {
269 bool isNetworkImage = imagePath.startsWith('http') || imagePath.startsWith('https');
270 - if (CakeTor.instance.enabled && isNetworkImage) {
270 + if (CakeTor.instance!.enabled && isNetworkImage) {
271 imagePath = "assets/images/tor_logo.svg";
272 isNetworkImage = false;
273 }
lib/utils/feature_flag.dart
+1 -1
@@ -8,7 +8,7 @@ class FeatureFlag {
8 static const bool isCakePayRedemptionFlowEnabled = false;
9 static const bool isExolixEnabled = true;
10 static const bool isBackgroundSyncEnabled = true;
11 - static final bool isInAppTorEnabled = CakeTor.instance is! CakeTorDisabled;
11 + static bool get isInAppTorEnabled => CakeTor.instance is! CakeTorDisabled;
12 static const int verificationWordsCount = kDebugMode ? 0 : 2;
13 static const bool hasDevOptions = bool.fromEnvironment('hasDevOptions', defaultValue: kDebugMode);
14 static const bool hasBitcoinViewOnly = true;
lib/utils/image_utill.dart
+1 -1
@@ -13,7 +13,7 @@ class ImageUtil {
13 }) {
14 bool isNetworkImage = imagePath.startsWith('http') || imagePath.startsWith('https');
15
16 - if (CakeTor.instance.enabled && isNetworkImage) {
16 + if (CakeTor.instance!.enabled && isNetworkImage) {
17 imagePath = "assets/images/tor_logo.svg";
18 isNetworkImage = false;
19 }
lib/utils/tor.dart
+6 -6
@@ -15,7 +15,7 @@ Future<void> ensureTorStopped({required BuildContext? context}) async {
15 if (context != null) dialogContext = await showFullscreenDialog(context);
16 didTorStart = false;
17 printV("Stopping tor");
18 - await CakeTor.instance.stop();
18 + await CakeTor.instance!.stop();
19 printV("Tor stopped");
20 if (context != null) dismissFullscreenDialog(dialogContext!);
21 }
@@ -32,20 +32,20 @@ Future<void> ensureTorStarted({required BuildContext? context}) async {
32 // var rootToken = RootIsolateToken.instance!;
33 // await Isolate.run(() async {
34 // BackgroundIsolateBinaryMessenger.ensureInitialized(rootToken);
35 - // await CakeTor.instance.start();
35 + // await CakeTor.instance!.start();
36 // });
37 // second start is fast but populates the values on current thread
38 - await CakeTor.instance.start();
38 + await CakeTor.instance!.start();
39 printV("Tor started");
40 - while (!CakeTor.instance.started) {
40 + while (!CakeTor.instance!.started) {
41 printV("Waiting for tor to start (part 1)");
42 await Future.delayed(const Duration(seconds: 1));
43 }
44 - while (CakeTor.instance.port == -1) {
44 + while (CakeTor.instance!.port == -1) {
45 printV("Waiting for tor to start (listening on port)");
46 await Future.delayed(const Duration(seconds: 1));
47 }
48 - printV("Tor started on port ${CakeTor.instance.port}");
48 + printV("Tor started on port ${CakeTor.instance!.port}");
49 if (context != null) dismissFullscreenDialog(dialogContext!);
50 }
51
lib/view_model/dashboard/dashboard_view_model.dart
+1 -1
@@ -399,7 +399,7 @@ abstract class DashboardViewModelBase with Store {
399 String get address => wallet.walletAddresses.address;
400
401 @computed
402 - bool get isTorEnabled => CakeTor.instance.enabled;
402 + bool get isTorEnabled => CakeTor.instance!.enabled;
403
404 @computed
405 SyncStatus get status => wallet.syncStatus;
lib/view_model/node_list/node_create_or_edit_view_model.dart
+1 -1
@@ -64,7 +64,7 @@ abstract class NodeCreateOrEditViewModelBase with Store {
64 bool useSocksProxy;
65
66 @computed
67 - bool get usesEmbeddedProxy => CakeTor.instance.started;
67 + bool get usesEmbeddedProxy => CakeTor.instance!.started;
68
69 @observable
70 String socksProxyAddress;
lib/view_model/node_list/node_list_view_model.dart
+1 -1
@@ -39,7 +39,7 @@ abstract class NodeListViewModelBase with Store {
39
40 String getAlertContent(String uri) =>
41 S.current.change_current_node(uri) +
42 - '${uri.endsWith('.onion') || uri.contains('.onion:') ? '\n' + (CakeTor.instance.enabled ? '' : S.current.orbot_running_alert) : ''}';
42 + '${uri.endsWith('.onion') || uri.contains('.onion:') ? '\n' + (CakeTor.instance!.enabled ? '' : S.current.orbot_running_alert) : ''}';
43
44 @computed
45 bool get enableAutomaticNodeSwitching => settingsStore.enableAutomaticNodeSwitching;
lib/view_model/node_list/pow_node_list_view_model.dart
+1 -1
@@ -39,7 +39,7 @@ abstract class PowNodeListViewModelBase with Store {
39
40 String getAlertContent(String uri) =>
41 S.current.change_current_node(uri) +
42 - '${uri.endsWith('.onion') || uri.contains('.onion:') ? '\n' + (CakeTor.instance.enabled ? '' : S.current.orbot_running_alert) : ''}';
42 + '${uri.endsWith('.onion') || uri.contains('.onion:') ? '\n' + (CakeTor.instance!.enabled ? '' : S.current.orbot_running_alert) : ''}';
43
44 @computed
45 bool get enableAutomaticNodeSwitching => settingsStore.enableAutomaticNodeSwitching;
lib/view_model/start_tor_view_model.dart
+1 -1
@@ -59,7 +59,7 @@ abstract class StartTorViewModelBase with Store {
59 await ensureTorStarted(context: null);
60 while (true) {
61 await Future.delayed(Duration(milliseconds: 250));
62 - if (CakeTor.instance.port != -1 && CakeTor.instance.started) {
62 + if (CakeTor.instance!.port != -1 && CakeTor.instance!.started) {
63 break;
64 }
65 }
macos/Podfile.lock
+25 -19
@@ -37,6 +37,8 @@ PODS:
37 - FlutterMacOS
38 - sp_scanner (0.0.1):
39 - FlutterMacOS
40 + - torch_dart (0.0.1):
41 + - FlutterMacOS
42 - universal_ble (0.0.1):
43 - Flutter
44 - FlutterMacOS
@@ -64,6 +66,7 @@ DEPENDENCIES:
66 - share_plus (from `Flutter/ephemeral/.symlinks/plugins/share_plus/macos`)
67 - shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`)
68 - sp_scanner (from `Flutter/ephemeral/.symlinks/plugins/sp_scanner/macos`)
69 + - torch_dart (from `Flutter/ephemeral/.symlinks/plugins/torch_dart/macos`)
70 - universal_ble (from `Flutter/ephemeral/.symlinks/plugins/universal_ble/darwin`)
71 - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
72 - wakelock_plus (from `Flutter/ephemeral/.symlinks/plugins/wakelock_plus/macos`)
@@ -109,6 +112,8 @@ EXTERNAL SOURCES:
112 :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin
113 sp_scanner:
114 :path: Flutter/ephemeral/.symlinks/plugins/sp_scanner/macos
115 + torch_dart:
116 + :path: Flutter/ephemeral/.symlinks/plugins/torch_dart/macos
117 universal_ble:
118 :path: Flutter/ephemeral/.symlinks/plugins/universal_ble/darwin
119 url_launcher_macos:
@@ -117,28 +122,29 @@ EXTERNAL SOURCES:
122 :path: Flutter/ephemeral/.symlinks/plugins/wakelock_plus/macos
123
124 SPEC CHECKSUMS:
120 - connectivity_plus: 0a976dfd033b59192912fa3c6c7b54aab5093802
121 - cw_mweb: 7440b12ead811dda972a9918442ea2a458e8742c
122 - device_info_plus: 5401765fde0b8d062a2f8eb65510fb17e77cf07f
123 - devicelocale: 9f0f36ac651cabae2c33f32dcff4f32b61c38225
125 + connectivity_plus: 4adf20a405e25b42b9c9f87feff8f4b6fde18a4e
126 + cw_mweb: 4746a3b5cc5bd4afe6fadd2481c4f7b239e391d0
127 + device_info_plus: b0fafc687fb901e2af612763340f1b0d4352f8e5
128 + devicelocale: 456a07c045d3113938aa4983065bd8526e2af792
129 dnssec_proof: d461cac7bd3301eb7447f87936745a0c1ae0a67e
125 - fast_scanner: d31bae07e2653403a69dac99fb710c1722b16a97
126 - file_selector_macos: cc3858c981fe6889f364731200d6232dac1d812d
127 - flutter_inappwebview_macos: bdf207b8f4ebd58e86ae06cd96b147de99a67c9b
128 - flutter_local_authentication: 85674893931e1c9cfa7c9e4f5973cb8c56b018b0
129 - flutter_local_notifications: 4ccab5b7a22835214a6672e3f9c5e8ae207dab36
130 - flutter_secure_storage_macos: d56e2d218c1130b262bef8b4a7d64f88d7f9c9ea
130 + fast_scanner: a4ead8e56f185cd565e25250fdb97fa669ea1d2e
131 + file_selector_macos: 6280b52b459ae6c590af5d78fc35c7267a3c4b31
132 + flutter_inappwebview_macos: c2d68649f9f8f1831bfcd98d73fd6256366d9d1d
133 + flutter_local_authentication: 2f9a2682f498abcc12d7e9729b5007a947170fdc
134 + flutter_local_notifications: 4bf37a31afde695b56091b4ae3e4d9c7a7e6cda0
135 + flutter_secure_storage_macos: 3dacac420d84c4d0dc5e868194ee43c8664ec797
136 FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
132 - in_app_review: a6a031b9acd03c7d103e341aa334adf2c493fb93
137 + in_app_review: 0599bccaed5e02f6bed2b0d30d16f86b63ed8638
138 OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
134 - package_info_plus: 12f1c5c2cfe8727ca46cbd0b26677728972d9a5b
135 - path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
136 - share_plus: 1fa619de8392a4398bfaf176d441853922614e89
137 - shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
138 - sp_scanner: 269d96e0ec3173e69156be7239b95182be3b8303
139 - universal_ble: cf52a7b3fd2e7c14d6d7262e9fdadb72ab6b88a6
140 - url_launcher_macos: c82c93949963e55b228a30115bd219499a6fe404
141 - wakelock_plus: 4783562c9a43d209c458cb9b30692134af456269
139 + package_info_plus: f0052d280d17aa382b932f399edf32507174e870
140 + path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564
141 + share_plus: 510bf0af1a42cd602274b4629920c9649c52f4cc
142 + shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7
143 + sp_scanner: d9316427b628dd86d6e9e3c5d42ed6b4b410157c
144 + torch_dart: 7e4f682c34ee0d967a35977102590094a7510c90
145 + universal_ble: ff19787898040d721109c6324472e5dd4bc86adc
146 + url_launcher_macos: 0fba8ddabfc33ce0a9afe7c5fef5aab3d8d2d673
147 + wakelock_plus: 21ddc249ac4b8d018838dbdabd65c5976c308497
148
149 PODFILE CHECKSUM: 65ec1541137fb5b35d00490dec1bb48d4d9586bb
150
pubspec_base.yaml
+2 -4
@@ -143,6 +143,8 @@ dependencies:
143 git:
144 url: https://github.com/MrCyjaneK/dnssec_proof.git
145 ref: a2b0bdac343afc14fc38dfb81f28147eab50be05
146 + torch_dart:
147 + path: ./scripts/torch_dart
148
149 dev_dependencies:
150 flutter_test:
@@ -188,10 +190,6 @@ dependency_overrides:
190 git:
191 url: https://github.com/LacticWhale/socks_dart.git
192 ref: 27ad7c2efae8d7460325c74b90f660085cbd0685
191 - tor_binary:
192 - git:
193 - url: https://github.com/MrCyjaneK/flutter-tor_binary
194 - ref: cb811c610871a9517d47134b87c2f590c15c96c5
193 web_socket_channel: ^3.0.2
194 freezed_annotation: 2.4.4
195
run-android.sh
+1 -1
@@ -1,5 +1,5 @@
1 #!/bin/bash
2 -source "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/functions.sh"
2 +source "$(cd "$(dirname "${BASH_SOURCE[0]}")/scripts" && pwd)/functions.sh"
3 # Get the current git branch
4 get_current_branch() {
5 if git rev-parse --git-dir > /dev/null 2>&1; then
scripts/android/build_all.sh
+2
@@ -7,6 +7,8 @@ fi
7
8 DIR=$(dirname "$0")
9
10 +$DIR/build_torch.sh
11 +
12 case $APP_ANDROID_TYPE in
13 "monero.com") $DIR/build_monero_all.sh ;;
14 "cakewallet") $DIR/build_monero_all.sh
scripts/android/build_torch.sh new
+9
@@ -0,0 +1,9 @@
1 +#!/bin/bash
2 +set -x -e
3 +cd "$(dirname "$0")"
4 +
5 +../prepare_torch.sh
6 +
7 +cd ../torch_dart
8 +
9 +./build.sh aarch64-linux-android armv7a-linux-androideabi x86_64-linux-android
\ No newline at end of file
scripts/ios/build_all.sh
+2
@@ -7,6 +7,8 @@ fi
7
8 DIR=$(dirname "$0")
9
10 +$DIR/build_torch.sh
11 +
12 case $APP_IOS_TYPE in
13 "monero.com") $DIR/build_monero_all.sh ;;
14 "cakewallet") $DIR/build_monero_all.sh && $DIR/build_mwebd.sh && $DIR/build_decred.sh ;;
scripts/ios/build_torch.sh new
+10
@@ -0,0 +1,10 @@
1 +#!/bin/bash
2 +set -x -e
3 +cd "$(dirname "$0")"
4 +
5 +../prepare_torch.sh
6 +
7 +cd ../torch_dart
8 +
9 +# Need to build all platforms to get .xcframework
10 +./build.sh aarch64-apple-ios-simulator aarch64-apple-ios aarch64-apple-darwin x86_64-apple-darwin
\ No newline at end of file
scripts/macos/build_all.sh
+3 -1
@@ -1,3 +1,5 @@
1 #!/bin/sh
2
3 -./build_monero_all.sh universal && $DIR/build_decred.sh
3 +./build_torch.sh
4 +
5 +./build_monero_all.sh universal && ./build_decred.sh
scripts/macos/build_torch.sh new
+4
@@ -0,0 +1,4 @@
1 +#!/bin/bash
2 +set -x -e
3 +cd "$(dirname "$0")"
4 +exec bash ../ios/build_torch.sh
\ No newline at end of file
scripts/prepare_moneroc.sh
+1
@@ -6,6 +6,7 @@ cd "$(dirname "$0")"
6
7 if [[ ! -d "monero_c/.git" ]];
8 then
9 + rm -rf monero_c
10 git clone https://github.com/mrcyjanek/monero_c --branch master monero_c
11 cd monero_c
12 git checkout b576312e4d466569cd03482b61c597b39a9f4dc3
scripts/prepare_torch.sh new
+28
@@ -0,0 +1,28 @@
1 +#!/bin/bash
2 +set -x -e
3 +cd "$(dirname "$0")"
4 +
5 +# IMPORTANT: Make sure to update action 'Build Torch` in
6 +# - .github/workflows/pr_test_build_android.yml
7 +# - .github/workflows/pr_test_build_linux.yml
8 +# https://github.com/MrCyjaneK/torch_dart/releases/download/4f987d4-1-ge071fcf-1-gc282f09-1-g4c290aa-1-gabdf653/torch_dart-4f987d4-1-ge071fcf-1-gc282f09-1-g4c290aa-1-gabdf653.tar.gz
9 +
10 +HASH=abdf653fc15b576f2a67597a1f9618345a297f45
11 +
12 +if [[ ! -d "torch_dart/.git" ]];
13 +then
14 + rm -rf torch_dart
15 + git clone https://github.com/mrcyjanek/torch_dart
16 + cd torch_dart
17 +else
18 + cd torch_dart
19 + git fetch -a
20 +fi
21 +
22 +
23 +git reset --hard
24 +git checkout $HASH
25 +git reset --hard
26 +
27 +# recommended to uncomment during development
28 +# sed -i.bak 's/go run . -cleanup/#go run . -cleanup/g' build.sh
\ No newline at end of file