iilab / openmentoring-mobile

GNU Lesser General Public License v3.0
5 stars 6 forks source link

Once Orbot is validated as being installed, check to make sure that Tor is being used before proceeding #70

Open bsenyk opened 8 years ago

bsenyk commented 8 years ago

If it is not running, prompt the user to start it.

jmatsushita commented 8 years ago

Hi @eighthave is checking that either

SOCKS 4A/5 proxy 127.0.0.1:9050
HTTP proxy 127.0.0.1:8118

are accessible a reliable way to establish if Tor is running and ask the user to turn it on if not before having our app connect to download content updates?

eighthave commented 8 years ago

If those ports are present and open, that's an reliable way to detect it on many devices, but not all. We have an Intent/Receiver based interface where Orbot broadcasts out its state, and apps can ask Orbot to start, provided the user has not disabled autostart.

See OrbotHelper in NetCipher. It provides lots of helper methods for this stuff, including detecting whether Orbot is installed, and prompting the user to install it:

https://github.com/guardianproject/NetCipher/blob/master/libnetcipher/src/info/guardianproject/netcipher/proxy/OrbotHelper.java

eighthave commented 8 years ago

Just add this to gradle to use it:

    compile 'info.guardianproject.netcipher:netcipher:1.2'
bsenyk commented 8 years ago

hi @eighthave, thanks for your help!

Do you know if anybody has been working on integrating netcipher into a cordova project?

If not, perhaps we can use the info in the file you linked to above to use something like https://github.com/lampaa/com.lampa.startapp to fire the intent.

eighthave commented 8 years ago

I know next to nothing about Cordoba, but would be happy to help you get it working there. I can say that sending an Intent is absolutely basic, fundamental Android, so cordoba must have a way to do it. I think @n8fr8 has done some phonegap, maybe he can help.

n8fr8 commented 8 years ago

I think it is mostly WebView proxying that needs to be done, though there may be some Javascript bridge support into network calls in the Java layer.