Pier Angelo Vendrame pushed to branch tor-browser-102.2.1-12.0-1 at The Tor Project / Applications / fenix

Commits:

6 changed files:

Changes:

  • app/src/main/java/org/mozilla/fenix/components/Core.kt
    ... ... @@ -133,7 +133,8 @@ class Core(
    133 133
                 ),
    
    134 134
                 httpsOnlyMode = context.settings().getHttpsOnlyMode(),
    
    135 135
                 torSecurityLevel = context.settings().torSecurityLevel().intRepresentation,
    
    136
    -            spoofEnglish = context.settings().spoofEnglish
    
    136
    +            spoofEnglish = context.settings().spoofEnglish,
    
    137
    +            prioritizeOnions = context.settings().prioritizeOnions
    
    137 138
             )
    
    138 139
     
    
    139 140
             GeckoEngine(
    

  • app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
    ... ... @@ -429,8 +429,10 @@ class SettingsFragment : PreferenceFragmentCompat() {
    429 429
         }
    
    430 430
     
    
    431 431
         private fun setupPreferences() {
    
    432
    +        val prioritizeOnionsKey = getPreferenceKey(R.string.pref_key_tor_prioritize_onions)
    
    432 433
             val leakKey = getPreferenceKey(R.string.pref_key_leakcanary)
    
    433 434
             val debuggingKey = getPreferenceKey(R.string.pref_key_remote_debugging)
    
    435
    +        val preferencePrioritizeOnions = findPreference<Preference>(prioritizeOnionsKey)
    
    434 436
             val preferenceLeakCanary = findPreference<Preference>(leakKey)
    
    435 437
             val preferenceRemoteDebugging = findPreference<Preference>(debuggingKey)
    
    436 438
             val preferenceMakeDefaultBrowser =
    
    ... ... @@ -442,6 +444,11 @@ class SettingsFragment : PreferenceFragmentCompat() {
    442 444
                 onPreferenceChangeListener = SharedPreferenceUpdater()
    
    443 445
             }
    
    444 446
     
    
    447
    +        preferencePrioritizeOnions?.setOnPreferenceChangeListener<Boolean> { preference, newValue ->
    
    448
    +            preference.context.components.core.engine.settings.prioritizeOnions = newValue
    
    449
    +            true
    
    450
    +        }
    
    451
    +
    
    445 452
             if (!Config.channel.isReleased) {
    
    446 453
                 preferenceLeakCanary?.setOnPreferenceChangeListener { _, newValue ->
    
    447 454
                     val isEnabled = newValue == true
    

  • app/src/main/java/org/mozilla/fenix/utils/Settings.kt
    ... ... @@ -243,6 +243,11 @@ class Settings(private val appContext: Context) : PreferencesHolder {
    243 243
             default = false
    
    244 244
         )
    
    245 245
     
    
    246
    +    var prioritizeOnions by booleanPreference(
    
    247
    +        appContext.getPreferenceKey(R.string.pref_key_tor_prioritize_onions),
    
    248
    +        default = false
    
    249
    +    )
    
    250
    +
    
    246 251
         var defaultSearchEngineName by stringPreference(
    
    247 252
             appContext.getPreferenceKey(R.string.pref_key_search_engine),
    
    248 253
             default = ""
    

  • app/src/main/res/values/preference_keys.xml
    ... ... @@ -323,4 +323,6 @@
    323 323
         <string name="pref_key_tor_network_settings_bridges_enabled">pref_key_tor_network_settings_bridges_enabled</string>
    
    324 324
     
    
    325 325
         <string name="pref_key_spoof_english" translatable="false">pref_key_spoof_english</string>
    
    326
    +
    
    327
    +    <string name="pref_key_tor_prioritize_onions" translatable="false">pref_key_tor_prioritize_onions</string>
    
    326 328
     </resources>

  • app/src/main/res/values/torbrowser_strings.xml
    ... ... @@ -73,6 +73,9 @@
    73 73
         <!-- Spoof locale to English -->
    
    74 74
         <string name="tor_spoof_english">Request English versions of web pages for enhanced privacy</string>
    
    75 75
     
    
    76
    +    <!-- Onion location -->
    
    77
    +    <string name="preferences_tor_prioritize_onions">Prioritize .onion sites</string>
    
    78
    +
    
    76 79
         <!-- YEC 2022 campaign https://gitlab.torproject.org/tpo/applications/tor-browser/-/issues/41303 -->
    
    77 80
     
    
    78 81
         <!-- LOCALIZATION NOTE (yec2022_powered_by_privacy): a header for a list of things which are powered by/enabled by/possible due to privacy (each item should have positive connotations/associations in the translated languages) -->
    

  • app/src/main/res/xml/preferences.xml
    ... ... @@ -124,6 +124,11 @@
    124 124
                 android:key="@string/pref_key_tor_network_settings"
    
    125 125
                 android:title="@string/preferences_tor_network_settings" />
    
    126 126
     
    
    127
    +        <SwitchPreference
    
    128
    +            app:iconSpaceReserved="false"
    
    129
    +            android:key="@string/pref_key_tor_prioritize_onions"
    
    130
    +            android:title="@string/preferences_tor_prioritize_onions" />
    
    131
    +
    
    127 132
             <androidx.preference.Preference
    
    128 133
                 android:key="@string/pref_key_tracking_protection_settings"
    
    129 134
                 app:iconSpaceReserved="false"