Skip to content

Add Tor Support #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 68 commits into from
Apr 30, 2020
Merged

Add Tor Support #11

merged 68 commits into from
Apr 30, 2020

Conversation

dergigi
Copy link

@dergigi dergigi commented Apr 21, 2020

Adds Tor support for all requests made to the Samourai backend. The iCepa Tor.framework is used and integrated via Carthage.

This PR is split up into smaller pull requests to make review and discussion easier. Merge these to develop first and this PR will get smaller. In order:

  1. Update Realm to 3.20.0: Update Realm to 3.20.0 for Xcode 11 compatibility #9
  2. Update to Moya 14 / Alamofire 5: Upgrade to Moya 14 / Alamofire 5 dergigi/Sentinel-iOS#3
  3. Refactor PushTx network code: Refactor PushTx network code to use Moya dergigi/Sentinel-iOS#4

As a follow-up PR I would love to implement testnet support for both the regular and the Tor API, as seen on Android.


Inspiration for network settings UI taken from Android:

Simulator Screen Shot - iPhone 11 - 2020-04-22 at 19 45 22

Simulator Screen Shot - iPhone 11 - 2020-04-22 at 19 45 26


Simulator Screen Shot - iPhone 11 - 2020-04-22 at 13 22 58

Simulator Screen Shot - iPhone 11 - 2020-04-22 at 13 23 01

Simulator Screen Shot - iPhone 11 - 2020-04-22 at 13 23 03

Simulator Screen Shot - iPhone 11 - 2020-04-22 at 13 23 05


Tor setting is stored in the iOS user defaults and checked on startup. If set, Tor is initialized before the home screen is shown.

Simulator Screen Shot - iPhone 11 - 2020-04-22 at 13 39 06


ℹ️ Note: If a PIN is set, Tor is initialized after the PIN was entered correctly. This behavior is different from Android, which initialized Tor before everything else. If we want to have the same behavior on iOS, we will have to do quite a bit of refactoring, especially how the view controller stack is initialized in RootNavigationViewController. I tried to implement an acceptable solution with minimal unrelated changes, to not blow up this PR unnecessarily. I suggest we create a separate PR to refactor and improve this behavior after this one is merged.

dergigi added 30 commits April 17, 2020 15:45
* Alamofire5:
  Update creation of PushTx request to Alamofire5 API
  Update Moya to 14.0.0 (includes Alamofire 5.1.0)
Sends "SIGNAL RELOAD" and "SIGNAL NEWNYM" to the Tor thread
@dergigi dergigi changed the title [WIP] Add Tor Support Add Tor Support Apr 23, 2020
@dergigi dergigi marked this pull request as ready for review April 23, 2020 09:54
@SamouraiDev SamouraiDev changed the base branch from develop to staging April 30, 2020 11:06
@SamouraiDev SamouraiDev merged commit 6347239 into Samourai-Wallet:staging Apr 30, 2020
@dergigi dergigi mentioned this pull request May 8, 2020
@dergigi dergigi deleted the tor branch May 8, 2020 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants