android icon indicating copy to clipboard operation
android copied to clipboard

Proxy settings and Tor onion support

Open BayLee4 opened this issue 5 years ago • 26 comments

Is your feature request related to a problem? Please describe.

Additional privacy and security, could also be used in case of censorship. Currently one could not use its own proxy to access the service.

Describe the solution you'd like

Adding a proxy settings (Socks, HTTP), and add option to use the Tor onion service v3 (which is already in production), instead of clearnet URL defined here : https://github.com/CTemplar/android/blob/master/app/build.gradle#L49 Could also be configured to start Orbot when this settings is set, the same way F-droid is currently doing it : https://github.com/f-droid/fdroidclient/blob/master/app/src/main/java/org/fdroid/fdroid/FDroidApp.java#L663

Describe alternatives you've considered

Currently, the alternative is using the onion web application, but it would be more secure and convenient to use it directly in the android application. One could also use Tor/VPN system-wide, but it's also not convenient (would take the only available VPN slot on android), and would still not benefits the additional security/privacy of the onion service.

Additional context Add any other context or screenshots about the feature request here.

Screenshot from F-droid :

BayLee4 avatar Jan 10 '21 19:01 BayLee4

Any update on this ?

BayLee4 avatar May 29 '21 21:05 BayLee4

@alexdwork2018 Could we give some priority to this?

The-Hidden-Hand avatar Jun 04 '21 10:06 The-Hidden-Hand

I guess that means no 😕

BayLee4 avatar Jun 25 '21 17:06 BayLee4

@alexdwork2018 @The-Hidden-Hand With all the recent events about Protonmail giving IP addresses of its users to authorities, this feature could really be an important factor for considering CTemplar over Protonmail.

Could we expect some progress on this any soon ?

BayLee4 avatar Sep 08 '21 19:09 BayLee4

@BayLee4 This is on testing phase and it will be included in the next release.

The-Hidden-Hand avatar Oct 04 '21 23:10 The-Hidden-Hand

@nivritgupta Do you think this would be possible on iOS?

The-Hidden-Hand avatar Oct 04 '21 23:10 The-Hidden-Hand

@The-Hidden-Hand That's awesome, congratulation to the team !

I looked at the Pull Request and it seems that even when using Tor, the application still use the clearnet URL instead of the onion URL. Could it be made to connect to the onion URL for more privacy (and security) ? It would make the connection to stay within the Tor network, thus eliminating the risk of malicious exit nodes, and as you already have one up and running it would be a shame not to use it !

BayLee4 avatar Oct 05 '21 17:10 BayLee4

Hi @BayLee4 . The new version already sent for publication and will soon be available in stores. It will also get improvements in the near future, so please stay tuned.

alexdwork2018 avatar Oct 05 '21 18:10 alexdwork2018

Thanks for the work @alexdwork2018 Let us know any other suggestion @BayLee4 !

The-Hidden-Hand avatar Oct 21 '21 13:10 The-Hidden-Hand

Thanks @The-Hidden-Hand and @alexdwork2018 ! It feels good to see that you actively listen to your customers, and that you truly cares about their privacy, as opposed to other well-known providers.

On a side note, shouldn't this issue be left opened (maybe until the feature isn't in beta anymore) ? I tried it and it's not working for me, clicking on the "Use Tor" button makes a popup appear which ask me if I want to open my browser or f-droid. It doesn't start Orbot at all, and if I choose to open the browser it loads https://f-droid.org/packages/org.torproject.android/ which leads to a 404 error.

BayLee4 avatar Oct 22 '21 16:10 BayLee4

@The-Hidden-Hand Do you think this would be possible on iOS?

I need to do some R&D work on this, Tor onion support,

but we can't control how a WKWebView (or the newer Safari View Controller) accesses the internet; it always uses the system WAN connection, One approach might be to build a VPN service that 1) is available to the operating system and can easily be switched on 2) routes the VPN tunnel through TOR instead of a traditional VPN system. You could then use your web view, as usual, knowing that the data will be routed through a virtual tunnel into TOR instead of using the regular internet connection.

nivritgupta avatar Oct 26 '21 05:10 nivritgupta

@BayLee4 I think the issue has been solved. Please let us know any other suggestions!

The-Hidden-Hand avatar Nov 03 '21 15:11 The-Hidden-Hand

SOCKS5 support would be great. User can use SOCKS5 proxy for connecting to Tor.

reg3xp avatar Nov 06 '21 09:11 reg3xp

Hi @The-Hidden-Hand, nothing changed since my last comment ('Use Tor' button still not working, and onion URL still not used). I've waited to see if there was an upcoming update about it but there isn't, could you please reopen the issue until these problems are resolved ? Thanks.

BayLee4 avatar Nov 24 '21 20:11 BayLee4

Hi @BayLee4 ! I managed to repeat your issue on the device without Google Play. If you use an official source to install the CTemplar app, such as Google Play or F-Droid Store, then activating 'Use Tor' will try to install Orbot from these stores. But here is a problem with the F-Droid Store. Now it does not display Orbot without additional settings. You need to open the F-Droid Store app -> 'Settings' -> 'Repositories' and enable 'Guardian Project Official Releases'. After that, you can enable 'Use Tor' in the CTemplar app and it will propose to install Orbot from the F-Droid store. If the Orbot is already installed, CTemplar will send a command to start service to the Orbot app. Later we will add hints for this case.

If you don't have any of the supported stores and enable 'Use Tor' options it will open the web browser as you described. F-Droid web page does not show you the Orbot app instead you will see only 404 pages. But even in this case, there is a way out. You can install Orbot yourself and if the package name of the app matches the original one, then everything will work. Be careful on installing apps from unsafe sources. If this 'Use Tor' option doesn't work for you, you can stat Orbot manually and instead 'Use Tor' activate the 'HTTP Proxy' option. In the address field, enter 127.0.0.1 and in the port field 8118 (Orbot app address). As result, all CTemplar traffic must go through the Orbot app.

alexdwork2018 avatar Dec 01 '21 20:12 alexdwork2018

Hi @alexdwork2018, I already have Tor installed from the Guardian Project repository in F-droid (and just as shown in my first comment, I'm using it with F-droid without any issue).

Still, the CTemplar application seems not to communicate with Orbot even if installed this way, in contrast to the F-droid application which starts it and uses it normally.

BayLee4 avatar Dec 01 '21 21:12 BayLee4

@BayLee4 Above you wrote that the activation of the 'Use Tor' gives you a choice between the Browser and the F-Droid store app. When you select F-Droid, does it display Orbot installed on your device? CTemplar uses the same library and code to check whether Orbot is installed as the F-Droid Store app. Even if CTemplar app for any reason cannot detect the installed Orbot on your device, click on 'Use Tor' should activate setting switch and work with original Orbot app. Can you please specify the version of the device operating system you are using? This would help in repeating your issue case.

Please note that by default Orbot should work on HTTP 8118 port and CTemplar expect these parameters. You can check and correct this in the Orbot app.

alexdwork2018 avatar Dec 02 '21 22:12 alexdwork2018

@BayLee4 Above you wrote that the activation of the 'Use Tor' gives you a choice between the Browser and the F-Droid store app. When you select F-Droid, does it display Orbot installed on your device?

Yes it does.

Can you please specify the version of the device operating system you are using? This would help in repeating your issue case.

I'm on Android 12, running without Play Services. I was previously on Android 11 and if I recall correctly the issue was already present at that time.

Please note that by default Orbot should work on HTTP 8118 port and CTemplar expect these parameters. You can check and correct this in the Orbot app.

Yes this is correct, and I confirm that when ignoring/closing the F-droid/web page which opens automatically when clicking on the 'Use Tor' button, and then manually starting Orbot, the CTemplar application does use the proxy correctly and is able to function as normal. It looks like the issue is only related to the 'Detect if Orbot is installed / Start it' part of the integration.

@alexdwork2018 Please tell me if you need additional informations, I will provide them. Thanks.

BayLee4 avatar Dec 03 '21 00:12 BayLee4

@BayLee4 Thank you for the details. The problem with opening Orbot instead of launching onion service. It appear from the inability to determine if Orbot is installed on your device. With the transition to support for the latest SDK, the Android operating system filters information about installed apps. Therefore, CTemplar cannot determine if Orbot is installed on the device on your device. At the same time, the operating system can return a real list of installed on device apps for apps for which this is the main function, such as apps stores.

You can read more here - https://developer.android.com/training/package-visibility

alexdwork2018 avatar Dec 07 '21 21:12 alexdwork2018

@reg3xp @BayLee4 SOCKS proxy and Tor onion address support will appear in one of the next updates. Stay tuned.

alexdwork2018 avatar Dec 07 '21 21:12 alexdwork2018