From 7dc79039471d3df0e32d233fb87c205d614dc4f2 Mon Sep 17 00:00:00 2001 From: Marcos Rodriguez Velez Date: Fri, 10 Nov 2023 11:21:23 -0400 Subject: [PATCH] ADD: Patch to return false on Mainsetup for Tor --- package.json | 2 +- scripts/react-native-tor-ios.patch | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 scripts/react-native-tor-ios.patch diff --git a/package.json b/package.json index d2dda6458..5677c4662 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "android:clean": "cd android; ./gradlew clean ; cd .. ; npm run android", "ios": "react-native run-ios", "postinstall": "rn-nodeify --install buffer,events,process,stream,inherits,path,assert,crypto --hack; npm run releasenotes2json; npm run branch2json; npm run podinstall; npm run patches", - "patches": "patch -p1 < scripts/react-native-tor.patch; patch -p1 < scripts/rn-ldk.patch", + "patches": "patch -p1 < scripts/react-native-tor.patch; patch -p1 < scripts/react-native-tor-ios.patch; patch -p1 < scripts/rn-ldk.patch", "test": "npm run tslint && npm run lint && npm run unit && npm run jest", "jest": "jest -b tests/integration/*", "windowspatches": "./scripts/windows-patches.sh", diff --git a/scripts/react-native-tor-ios.patch b/scripts/react-native-tor-ios.patch new file mode 100644 index 000000000..01c7f827f --- /dev/null +++ b/scripts/react-native-tor-ios.patch @@ -0,0 +1,13 @@ +--- ../node_modules/react-native-tor/ios/Tor.swift 2023-11-10 11:17:20 ++++ ../node_modules/react-native-tor/ios/Tor.swift 2023-11-10 11:17:16 +@@ -42,6 +42,10 @@ + var streams:Dictionary = [:]; + var hasLnser = false; + var clienTimeout:TimeInterval = 60; ++ ++ override class func requiresMainQueueSetup() -> Bool { ++ return false ++ } + + func getProxiedClient(headers:Optional,socksPort:UInt16,trustInvalidSSL: Bool = false)->URLSession{ + let config = URLSessionConfiguration.default;