Commit Graph

102 Commits

Author SHA1 Message Date
Nathan Freitas 8d8fe0ceb4 updates to improve VPN support 2015-12-30 13:21:33 -05:00
Nathan Freitas 256ecc4df0 update tor version constant to 0.2.6.10 2015-07-13 23:12:10 -04:00
Nathan Freitas e11cae883e Merge branch 'the-big-start-stop-makeover' of https://github.com/eighthave/orbot into eighthave-the-big-start-stop-makeover
Conflicts:
	src/org/torproject/android/OrbotMainActivity.java
	src/org/torproject/android/service/TorService.java
2015-06-22 12:43:42 -04:00
Nathan Freitas e132a79a61 improve status request/callback interaction and status UI layout 2015-06-22 12:25:37 -04:00
Hans-Christoph Steiner e5c2e1a040 when OrbotMainActivity starts, query TorService for current status
If OrbotMainActivity gets killed while TorService is running, then when
OrbotMainActivity starts again, it needs to get the current status from
TorService to correctly represent things to the user.
2015-06-17 11:00:48 -04:00
Hans-Christoph Steiner b620f828a1 include dynamic proxy config info in ACTION_STATUS replies
This includes extras in the Intents that are sent as replies to the two
different requests to start tor (ACTION_START and ACTION_START_TOR).  These
extras give all of the current SOCKS and HTTP proxy settings, so that the
app can dynamically use the correct settings.  Sometimes there are port
conflicts, so apps should dynamically adjust in order to reliably find tor.

closes #3612 https://dev.guardianproject.info/issues/3612
refs #4419 https://dev.guardianproject.info/issues/4419
refs #3690 https://dev.guardianproject.info/issues/3690
refs #3687 https://dev.guardianproject.info/issues/3687
refs #3859 https://dev.guardianproject.info/issues/3859
2015-06-11 17:02:56 -04:00
Hans-Christoph Steiner 623084548d standardize network port constant variables
use consistent naming and types for code clarity
2015-06-11 16:31:39 -04:00
Hans-Christoph Steiner 775135d07a let the requesting app know that the user has disabled starting via Intent
If an app is using ACTION_START to start Orbot in the background, but the
user had disabled that using the allowBackgroundStarts pref, then the app
will want to know about that so it can fallback on prompting the user to
bring up Orbot itself for the user to manually start it.

refs #3117 https://dev.guardianproject.info/issues/3117
2015-06-10 18:15:29 -04:00
Hans-Christoph Steiner 77b1bdfbc5 on receiving ACTION_START, only send status reply if EXTRA_PACKAGE_NAME set
In order to receive a targeted reply, an app has to send its packageName to
Orbot as an String extra in an ACTION_START Intent.  Also, when Orbot
internally uses ACTION_START, it shouldn't receive replies.
2015-06-10 18:02:43 -04:00
Hans-Christoph Steiner f433a5e655 expose start action via a BroadcastReceiver that any app can send to
This allows any app to broadcast an Intent to Orbot in order to make Orbot
start in the background.

closes #3117 https://dev.guardianproject.info/issues/3117
2015-06-10 18:02:43 -04:00
Hans-Christoph Steiner 25a6bb63b2 force all UI status updates through mStatusUpdateHandler
The Handler is a message queue for the main thread, so it should help keep
the UI working while status updates are coming in.

* This removes the constants in TorServiceConstants because the Handler
  messages are only for OrbotMainActivity

* this uses the handy shortcut msg.obj for the status message
2015-06-10 18:02:43 -04:00
Hans-Christoph Steiner bf3572eb82 use the same action string for local and broadcast status
No need to have separate action strings, using the LocalBroadcastManager
enforces the local-only messaging, and Orbot does not claim the global
broadcasts in any kind of receiver.
2015-06-09 22:01:52 -04:00
Hans-Christoph Steiner 90b731cc8d strictly target local broadcasts
This sets an action for each kind of local broadcast, and uses the action
to choose how to handle it.  Before, it was a mix of the action and which
extras the Intent included.
2015-06-09 22:01:52 -04:00
Hans-Christoph Steiner 21c3bfb3c5 use "SIGNAL HUP" to request Tor re-read its config
The tor daemon supports both "SIGNAL HUP" via its control port or the UNIX
signal `kill -HUP` via the terminal as a way to trigger the tor daemon to
reload its config.  This is needed for new bridges and hidden services. It
is not necessary to restart everything to add those.

https://stem.torproject.org/faq.html#how-do-i-reload-my-torrc
2015-06-09 22:01:52 -04:00
Hans-Christoph Steiner 6ac9a2cee6 use context.stopService() to shutdown TorService instead of custom message
Since running stopService() automatically triggers Service.onDestroy(),
there is a nice way to hook in and run the shutdown procedure.  This
provides an obvious point of entry as well as simplifying the shutdown
procedure.
2015-06-09 22:01:52 -04:00
Hans-Christoph Steiner 86593df6fb rename status to STARTING and STOPPING since it also starts/stops daemons
The CONNECTING status also is starting up daemons as well as connecting to
the tor daemon.
2015-06-09 22:01:51 -04:00
Hans-Christoph Steiner a3d37e8b2a make prefs called directly when needed instead of requiring refresh
The code was using global variables that were refreshed from the prefs on
certain occasions.  That means that the global vars could easily get out of
sync with the actual values.  Instead, just read the prefs directly when
the values are needed, and they will always be up-to-date.
2015-06-09 22:01:51 -04:00
Hans-Christoph Steiner ae83f011b2 purge CMD_INIT/initialize() from TorService, an IntentService doesn't need it
when switching to an IntentService, a new Intent will always start the
Service, and onCreate() can be used to initialize the Service.
2015-06-09 22:01:51 -04:00
Hans-Christoph Steiner f09379d86c create String constants for Intent actions and extras
Following the Android system naming convention, this uses constants for
the action and extra names for Intents.  This makes it much easier to track
which "log" is which, since there are "log" actions, extras, and messages.
2015-06-09 22:01:51 -04:00
Hans-Christoph Steiner a336a294fb convert status variable to String for easy sharing in Intents
Instead of making the apps who receive the broadcasts decipher a number
scheme, send the string of the status.  Then it'll be self-documenting.
2015-06-09 21:48:54 -04:00
Nathan Freitas d6c51bcc3c Fixes for bridge setup, and root/shell interaction
- If you paste bridge addresses from Gmail, you get some strange
characters that were causing problems. This looks for that, and
other formatting related gotchas.
- This also moves all configuratino to the torrc.custom file
instead of using the control port. These changes require you to
restart anyhow, and using the torrc.custom is more reliable as it
affects the tor process on launch, and not post control port interaction.
2015-04-09 13:04:28 -04:00
Nathan Freitas 6d05e27793 Improve Bridge and VPN support, working in tandem
You can use Bridges with VPN "App Mode" proxying
On Pre-Lollipop this uses a local loop back SOCKS server to flag outbound sockets as not for the VPN network
On Lollipop+ this uses the "disallow app" feature to set anything in the Orbot process to not be sent through the VPN
2015-03-17 13:04:20 -04:00
Nathan Freitas b278b66b62 switch obfsclient to obfs4 proxy
includes supporting SOCKS outbound proxy for VPN mode
2015-03-09 15:53:02 -04:00
Nathan Freitas 068cd05836 more bridge and proxy configuration clean up 2015-02-23 12:30:13 -05:00
Nathan Freitas bff6d0f567 add support for meek PT 2015-02-14 00:44:09 -05:00
Nathan Freitas fb3e27bdcf more clean-up of VPN service code 2015-02-02 16:21:04 -05:00
Nathan Freitas cf21809052 improves in start/stop logic for background service 2014-11-17 23:28:33 -05:00
Nathan Freitas a7f458758f version build to ensure nonPIE binaries are installed 2014-11-17 14:10:33 -05:00
Nathan Freitas dbd4efe86b set values for nonPIE build 2014-11-17 11:59:49 -05:00
Nathan Freitas 5917e63693 updates for Android L and PIE binary support 2014-11-13 13:42:14 -05:00
Nathan Freitas c9bb1c2890 remove bind service and use localbroadcast instead
this should fix problems with the service being killed on unbind
2014-10-24 01:14:02 -04:00
Nathan Freitas ef98429068 update tor binary constant to force on device upgrade 2014-09-14 16:11:53 -04:00
Nathan Freitas 8ee5e9e0fb more tuning of Tor service startup and status checking 2014-09-06 00:46:57 -04:00
Nathan Freitas b307d510f8 make default SOCKs port auto, and THEN try to set specified port
- also remove exit IP lookup loop bad code
2014-08-21 09:45:13 -04:00
Nathan Freitas e2f4f5f1f2 don't make these final, because the user might change them 2014-08-12 02:02:48 -04:00
Nathan Freitas 888b7cddaa update version to latest OpenSSL 1.0.1i 2014-08-07 11:55:27 -04:00
Nathan Freitas 03b39eae7a make sure to clean up ps process/shell 2014-08-05 06:14:27 -04:00
Nathan Freitas 7ff49ff193 update Tor binary version number 2014-07-28 21:39:12 -04:00
Nathan Freitas b6715b4d3c fixes #12411 and #12412 enables DNS and transport by default
with new Orbot settings to enable user to easily change/disable
2014-06-17 15:42:54 -04:00
Nathan Freitas f91a35bbac update tor binary constants to force upgrade 2014-06-11 22:03:30 -04:00
Nathan Freitas c2be4ac15b ensure polipo conf is updated; default to 9051 for ctrl port 2014-06-11 11:26:30 -04:00
Nathan Freitas b4fa943fe9 improve process id finding using android 'toolbox' 2014-06-11 07:51:22 -04:00
Nathan Freitas af51a98535 allow support for adding custom lines to torrc 2014-06-09 18:47:48 -04:00
Nathan Freitas 22938c9ed9 multiple fixes for tor start including "auto" control port
also try to kill hung tor process
2014-06-09 18:35:08 -04:00
Nathan Freitas 451cfed0ac keep SOCKS port as default 9050 (instead of 'auto') 2014-06-06 17:01:18 -04:00
Nathan Freitas b6116b5d5a switch to 0.2.4.22 version of Tor for release 2014-06-05 11:11:39 -04:00
Nathan Freitas 7622d2cb2f update constant for 1.0.1h and latest openssl vuln
http://ccsinjection.lepidum.co.jp/blog/2014-06-05/CCS-Injection-en/index.html
2014-06-05 10:58:36 -04:00
Nathan Freitas 69614fb649 updated Tor version to 0.2.5.4-alpha
heartbleed blacklists for non-updated tor nodes
2014-05-04 00:38:29 -04:00
Nathan Freitas cbbc5e45e1 improve how we start/stop Tor, Polipo
to find process id, do ps of all, then filter (most compat)
use async service for Tor start/stop instead of threads
2014-05-01 21:36:03 -04:00
Nathan Freitas 144460beed fixes for preference handling in multi process context 2014-04-25 12:44:21 -04:00