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.
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
This aims to make the UI more tighly in sync with the data coming from
TorService. It is not currently perfect in the UI, but it means that the
UI will represent the status bugs in TorService. This is important because
that status info is now broadcast to any app that wants it. So the visible
part of Orbot should show want the apps are seeing to aid debugging. And
status report bugs should be fixed in TorService so that everyone gets the
correctinfo.
mItemOnOff no longer exists, there is no more start/stop button on the menu
and this code was trying to update menu.getItem(0), which is currently the
settings button.
onSharedPreferenceChanged() was entirely empty, and the prefs are all
handled in their own Activity
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.
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.
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
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.
In order for apps to follow the current state of Tor, this broadcasts the
state both locally, since global broadcasts are insecure, and globally, for
any app to receive. The internal workings of Orbot need to use a local
broadcast, otherwise any app could trigger stop, start, etc or DoS in other
ways.
In order to send reliable information to any app using Tor, Orbot itself
needs reliable state broadcasts. Before, there the ON/OFF/STARTING state
were being set multiple times during the process, and sometimes not even in
a useful order (i.e. STARTING ON STARTING ON ON).
This reworks the start/stop procedure into startTor() and stopTor().
As of android-9, java.io.File has native methods for setting permissions,
inherited from Java 1.6. Using these will help deal with compatibility
across devices, since some devices might not have chmod installed.
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.
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.
When clicking on "Wizard" from the menu, then clicking back, it gets stuck
in a strange back stack purgatory, and then randomly changes the language.
So purge the wizard stuff for now, and add back the parts that are still
needed once that is all figured out.
This also simplifies the refactoring of the Intent handling.
https://stackoverflow.com/questions/13291578/how-to-localize-an-android-app-in-indonesian-language
Note that Java uses several deprecated two-letter codes. The Hebrew ("he")
language code is rewritten as "iw", Indonesian ("id") as "in", and Yiddish
("yi") as "ji". This rewriting happens even if you construct your own
Locale object, not just for instances returned by the various lookup
methods.
This leaves the default Locale unchanged, i.e. Locale.setDefault(). This
also will immediately change the language after the user selects it in the
pref.
The recommended way to send a START_TOR Intent is using
startActivityWithResult() so that the sender knows when Tor is actually
started. The return includes an Intent that can also include the config
info for the proxies that Orbot runs. Right now, this is based on the
app defaults, but ultimately, it should dynamically get the port numbers
for cases like Samsung devices where there is a port conflict.
The Languages utility class merges the techniques from ChatSecure and
Courier. It fetches the supported locales from the APK itself, and fetches
the native names of the languages from the system.
There are a couple of different times when Orbot will be unable to kill the
running processes. One example is when Orbot is running, then uninstalled,
then installed again.
closes#5254https://dev.guardianproject.info/issues/5254
Since most people using devices without Google Play will be in China, where
Google is generally blocked, instead direct people to f-droid.org unless
they have Google Play installed.
This automatically detects whether Google Play or FDroid is installed, if
so, clicking the promo app button will take the user straight to the
install page. If neither is installed, then the user is taken to the page
for that app on https://f-droid.org
- 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.
We now refresh the VPN and tun2socks interfaces when the network
type switches, and we do so in a way that does not cause traffic to leak.
The new interface is established before we close the old one.
for users in censored/filtered locations to send an email than to
access *.torproject.org through their browser. Also, even if they
can connect, the browser UI is not great.
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
- shouldn't set proxy prefs for Orweb as it conflicts with Orbot's own pref keys
- improve parsing of incoming bridge URLs, as they may not have protocol component in URI
- format strings of up/down values better
this is needed for sharing of bridge data between people in the
same physical space, or by easily sharing it through chat or other
private messaging system