We got a report on our blog post (https://blog.torproject.org/comment/282217#comment-282217) mentioning that custom obfs4 bridges don't work on Android while they do on desktop. I tested with a bridge provided and can reproduce the issue.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items 0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items 0
Link issues together to show that they're related.
Learn more.
This should pick up. It will take the list of bridges from preferences in the UI (settings). I'm thinking maybe the preferences are not getting set anymore after removing the old orbot code. I'll confirm if this is the case.
In theory you should be able to put all the ClientTransportPlugin lines in there by default, even when there are no bridges set, and Tor won't launch any of them until it has a bridge that needs them.
In theory you should be able to put all the ClientTransportPlugin lines in there by default, even when there are no bridges set, and Tor won't launch any of them until it has a bridge that needs them.
FWIW, Tor Browser on desktop has used this approach ever since we switched to Tor Launcher (i.e., for a long time now). The following gets appended to the torrc-defaults file which is always loaded by TB desktop's tor:
I fixed this as part of fixing the bridge list. I took the approach suggested by arma, the plugin transport is added regardless of whether user specifies a bridge. This is a much cleaner approach.I added some unit tests for verify behavior.
This is a very tight fix, only addressing the obfs4 bug and a couple of bridge bugs. No change required for tor-android-service since the API hasn't changed. This commit does not address all issues we have with settings.
Changes
Break apart the setting of transports and bridges. Transports will be set independent of whether user has configured bridges.
Removed shuffle of bridges (addresses previous review comment)
Removed max limit on number of bridges (addresses previous review comment)
+ @SettingsConfig+ public TorConfigBuilder bridgesFromSettings() {+ List<String> supportedBridges = settings.getListOfSupportedBridges();+ if (supportedBridges == null || supportedBridges.isEmpty()) {+ return this;+ }+ String type = supportedBridges.contains("meek") ? "meek_lite" : "obfs4";}}}
This is done to filter out obfs4 bridges is meek is asked for but based on your information, I don't think we need a filter.
Do we still use both? obfs4 now has support for meek, so I assume we simply can do the same. As an example, I have this in my Tor Browser torrc:
{{{
ClientTransportPlugin meek_lite,obfs2,obfs3,obfs4,scramblesuit exec ./TorBrowser/Tor/PluggableTransports/obfs4proxy
}}}
{{{
if(hasAddedBridge) useBridges();
}}}
I don't see any other useBridges() calls, do we need an unconditional call now?
I looked through the bridge settings code. Since UseBridges is 0 by default, the following methods needs to be changed to write bridges if enabled.
There is one other use of useBridges, but I believe I can remove that as well. This MAY cause a problem with Orbot configuration but that can be resolved later as we clean up the code.I'll make a couple of changes and make a new commit.