[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [Git][tpo/applications/tor-browser][tor-browser-115.6.0esr-13.5-1] fixup! Bug 42247: Android helpers for the TorProvider



Title: GitLab

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:

Changes:

  • mobile/android/geckoview/src/main/java/org/mozilla/geckoview/androidlegacysettings/Prefs.java
    ... ... @@ -49,14 +49,22 @@ import java.util.Locale;
    49 49
     
    
    50 50
         public static boolean bridgesEnabled() {
    
    51 51
             setContext();
    
    52
    +        // for Locale.getDefault().getLanguage().equals("fa"), bridges were enabled by default (and
    
    53
    +        // it was meek). This was a default set in 2019 code, but it is not a good default anymore,
    
    54
    +        // so we removed the check.
    
    52 55
             return prefs.getBoolean(PREF_BRIDGES_ENABLED, false);
    
    53 56
         }
    
    54 57
     
    
    55 58
         public static String getBridgesList() {
    
    56 59
             setContext();
    
    57
    -        // was "meek" for (Locale.getDefault().getLanguage().equals("fa")) and "obfs4" for the rest from a 2019 commit
    
    58
    -        // but that has stopped representing a good default sometime since so not importing for new users
    
    59 60
             String list = prefs.getString(PREF_BRIDGES_LIST, "");
    
    61
    +        // list might be empty if the default PT was used, so check also if bridges are enabled.
    
    62
    +        if (list.isEmpty() && prefs.getBoolean(PREF_BRIDGES_ENABLED, false)) {
    
    63
    +            // Even though the check on the fa locale is not good to enable bridges by default, we
    
    64
    +            // still check it here, because if the list was empty, it was likely that it was the
    
    65
    +            // choice for users with this locale.
    
    66
    +            return (Locale.getDefault().getLanguage().equals("fa")) ? "meek": "obfs4";
    
    67
    +        }
    
    60 68
             return list;
    
    61 69
         }
    
    62 70
     
    

  • mobile/android/geckoview/src/main/java/org/mozilla/geckoview/androidlegacysettings/TorLegacyAndroidSettings.java
    ... ... @@ -53,13 +53,11 @@ public class TorLegacyAndroidSettings {
    53 53
                 settings.bridgesSource = TorSettings.BridgeSource.BuiltIn;
    
    54 54
                 switch (userDefinedBridgeList) {
    
    55 55
                     case "obfs4":
    
    56
    -                    settings.bridgesBuiltinType = "objs4";
    
    56
    +                case "snowflake":
    
    57
    +                    settings.bridgesBuiltinType = userDefinedBridgeList;
    
    57 58
                         break;
    
    58 59
                     case "meek":
    
    59
    -                    settings.bridgesBuiltinType = "meek_azure";
    
    60
    -                    break;
    
    61
    -                case "snowflake":
    
    62
    -                    settings.bridgesBuiltinType = "snowflake";
    
    60
    +                    settings.bridgesBuiltinType = "meek-azure";
    
    63 61
                         break;
    
    64 62
                     default:
    
    65 63
                         settings.bridgesSource = TorSettings.BridgeSource.Invalid;
    

  • _______________________________________________
    tor-commits mailing list
    tor-commits@xxxxxxxxxxxxxxxxxxxx
    https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits