Smooth Tor setup
This is a big reworking of the Tor support to make it really easy to setup, and to make .onion addresses work automatically even when "Use Tor" is off.
I needed to make the NetCipher v1.2.1 release to support this, hence it was originally WIP:.
See merge request !216
Thread runs at normal priority by default. AsyncTasks are integrated into
Android for handling things running in the background while keeping the UI
responsive.
This reverts most of commit 828cc272ee5235f868104b009349cc7e835e144f.
Cleanup swap stuff, make more robust
While we're discussing the merits or otherwise of !208, here is some fixes to the swap workflow cherry-picked (and cleaned up) from that branch.
Although not directly reproducible, I'm confident this should fix#556 and #557.
The original assumption was that we can start the wifi local repo server, then tell the user it is connected while JmDNS is starting. The plan was for it to be very snappy, so the user could continue using the UI while bonjour was doing its stuff. However, in realtity this results in the possibility of turning swap on and off again while bonjour is still getting ready.
This now makes the user wait both when starting swap, and also when stopping swap. It will provide proper feedback to the user, do it on a background thread (properly) and update the UI when done.
Added some other misc cleanups while there.
See merge request !213
Not sure if we should be here or not in this situation, so this is
a little bit defensive. Can't bind to an IP address of `null`, so
don't bother starting LocalHTTP server unless we have an IP.
`Thread.run()` is not the correct call, changed to the correct `Thread.start()`.
Also, explicitly indicate that we want the stopping of wifi to happen in the
background.
On some devices this can take some time (i.e. a second) and the UI needs
to be disabled for that time. This should stop users quickly stopping and
starting regularly, queuing up many "start jmdns, stop jmdns, start jmdns"
calls.
These are already in its layout-v11 version. And as lint points out,
these need v11:
?android:attr/buttonBarStyle requires API level 11 (current min is 8)
?android:attr/buttonBarButtonStyle requires API level 11 (current min is 8)
Lint finds these, but it's very slow and currently we're not taking lint
errors as fatal. So for now this script will be useful, as nearly every
time I pull from weblate there are at least a couple of these.
Translators:
agilob Polish
Hsiu-Ming Chang Chinese (Taiwan)
Nathan Follens Dutch
Perry Verheij Dutch
Robin van der Vliet Dutch
Robin van der Vliet Esperanto
Verdulo Esperanto
Wathiq Qajar Arabic
We still allow them in single-line statements, like:
if (foo) bar;
for (int i : ints) bar;
Everything else should use braces to help readability and avoid silly
human mistakes that might result in bugs.
These changes were completely automated via a python script.
Search: clear focus when enter/return is pressed
Fixes#572.
Assigning to @pserwylo since he wrote the current search widget stuff.
See merge request !206