diff options
author | Guillaume Jacquart <guillaume.jacquart-ext@mousquetaires.com> | 2022-11-28 18:35:45 +0100 |
---|---|---|
committer | Guillaume Jacquart <guillaume.jacquart-ext@mousquetaires.com> | 2022-11-28 18:42:54 +0100 |
commit | cde9ed0b42898f9f87004dda337b9ce7cf46d3cf (patch) | |
tree | c36759a313267b950be2fc72227e1051a1fecf91 /app/src | |
parent | 2f40c62572be0fffa04fe6cf105ece937389e287 (diff) |
5903: move ipscrambling speed message to warning dialog.
Diffstat (limited to 'app/src')
9 files changed, 5 insertions, 37 deletions
diff --git a/app/src/main/java/foundation/e/privacycentralapp/data/repositories/LocalStateRepository.kt b/app/src/main/java/foundation/e/privacycentralapp/data/repositories/LocalStateRepository.kt index 6cb4f81..ed97c94 100644 --- a/app/src/main/java/foundation/e/privacycentralapp/data/repositories/LocalStateRepository.kt +++ b/app/src/main/java/foundation/e/privacycentralapp/data/repositories/LocalStateRepository.kt @@ -81,10 +81,6 @@ class LocalStateRepository(context: Context) { private val _ipScramblingSetting = MutableStateFlow(sharedPref.getBoolean(KEY_IP_SCRAMBLING, false)) val ipScramblingSetting = _ipScramblingSetting.asStateFlow() - fun isIpScramblingFirstActivation(enabled: Boolean): Boolean { - return enabled && !sharedPref.contains(KEY_IP_SCRAMBLING) - } - fun setIpScramblingSetting(enabled: Boolean) { set(KEY_IP_SCRAMBLING, enabled) _ipScramblingSetting.update { enabled } diff --git a/app/src/main/java/foundation/e/privacycentralapp/domain/usecases/GetQuickPrivacyStateUseCase.kt b/app/src/main/java/foundation/e/privacycentralapp/domain/usecases/GetQuickPrivacyStateUseCase.kt index 85410d0..e2c0e7f 100644 --- a/app/src/main/java/foundation/e/privacycentralapp/domain/usecases/GetQuickPrivacyStateUseCase.kt +++ b/app/src/main/java/foundation/e/privacycentralapp/domain/usecases/GetQuickPrivacyStateUseCase.kt @@ -81,11 +81,8 @@ class GetQuickPrivacyStateUseCase( localStateRepository.setFakeLocationEnabled(!localStateRepository.fakeLocationEnabled.value) } - fun toggleIpScramblingIsFirstActivation(): Boolean { - val enabled = !localStateRepository.ipScramblingSetting.value - val firstActivation = localStateRepository.isIpScramblingFirstActivation(enabled) - localStateRepository.setIpScramblingSetting(enabled) - return firstActivation + fun toggleIpScrambling() { + localStateRepository.setIpScramblingSetting(!localStateRepository.ipScramblingSetting.value) } val otherVpnRunning: SharedFlow<ApplicationDescription> = localStateRepository.otherVpnRunning diff --git a/app/src/main/java/foundation/e/privacycentralapp/features/dashboard/DashboardViewModel.kt b/app/src/main/java/foundation/e/privacycentralapp/features/dashboard/DashboardViewModel.kt index 57e7790..18b4212 100644 --- a/app/src/main/java/foundation/e/privacycentralapp/features/dashboard/DashboardViewModel.kt +++ b/app/src/main/java/foundation/e/privacycentralapp/features/dashboard/DashboardViewModel.kt @@ -94,7 +94,7 @@ class DashboardViewModel( fetchStatistics().first() } is Action.ToggleLocation -> getPrivacyStateUseCase.toggleLocation() - is Action.ToggleIpScrambling -> actionToggleIpScrambling() + is Action.ToggleIpScrambling -> getPrivacyStateUseCase.toggleIpScrambling() is Action.ShowFakeMyLocationAction -> _singleEvents.emit(SingleEvent.NavigateToLocationSingleEvent) is Action.ShowAppsPermissions -> @@ -123,16 +123,6 @@ class DashboardViewModel( } } - private suspend fun actionToggleIpScrambling() = withContext(Dispatchers.IO) { - val isFirstActivation = getPrivacyStateUseCase.toggleIpScramblingIsFirstActivation() - - if (isFirstActivation) _singleEvents.emit( - SingleEvent.ToastMessageSingleEvent( - message = R.string.dashboard_first_ipscrambling_activation - ) - ) - } - private suspend fun actionShowMostLeakedApp() = withContext(Dispatchers.IO) { _singleEvents.emit( trackersStatisticsUseCase.getMostLeakedApp()?.let { diff --git a/app/src/main/java/foundation/e/privacycentralapp/widget/WidgetCommandReceiver.kt b/app/src/main/java/foundation/e/privacycentralapp/widget/WidgetCommandReceiver.kt index 4a103e0..e01f47f 100644 --- a/app/src/main/java/foundation/e/privacycentralapp/widget/WidgetCommandReceiver.kt +++ b/app/src/main/java/foundation/e/privacycentralapp/widget/WidgetCommandReceiver.kt @@ -20,9 +20,7 @@ package foundation.e.privacycentralapp.widget import android.content.BroadcastReceiver import android.content.Context import android.content.Intent -import android.widget.Toast import foundation.e.privacycentralapp.PrivacyCentralApplication -import foundation.e.privacycentralapp.R class WidgetCommandReceiver : BroadcastReceiver() { override fun onReceive(context: Context?, intent: Intent?) { @@ -31,15 +29,7 @@ class WidgetCommandReceiver : BroadcastReceiver() { when (intent?.action) { ACTION_TOGGLE_TRACKERS -> getQuickPrivacyStateUseCase?.toggleTrackers() ACTION_TOGGLE_LOCATION -> getQuickPrivacyStateUseCase?.toggleLocation() - ACTION_TOGGLE_IPSCRAMBLING -> { - if (getQuickPrivacyStateUseCase?.toggleIpScramblingIsFirstActivation() == true) { - Toast.makeText( - context, - context.getString(R.string.dashboard_first_ipscrambling_activation), - Toast.LENGTH_LONG - ).show() - } - } + ACTION_TOGGLE_IPSCRAMBLING -> getQuickPrivacyStateUseCase?.toggleIpScrambling() else -> {} } } diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 75e3ce4..fc067de 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -78,7 +78,6 @@ <string name="first_notification_summary">Tippe, um herauszufinden, wie Tracker einfach blockiert, dein Standort gefälscht und deine IP-Adresse verschleiert werden kann.</string> <string name="dashboard_state_title_custom">Benutzerdefinierte Datenschutz-Einstellungen werden angewendet</string> <string name="close">Schließen</string> - <string name="dashboard_first_ipscrambling_activation">Das Verschleiern deiner IP wird möglicherweise die Internetgeschwindigkeit verlangsamen.</string> <string name="widget_state_title_custom">Benutzerdefinierte Datenschutz-Einstellungen werden angewandt</string> <string name="widget_graph_view_trackers">Ansicht</string> <string name="dashboard_graph_leaking_app">Ansicht</string> diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index 3b9a53f..68d8d01 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -50,7 +50,6 @@ <string name="dashboard_apps_permissions_title">Hallitse sovellusten käyttöoikeuksia</string> <string name="dashboard_am_i_tracked_subtitle">%1$d sovellus seurainta, %2$d sallittua seurainta</string> <string name="dashboard_am_i_tracked_title">Hallitse sovellusten seuraimia</string> - <string name="dashboard_first_ipscrambling_activation">Kun IP-osoitteesi on väärennetty, Internetyhteytesi nopeus todennäköisesti heikkenee.</string> <string name="dashboard_graph_leaking_app">Näytä</string> <string name="dashboard_graph_trackers_legend">%s seurainta on profiloinut tietojasi viimeisen 24 tunnin aikana</string> <string name="dashboard_graph_period">Tänään</string> diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index fdd8468..b884e5b 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -66,7 +66,6 @@ \n \n\"Gérer ma position\" vous permet d\'utiliser une fausse position au lieu de votre position réelle. De cette façon, votre localisation réelle n\'est pas partagé avec des applications qui pourraient vous espionner.</string> <string name="trackers_info">Les pisteurs sont des morceaux de code cachés dans les applications. Ils collectent vos données et suivent votre activité 24h/24 et 7j/7. Découvrez les pisteurs actifs et bloquez-les tous pour une meilleure protection. Pour éviter le dysfonctionnement de certaines applications, vous pouvez également choisir spécifiquement les pisteurs que vous souhaitez bloquer.</string> - <string name="dashboard_first_ipscrambling_activation">Votre vitesse Internet risque d\'être réduite tant que votre adresse IP est masquée.</string> <string name="graph_legend_allowed">Fuites autorisées</string> <string name="graph_legend_blocked">Fuites bloquées</string> <string name="graph_subtitle">Appuyez sur les barres pour plus d\'informations.</string> diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index ee23327..2c44ff2 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -73,7 +73,6 @@ <string name="widget_state_title_off">La tua privavy online non è protetta</string> <string name="widget_state_title_on">La tua privacy online è protetta</string> <string name="apptrackers_error_no_app">App non installata.</string> - <string name="dashboard_first_ipscrambling_activation">Mentre l\'indirizzo IP è nascosto, la velocità su Internet risulta rallentata.</string> <string name="dashboard_graph_leaking_app">Guarda</string> <string name="dashboard_state_title_custom">Impostazioni della privacy personalizzate applicate</string> <string name="close">Chiudi</string> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b1d241d..4d6e1f9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -30,7 +30,6 @@ <string name="dashboard_graph_period">Today</string> <string name="dashboard_graph_trackers_legend">%s trackers have profiled you in the last 24 hours</string> <string name="dashboard_graph_leaking_app">View</string> - <string name="dashboard_first_ipscrambling_activation">While your IP is faked, your Internet speed is likely to be reduced.</string> <string name="dashboard_am_i_tracked_title">Manage apps\' trackers</string> <string name="dashboard_am_i_tracked_subtitle">%1$d detected trackers, %2$d allowed trackers</string> <string name="dashboard_apps_permissions_title">Manage apps\' permissions</string> @@ -100,7 +99,7 @@ <string name="warningdialog_location_title">Fake my location</string> <string name="warningdialog_location_message">While this option is active, some apps that rely on your real location may not work properly. It\'s recommended to enable it only occasionally, only when needed.</string> <string name="warningdialog_ipscrambling_title">Hide my IP</string> - <string name="warningdialog_ipscrambling_message">This option uses the TOR network to hide your real IP address. Only use it for specific applications. <b>Important:</b> we advise disabling this feature for email services as your address may end into permanent ban from your provider.</string> + <string name="warningdialog_ipscrambling_message">This option uses the TOR network to hide your real IP address. Only use it for specific applications. While your IP is faked, your Internet speed is likely to be reduced.\n<b>Important:</b> we advise disabling this feature for email services as your address may end into permanent ban from your provider.</string> <string name="warningdialog_ipscrambling_cta">I understand</string> <!-- Widget --> |