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/0d07d3a6...
tor-commits@lists.torproject.org