[tbb-commits] [Git][tpo/applications/tor-browser][tor-browser-115.6.0esr-13.5-1] fixup! Bug 42247: Android helpers for the TorProvider
richard (@richard)
git at gitlab.torproject.org
Fri Dec 22 08:53:31 UTC 2023
richard pushed to branch tor-browser-115.6.0esr-13.5-1 at The Tor Project / Applications / Tor Browser
Commits:
0d07d3a6 by Pier Angelo Vendrame at 2023-12-22T09:45:10+01:00
fixup! Bug 42247: Android helpers for the TorProvider
Fix bridge migration.
- - - - -
2 changed files:
- mobile/android/geckoview/src/main/java/org/mozilla/geckoview/androidlegacysettings/Prefs.java
- mobile/android/geckoview/src/main/java/org/mozilla/geckoview/androidlegacysettings/TorLegacyAndroidSettings.java
Changes:
=====================================
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/androidlegacysettings/Prefs.java
=====================================
@@ -49,14 +49,22 @@ import java.util.Locale;
public static boolean bridgesEnabled() {
setContext();
+ // for Locale.getDefault().getLanguage().equals("fa"), bridges were enabled by default (and
+ // it was meek). This was a default set in 2019 code, but it is not a good default anymore,
+ // so we removed the check.
return prefs.getBoolean(PREF_BRIDGES_ENABLED, false);
}
public static String getBridgesList() {
setContext();
- // was "meek" for (Locale.getDefault().getLanguage().equals("fa")) and "obfs4" for the rest from a 2019 commit
- // but that has stopped representing a good default sometime since so not importing for new users
String list = prefs.getString(PREF_BRIDGES_LIST, "");
+ // list might be empty if the default PT was used, so check also if bridges are enabled.
+ if (list.isEmpty() && prefs.getBoolean(PREF_BRIDGES_ENABLED, false)) {
+ // Even though the check on the fa locale is not good to enable bridges by default, we
+ // still check it here, because if the list was empty, it was likely that it was the
+ // choice for users with this locale.
+ return (Locale.getDefault().getLanguage().equals("fa")) ? "meek": "obfs4";
+ }
return list;
}
=====================================
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/androidlegacysettings/TorLegacyAndroidSettings.java
=====================================
@@ -53,13 +53,11 @@ public class TorLegacyAndroidSettings {
settings.bridgesSource = TorSettings.BridgeSource.BuiltIn;
switch (userDefinedBridgeList) {
case "obfs4":
- settings.bridgesBuiltinType = "objs4";
+ case "snowflake":
+ settings.bridgesBuiltinType = userDefinedBridgeList;
break;
case "meek":
- settings.bridgesBuiltinType = "meek_azure";
- break;
- case "snowflake":
- settings.bridgesBuiltinType = "snowflake";
+ settings.bridgesBuiltinType = "meek-azure";
break;
default:
settings.bridgesSource = TorSettings.BridgeSource.Invalid;
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/0d07d3a66cfa68372d5eeb8e8d78ddc7abe38004
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/0d07d3a66cfa68372d5eeb8e8d78ddc7abe38004
You're receiving this email because of your account on gitlab.torproject.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tbb-commits/attachments/20231222/986d4174/attachment-0001.htm>
More information about the tbb-commits
mailing list