Matthew Finkel pushed to branch tor-browser-81.1.1-10.0-1 at The Tor Project / Applications / fenix
Commits:
-
dbb92015
by Matthew Finkel at 2020-09-30T18:34:52+00:00
-
dcb56537
by Matthew Finkel at 2020-09-30T21:15:09+00:00
-
0f1c4980
by Matthew Finkel at 2020-09-30T21:15:09+00:00
-
d54480c4
by Matthew Finkel at 2020-10-01T15:45:22+00:00
-
d7f419b3
by Matthew Finkel at 2020-10-01T15:47:50+00:00
12 changed files:
- app/src/main/java/org/mozilla/fenix/HomeActivity.kt
- app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlController.kt
- app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/onboarding/TorOnboardingSecurityLevelViewHolder.kt
- app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
- + app/src/main/java/org/mozilla/fenix/settings/TorSecurityLevelFragment.kt
- + app/src/main/java/org/mozilla/fenix/tor/SecurityLevel.kt
- app/src/main/res/layout/tor_onboarding_security_level.xml
- app/src/main/res/navigation/nav_graph.xml
- app/src/main/res/values/preference_keys.xml
- app/src/main/res/values/torbrowser_strings.xml
- app/src/main/res/xml/preferences.xml
- + app/src/main/res/xml/tor_security_level_preferences.xml
Changes:
| ... | ... | @@ -416,6 +416,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity { |
| 416 | 416 |
if (startIntent.creatorPackage == applicationContext.packageName) {
|
| 417 | 417 |
val dialog = getOrCreateDialog()
|
| 418 | 418 |
dialog.onConfirmRedirect = {
|
| 419 |
+ @Suppress("EmptyCatchBlock")
|
|
| 419 | 420 |
try {
|
| 420 | 421 |
startIntent.send()
|
| 421 | 422 |
} catch (error: PendingIntent.CanceledException) {
|
| ... | ... | @@ -367,6 +367,8 @@ class DefaultSessionControlController( |
| 367 | 367 |
}
|
| 368 | 368 |
|
| 369 | 369 |
override fun handleOpenSecurityLevelSettingsClicked() {
|
| 370 |
+ val directions = HomeFragmentDirections.actionGlobalTorSecurityLevelFragment()
|
|
| 371 |
+ navController.nav(R.id.homeFragment, directions)
|
|
| 370 | 372 |
}
|
| 371 | 373 |
|
| 372 | 374 |
override fun handleWhatsNewGetAnswersClicked() {
|
| ... | ... | @@ -8,8 +8,11 @@ import android.view.View |
| 8 | 8 |
import androidx.recyclerview.widget.RecyclerView
|
| 9 | 9 |
import kotlinx.android.synthetic.main.tor_onboarding_security_level.view.*
|
| 10 | 10 |
import org.mozilla.fenix.R
|
| 11 |
+import org.mozilla.fenix.ext.components
|
|
| 11 | 12 |
import org.mozilla.fenix.home.sessioncontrol.OnboardingInteractor
|
| 12 | 13 |
import org.mozilla.fenix.onboarding.OnboardingRadioButton
|
| 14 |
+import org.mozilla.fenix.tor.SecurityLevel
|
|
| 15 |
+import org.mozilla.fenix.tor.SecurityLevelUtil
|
|
| 13 | 16 |
import org.mozilla.fenix.utils.view.addToRadioGroup
|
| 14 | 17 |
|
| 15 | 18 |
class TorOnboardingSecurityLevelViewHolder(
|
| ... | ... | @@ -24,7 +27,7 @@ class TorOnboardingSecurityLevelViewHolder( |
| 24 | 27 |
init {
|
| 25 | 28 |
view.header_text.setOnboardingIcon(R.drawable.ic_onboarding_tracking_protection)
|
| 26 | 29 |
|
| 27 |
- standardSecurityLevel = view.security_level_standard_default
|
|
| 30 |
+ standardSecurityLevel = view.security_level_standard_option
|
|
| 28 | 31 |
saferSecurityLevel = view.security_level_safer_option
|
| 29 | 32 |
safestSecurityLevel = view.security_level_safest_option
|
| 30 | 33 |
|
| ... | ... | @@ -33,34 +36,45 @@ class TorOnboardingSecurityLevelViewHolder( |
| 33 | 36 |
)
|
| 34 | 37 |
|
| 35 | 38 |
view.open_settings_button.setOnClickListener {
|
| 36 |
- interactor.onOpenSettingsClicked()
|
|
| 39 |
+ interactor.onOpenSecurityLevelSettingsClicked()
|
|
| 37 | 40 |
}
|
| 38 | 41 |
|
| 39 |
- setupRadioGroup()
|
|
| 42 |
+ setupRadioGroup(view)
|
|
| 40 | 43 |
}
|
| 41 | 44 |
|
| 42 |
- private fun setupRadioGroup() {
|
|
| 45 |
+ private fun setupRadioGroup(view: View) {
|
|
| 43 | 46 |
|
| 44 | 47 |
addToRadioGroup(standardSecurityLevel, saferSecurityLevel, safestSecurityLevel)
|
| 45 | 48 |
|
| 46 |
- standardSecurityLevel.isChecked = true
|
|
| 47 |
- safestSecurityLevel.isChecked = false
|
|
| 48 |
- saferSecurityLevel.isChecked = false
|
|
| 49 |
+ val securityLevel = try {
|
|
| 50 |
+ SecurityLevelUtil.getSecurityLevelFromInt(
|
|
| 51 |
+ view.context.components.core.engine.settings.torSecurityLevel
|
|
| 52 |
+ )
|
|
| 53 |
+ } catch (e: IllegalStateException) {
|
|
| 54 |
+ SecurityLevel.STANDARD
|
|
| 55 |
+ }
|
|
| 56 |
+ |
|
| 57 |
+ standardSecurityLevel.isChecked = securityLevel == SecurityLevel.STANDARD
|
|
| 58 |
+ safestSecurityLevel.isChecked = securityLevel == SecurityLevel.SAFEST
|
|
| 59 |
+ saferSecurityLevel.isChecked = securityLevel == SecurityLevel.SAFER
|
|
| 49 | 60 |
|
| 50 | 61 |
standardSecurityLevel.onClickListener {
|
| 51 |
- updateSecurityLevel()
|
|
| 62 |
+ updateSecurityLevel(SecurityLevel.STANDARD)
|
|
| 52 | 63 |
}
|
| 53 | 64 |
|
| 54 | 65 |
saferSecurityLevel.onClickListener {
|
| 55 |
- updateSecurityLevel()
|
|
| 66 |
+ updateSecurityLevel(SecurityLevel.SAFER)
|
|
| 56 | 67 |
}
|
| 57 | 68 |
|
| 58 | 69 |
safestSecurityLevel.onClickListener {
|
| 59 |
- updateSecurityLevel()
|
|
| 70 |
+ updateSecurityLevel(SecurityLevel.SAFEST)
|
|
| 60 | 71 |
}
|
| 61 | 72 |
}
|
| 62 | 73 |
|
| 63 |
- private fun updateSecurityLevel() {
|
|
| 74 |
+ private fun updateSecurityLevel(newLevel: SecurityLevel) {
|
|
| 75 |
+ itemView.context.components.let {
|
|
| 76 |
+ it.core.engine.settings.torSecurityLevel = newLevel.intRepresentation
|
|
| 77 |
+ }
|
|
| 64 | 78 |
}
|
| 65 | 79 |
|
| 66 | 80 |
companion object {
|
| ... | ... | @@ -217,6 +217,9 @@ class SettingsFragment : PreferenceFragmentCompat() { |
| 217 | 217 |
resources.getString(R.string.pref_key_tor_network_settings) -> {
|
| 218 | 218 |
SettingsFragmentDirections.actionSettingsFragmentToTorNetworkSettingsFragment()
|
| 219 | 219 |
}
|
| 220 |
+ resources.getString(R.string.pref_key_tor_security_level_settings) -> {
|
|
| 221 |
+ SettingsFragmentDirections.actionSettingsFragmentToTorSecurityLevelFragment()
|
|
| 222 |
+ }
|
|
| 220 | 223 |
resources.getString(R.string.pref_key_tracking_protection_settings) -> {
|
| 221 | 224 |
requireContext().metrics.track(Event.TrackingProtectionSettings)
|
| 222 | 225 |
SettingsFragmentDirections.actionSettingsFragmentToTrackingProtectionFragment()
|
| 1 |
+/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
| 2 |
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
| 3 |
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
| 4 |
+ |
|
| 5 |
+package org.mozilla.fenix.settings
|
|
| 6 |
+ |
|
| 7 |
+import android.os.Bundle
|
|
| 8 |
+import androidx.preference.PreferenceFragmentCompat
|
|
| 9 |
+import org.mozilla.fenix.R
|
|
| 10 |
+import org.mozilla.fenix.ext.components
|
|
| 11 |
+import org.mozilla.fenix.ext.settings
|
|
| 12 |
+import org.mozilla.fenix.ext.showToolbar
|
|
| 13 |
+import org.mozilla.fenix.tor.SecurityLevel
|
|
| 14 |
+import org.mozilla.fenix.tor.SecurityLevelUtil
|
|
| 15 |
+import org.mozilla.fenix.utils.view.GroupableRadioButton
|
|
| 16 |
+import org.mozilla.fenix.utils.view.addToRadioGroup
|
|
| 17 |
+import org.mozilla.fenix.utils.view.uncheckAll
|
|
| 18 |
+ |
|
| 19 |
+/**
|
|
| 20 |
+ * Lets the user choose their security level
|
|
| 21 |
+ */
|
|
| 22 |
+@Suppress("SpreadOperator")
|
|
| 23 |
+class TorSecurityLevelFragment : PreferenceFragmentCompat() {
|
|
| 24 |
+ private val securityLevelRadioGroups = mutableListOf<GroupableRadioButton>()
|
|
| 25 |
+ private var previousSecurityLevel: SecurityLevel? = null
|
|
| 26 |
+ |
|
| 27 |
+ override fun onResume() {
|
|
| 28 |
+ super.onResume()
|
|
| 29 |
+ showToolbar(getString(R.string.preferences_tor_security_level_options))
|
|
| 30 |
+ }
|
|
| 31 |
+ |
|
| 32 |
+ override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
|
| 33 |
+ setPreferencesFromResource(R.xml.tor_security_level_preferences, rootKey)
|
|
| 34 |
+ |
|
| 35 |
+ val currentLevel: SecurityLevel? = context?.components?.let {
|
|
| 36 |
+ try {
|
|
| 37 |
+ SecurityLevelUtil.getSecurityLevelFromInt(
|
|
| 38 |
+ it.core.engine.settings.torSecurityLevel
|
|
| 39 |
+ )
|
|
| 40 |
+ } catch (e: IllegalStateException) {
|
|
| 41 |
+ // The default state is 0. If we get an invalid state then
|
|
| 42 |
+ // default to Standard (4).
|
|
| 43 |
+ SecurityLevel.STANDARD
|
|
| 44 |
+ }
|
|
| 45 |
+ }
|
|
| 46 |
+ |
|
| 47 |
+ if (currentLevel == null) {
|
|
| 48 |
+ throw IllegalStateException("context or Components is null.")
|
|
| 49 |
+ }
|
|
| 50 |
+ |
|
| 51 |
+ val radioSafer = bindSecurityLevelRadio(SecurityLevel.SAFER)
|
|
| 52 |
+ val radioSafest = bindSecurityLevelRadio(SecurityLevel.SAFEST)
|
|
| 53 |
+ val radioStandard = bindSecurityLevelRadio(SecurityLevel.STANDARD)
|
|
| 54 |
+ |
|
| 55 |
+ securityLevelRadioGroups.addAll(mutableListOf(radioSafer, radioSafest, radioStandard))
|
|
| 56 |
+ // `*` is Kotlin's "spread" operator, for expanding an Array as a vararg.
|
|
| 57 |
+ addToRadioGroup(*securityLevelRadioGroups.toTypedArray())
|
|
| 58 |
+ |
|
| 59 |
+ securityLevelRadioGroups.uncheckAll()
|
|
| 60 |
+ val securityLevelRadioButton = requirePreference<RadioButtonPreference>(currentLevel.preferenceKey)
|
|
| 61 |
+ // Cache this for later comparison in the OnPreferenceChangeListener
|
|
| 62 |
+ previousSecurityLevel = currentLevel
|
|
| 63 |
+ securityLevelRadioButton.setCheckedWithoutClickListener(true)
|
|
| 64 |
+ }
|
|
| 65 |
+ |
|
| 66 |
+ private fun bindSecurityLevelRadio(
|
|
| 67 |
+ level: SecurityLevel
|
|
| 68 |
+ ): RadioButtonPreference {
|
|
| 69 |
+ val radio = requirePreference<RadioButtonPreference>(level.preferenceKey)
|
|
| 70 |
+ |
|
| 71 |
+ radio.summary = getString(level.contentDescriptionRes)
|
|
| 72 |
+ |
|
| 73 |
+ radio.apply {
|
|
| 74 |
+ setOnPreferenceChangeListener<Boolean> { preference, isChecked ->
|
|
| 75 |
+ if (isChecked && (previousSecurityLevel!! != level)) {
|
|
| 76 |
+ preference.context.components.core.engine.settings.torSecurityLevel =
|
|
| 77 |
+ level.intRepresentation
|
|
| 78 |
+ previousSecurityLevel = level
|
|
| 79 |
+ }
|
|
| 80 |
+ true
|
|
| 81 |
+ }
|
|
| 82 |
+ }
|
|
| 83 |
+ |
|
| 84 |
+ return radio
|
|
| 85 |
+ }
|
|
| 86 |
+}
|
| 1 |
+/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
| 2 |
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
| 3 |
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
| 4 |
+ |
|
| 5 |
+package org.mozilla.fenix.tor
|
|
| 6 |
+ |
|
| 7 |
+import android.os.Parcelable
|
|
| 8 |
+import androidx.annotation.StringRes
|
|
| 9 |
+import kotlinx.android.parcel.Parcelize
|
|
| 10 |
+import org.mozilla.fenix.R
|
|
| 11 |
+ |
|
| 12 |
+@Parcelize
|
|
| 13 |
+enum class SecurityLevel(
|
|
| 14 |
+ @StringRes val preferenceKey: Int,
|
|
| 15 |
+ @StringRes val contentDescriptionRes: Int,
|
|
| 16 |
+ val intRepresentation: Int
|
|
| 17 |
+) : Parcelable {
|
|
| 18 |
+ |
|
| 19 |
+ STANDARD(
|
|
| 20 |
+ preferenceKey = R.string.pref_key_tor_security_level_standard_option,
|
|
| 21 |
+ contentDescriptionRes = R.string.tor_security_level_standard_description,
|
|
| 22 |
+ intRepresentation = SecurityLevel.SECURITY_LEVEL_STANDARD
|
|
| 23 |
+ ),
|
|
| 24 |
+ SAFER(
|
|
| 25 |
+ preferenceKey = R.string.pref_key_tor_security_level_safer_option,
|
|
| 26 |
+ contentDescriptionRes = R.string.tor_security_level_safer_description,
|
|
| 27 |
+ intRepresentation = SecurityLevel.SECURITY_LEVEL_SAFER
|
|
| 28 |
+ ),
|
|
| 29 |
+ SAFEST(
|
|
| 30 |
+ preferenceKey = R.string.pref_key_tor_security_level_safest_option,
|
|
| 31 |
+ contentDescriptionRes = R.string.tor_security_level_safest_description,
|
|
| 32 |
+ intRepresentation = SecurityLevel.SECURITY_LEVEL_SAFEST
|
|
| 33 |
+ );
|
|
| 34 |
+ |
|
| 35 |
+ companion object {
|
|
| 36 |
+ const val SECURITY_LEVEL_STANDARD = 4
|
|
| 37 |
+ const val SECURITY_LEVEL_SAFER = 2
|
|
| 38 |
+ const val SECURITY_LEVEL_SAFEST = 1
|
|
| 39 |
+ }
|
|
| 40 |
+}
|
|
| 41 |
+ |
|
| 42 |
+object SecurityLevelUtil {
|
|
| 43 |
+ fun getSecurityLevelFromInt(level: Int): SecurityLevel {
|
|
| 44 |
+ return when (level) {
|
|
| 45 |
+ SecurityLevel.SECURITY_LEVEL_STANDARD -> SecurityLevel.STANDARD
|
|
| 46 |
+ SecurityLevel.SECURITY_LEVEL_SAFER -> SecurityLevel.SAFER
|
|
| 47 |
+ SecurityLevel.SECURITY_LEVEL_SAFEST -> SecurityLevel.SAFEST
|
|
| 48 |
+ else -> throw IllegalStateException("Security Level $level is not valid")
|
|
| 49 |
+ }
|
|
| 50 |
+ }
|
|
| 51 |
+}
|
| ... | ... | @@ -37,7 +37,7 @@ |
| 37 | 37 |
|
| 38 | 38 |
|
| 39 | 39 |
<org.mozilla.fenix.onboarding.OnboardingRadioButton
|
| 40 |
- android:id="@+id/security_level_standard_default"
|
|
| 40 |
+ android:id="@+id/security_level_standard_option"
|
|
| 41 | 41 |
android:layout_width="match_parent"
|
| 42 | 42 |
android:layout_height="wrap_content"
|
| 43 | 43 |
android:layout_marginStart="16dp"
|
| ... | ... | @@ -52,9 +52,9 @@ |
| 52 | 52 |
android:theme="@style/Checkable.Colored"
|
| 53 | 53 |
app:layout_constraintStart_toStartOf="parent"
|
| 54 | 54 |
app:layout_constraintTop_toBottomOf="@id/description_text"
|
| 55 |
- app:_onboardingKey_="@string/pref_key_tor_security_level_standard_default"
|
|
| 56 |
- app:_onboardingKeyDescription_="@string/tor_onboarding_security_level_standard_button_description"
|
|
| 57 |
- app:_onboardingKeyTitle_="@string/tor_onboarding_security_level_standard_option"
|
|
| 55 |
+ app:_onboardingKey_="@string/pref_key_tor_security_level_standard_option"
|
|
| 56 |
+ app:_onboardingKeyDescription_="@string/tor_security_level_standard_description"
|
|
| 57 |
+ app:_onboardingKeyTitle_="@string/tor_security_level_standard_option"
|
|
| 58 | 58 |
tools:text="Standard" />
|
| 59 | 59 |
|
| 60 | 60 |
<org.mozilla.fenix.onboarding.OnboardingRadioButton
|
| ... | ... | @@ -73,10 +73,10 @@ |
| 73 | 73 |
android:textColor="@color/primary_state_list_text_color"
|
| 74 | 74 |
android:theme="@style/Checkable.Colored"
|
| 75 | 75 |
app:layout_constraintStart_toStartOf="parent"
|
| 76 |
- app:layout_constraintTop_toBottomOf="@id/security_level_standard_default"
|
|
| 76 |
+ app:layout_constraintTop_toBottomOf="@id/security_level_standard_option"
|
|
| 77 | 77 |
app:_onboardingKey_="@string/pref_key_tor_security_level_safer_option"
|
| 78 |
- app:_onboardingKeyDescription_="@string/tor_onboarding_security_level_safer_button_description"
|
|
| 79 |
- app:_onboardingKeyTitle_="@string/tor_onboarding_security_level_safer_option"
|
|
| 78 |
+ app:_onboardingKeyDescription_="@string/tor_security_level_safer_description"
|
|
| 79 |
+ app:_onboardingKeyTitle_="@string/tor_security_level_safer_option"
|
|
| 80 | 80 |
tools:text="Safer" />
|
| 81 | 81 |
|
| 82 | 82 |
<org.mozilla.fenix.onboarding.OnboardingRadioButton
|
| ... | ... | @@ -97,8 +97,8 @@ |
| 97 | 97 |
app:layout_constraintStart_toStartOf="parent"
|
| 98 | 98 |
app:layout_constraintTop_toBottomOf="@id/security_level_safer_option"
|
| 99 | 99 |
app:_onboardingKey_="@string/pref_key_tor_security_level_safest_option"
|
| 100 |
- app:_onboardingKeyDescription_="@string/tor_onboarding_security_level_safest_button_description"
|
|
| 101 |
- app:_onboardingKeyTitle_="@string/tor_onboarding_security_level_safest_option"
|
|
| 100 |
+ app:_onboardingKeyDescription_="@string/tor_security_level_safest_description"
|
|
| 101 |
+ app:_onboardingKeyTitle_="@string/tor_security_level_safest_option"
|
|
| 102 | 102 |
tools:text="Safest" />
|
| 103 | 103 |
|
| 104 | 104 |
<Button
|
| ... | ... | @@ -58,6 +58,9 @@ |
| 58 | 58 |
<action
|
| 59 | 59 |
android:id="@+id/action_global_syncedTabsFragment"
|
| 60 | 60 |
app:destination="@id/syncedTabsFragment" />
|
| 61 |
+ <action
|
|
| 62 |
+ android:id="@+id/action_global_torSecurityLevelFragment"
|
|
| 63 |
+ app:destination="@id/torSecurityLevelFragment" />
|
|
| 61 | 64 |
<action
|
| 62 | 65 |
android:id="@+id/action_global_privateBrowsingFragment"
|
| 63 | 66 |
app:destination="@id/privateBrowsingFragment" />
|
| ... | ... | @@ -496,6 +499,13 @@ |
| 496 | 499 |
app:exitAnim="@anim/slide_out_left"
|
| 497 | 500 |
app:popEnterAnim="@anim/slide_in_left"
|
| 498 | 501 |
app:popExitAnim="@anim/slide_out_right" />
|
| 502 |
+ <action
|
|
| 503 |
+ android:id="@+id/action_settingsFragment_to_torSecurityLevelFragment"
|
|
| 504 |
+ app:destination="@id/torSecurityLevelFragment"
|
|
| 505 |
+ app:enterAnim="@anim/slide_in_right"
|
|
| 506 |
+ app:exitAnim="@anim/slide_out_left"
|
|
| 507 |
+ app:popEnterAnim="@anim/slide_in_left"
|
|
| 508 |
+ app:popExitAnim="@anim/slide_out_right" />
|
|
| 499 | 509 |
<action
|
| 500 | 510 |
android:id="@+id/action_settingsFragment_to_privateBrowsingFragment"
|
| 501 | 511 |
app:destination="@id/privateBrowsingFragment"
|
| ... | ... | @@ -655,6 +665,10 @@ |
| 655 | 665 |
android:id="@+id/customizationFragment"
|
| 656 | 666 |
android:name="org.mozilla.fenix.settings.CustomizationFragment"
|
| 657 | 667 |
android:label="@string/preferences_customize" />
|
| 668 |
+ <fragment
|
|
| 669 |
+ android:id="@+id/torSecurityLevelFragment"
|
|
| 670 |
+ android:name="org.mozilla.fenix.settings.TorSecurityLevelFragment"
|
|
| 671 |
+ android:label="@string/preferences_tor_security_level_settings" />
|
|
| 658 | 672 |
<fragment
|
| 659 | 673 |
android:id="@+id/privateBrowsingFragment"
|
| 660 | 674 |
android:name="org.mozilla.fenix.settings.PrivateBrowsingFragment"
|
| ... | ... | @@ -223,10 +223,10 @@ |
| 223 | 223 |
<string name="pref_key_noscript_installed" translatable="false">pref_key_noscript_installed</string>
|
| 224 | 224 |
|
| 225 | 225 |
<!-- Security Level Settings -->
|
| 226 |
- <string name="pref_key_tor_security_level_standard_default" translatable="false">pref_key_tor_security_level_standard_default</string>
|
|
| 226 |
+ <string name="pref_key_tor_security_level_settings" translatable="false">pref_key_tor_security_level_settings</string>
|
|
| 227 |
+ <string name="pref_key_tor_security_level_standard_option" translatable="false">pref_key_tor_security_level_standard_option</string>
|
|
| 227 | 228 |
<string name="pref_key_tor_security_level_safer_option" translatable="false">pref_key_tor_security_level_safer_option</string>
|
| 228 | 229 |
<string name="pref_key_tor_security_level_safest_option" translatable="false">pref_key_tor_security_level_safest_option</string>
|
| 229 |
- <string name="pref_key_tor_security_level_custom_option" translatable="false">pref_key_tor_security_level_custom_option</string>
|
|
| 230 | 230 |
|
| 231 | 231 |
<string name="pref_key_tor_network_settings" translatable="false">pref_key_tor_network_settings</string>
|
| 232 | 232 |
<string name="pref_key_tor_network_settings_explanation" translatable="false">pref_key_tor_network_settings_explanation</string>
|
| ... | ... | @@ -20,12 +20,6 @@ |
| 20 | 20 |
|
| 21 | 21 |
<string name="tor_onboarding_security_level">Set your Security Level</string>
|
| 22 | 22 |
<string name="tor_onboarding_security_level_description">Disable certain web features that can be used to attack you, and harm your security, anonymity, and privacy.</string>
|
| 23 |
- <string name="tor_onboarding_security_level_standard_option">Standard</string>
|
|
| 24 |
- <string name="tor_onboarding_security_level_standard_button_description">All Tor Browser and website features are enabled.</string>
|
|
| 25 |
- <string name="tor_onboarding_security_level_safer_option">Safer</string>
|
|
| 26 |
- <string name="tor_onboarding_security_level_safer_button_description">Disable website features that are often dangerous, causing some sites to lose functionality.</string>
|
|
| 27 |
- <string name="tor_onboarding_security_level_safest_option">Safest</string>
|
|
| 28 |
- <string name="tor_onboarding_security_level_safest_button_description">Only allow website features required for static sites and basic services. These changes affect images, media, and scripts.</string>
|
|
| 29 | 23 |
<string name="tor_onboarding_security_settings_button">Open Security Settings</string>
|
| 30 | 24 |
<string name="tor_onboarding_donate_header">Donate and keep Tor safe</string>
|
| 31 | 25 |
<string name="tor_onboarding_donate_description">Tor is free to use because of donations from people like you.</string>
|
| ... | ... | @@ -59,4 +53,17 @@ |
| 59 | 53 |
<string name="preferences_tor_network_settings_connected">Connected</string>
|
| 60 | 54 |
<string name="preferences_tor_network_settings_restarting">Restarting</string>
|
| 61 | 55 |
<string name="preferences_tor_network_settings_bridges_enabled">Bridges are enabled: %s</string>
|
| 56 |
+ |
|
| 57 |
+ <!-- Preference title for security level settings -->
|
|
| 58 |
+ <string name="preferences_tor_security_level_settings">Security Settings</string>
|
|
| 59 |
+ <string name="preferences_tor_security_level_options">Security Level</string>
|
|
| 60 |
+ |
|
| 61 |
+ <!-- Description of security levels -->
|
|
| 62 |
+ <string name="tor_security_level_standard_option">Standard</string>
|
|
| 63 |
+ <string name="tor_security_level_standard_description">All Tor Browser and website features are enabled.</string>
|
|
| 64 |
+ <string name="tor_security_level_safer_option">Safer</string>
|
|
| 65 |
+ <string name="tor_security_level_safer_description">Disable website features that are often dangerous, causing some sites to lose functionality.</string>
|
|
| 66 |
+ <string name="tor_security_level_safest_option">Safest</string>
|
|
| 67 |
+ <string name="tor_security_level_safest_description">Only allow website features required for static sites and basic services. These changes affect images, media, and scripts.</string>
|
|
| 68 |
+ |
|
| 62 | 69 |
</resources>
|
| ... | ... | @@ -90,6 +90,11 @@ |
| 90 | 90 |
app:iconSpaceReserved="false"
|
| 91 | 91 |
android:layout="@layout/preference_category_main_style">
|
| 92 | 92 |
|
| 93 |
+ <androidx.preference.Preference
|
|
| 94 |
+ android:icon="@drawable/ic_tracking_protection_enabled"
|
|
| 95 |
+ android:key="@string/pref_key_tor_security_level_settings"
|
|
| 96 |
+ android:title="@string/preferences_tor_security_level_settings"/>
|
|
| 97 |
+ |
|
| 93 | 98 |
<androidx.preference.Preference
|
| 94 | 99 |
android:icon="@drawable/ic_private_browsing"
|
| 95 | 100 |
android:key="@string/pref_key_private_browsing"
|
| 1 |
+<?xml version="1.0" encoding="utf-8"?><!-- This Source Code Form is subject to the terms of the Mozilla Public
|
|
| 2 |
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
| 3 |
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
|
| 4 |
+<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
|
| 5 |
+ xmlns:app="http://schemas.android.com/apk/res-auto">
|
|
| 6 |
+ <org.mozilla.fenix.settings.RadioButtonPreference
|
|
| 7 |
+ android:defaultValue="true"
|
|
| 8 |
+ android:key="@string/pref_key_tor_security_level_standard_option"
|
|
| 9 |
+ android:summary="@string/tor_security_level_standard_description"
|
|
| 10 |
+ android:title="@string/tor_security_level_standard_option" />
|
|
| 11 |
+ <org.mozilla.fenix.settings.RadioButtonPreference
|
|
| 12 |
+ android:defaultValue="false"
|
|
| 13 |
+ android:key="@string/pref_key_tor_security_level_safer_option"
|
|
| 14 |
+ android:summary="@string/tor_security_level_safer_description"
|
|
| 15 |
+ android:title="@string/tor_security_level_safer_option" />
|
|
| 16 |
+ <org.mozilla.fenix.settings.RadioButtonPreference
|
|
| 17 |
+ android:defaultValue="false"
|
|
| 18 |
+ android:key="@string/pref_key_tor_security_level_safest_option"
|
|
| 19 |
+ android:summary="@string/tor_security_level_safest_description"
|
|
| 20 |
+ android:title="@string/tor_security_level_safest_option" />
|
|
| 21 |
+</androidx.preference.PreferenceScreen>
|