From: Soren Stoutner Date: Fri, 14 Dec 2018 20:48:33 +0000 (-0700) Subject: Update preference names. https://redmine.stoutner.com/issues/343 X-Git-Tag: v2.15~12 X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=commitdiff_plain;h=8cd4c56d559436ee6c5b81df9a411bbf211be7fd Update preference names. https://redmine.stoutner.com/issues/343 --- diff --git a/app/src/main/assets/de/about_contributors_dark.html b/app/src/main/assets/de/about_contributors_dark.html index c060e20d..90b90837 100644 --- a/app/src/main/assets/de/about_contributors_dark.html +++ b/app/src/main/assets/de/about_contributors_dark.html @@ -34,12 +34,14 @@ Hendrik Knackstedt

Mitwirkende

- Stefan Erhardt: German
Francesco Buratti: Italienisch
Jose A. León: Spanisch

Past Translators

- Aaron Gerlach: German
+ Stefan Erhardt: German
+ Aaron Gerlach: German + +

Mitwirkung ist willkommen in Form von Code und Übersetzung.

diff --git a/app/src/main/assets/de/about_contributors_light.html b/app/src/main/assets/de/about_contributors_light.html index a34228a6..1f5f9f46 100644 --- a/app/src/main/assets/de/about_contributors_light.html +++ b/app/src/main/assets/de/about_contributors_light.html @@ -34,12 +34,14 @@ Hendrik Knackstedt

Mitwirkende

- Stefan Erhardt: German
Francesco Buratti: Italienisch
Jose A. León: Spanisch

Past Translators

- Aaron Gerlach: German
+ Stefan Erhardt: German
+ Aaron Gerlach: German + +

Mitwirkung ist willkommen in Form von Code und Übersetzung.

diff --git a/app/src/main/assets/en/about_contributors_dark.html b/app/src/main/assets/en/about_contributors_dark.html index 2a3c2f61..4e4accba 100644 --- a/app/src/main/assets/en/about_contributors_dark.html +++ b/app/src/main/assets/en/about_contributors_dark.html @@ -32,13 +32,14 @@ Hendrik Knackstedt

Translators

- Stefan Erhardt: German
Francesco Buratti: Italian
Jose A. León: Spanish

Past Translators

- Aaron Gerlach: German
+ Stefan Erhardt: German
+ Aaron Gerlach: German +

Contributors are welcome to submit both code and translations.

diff --git a/app/src/main/assets/en/about_contributors_light.html b/app/src/main/assets/en/about_contributors_light.html index a664cfaa..e904b0bf 100644 --- a/app/src/main/assets/en/about_contributors_light.html +++ b/app/src/main/assets/en/about_contributors_light.html @@ -32,13 +32,14 @@ Hendrik Knackstedt

Translators

- Stefan Erhardt: German
Francesco Buratti: Italian
Jose A. León: Spanish

Past Translators

- Aaron Gerlach: German
+ Stefan Erhardt: German
+ Aaron Gerlach: German +

Contributors are welcome to submit both code and translations.

diff --git a/app/src/main/assets/es/about_contributors_dark.html b/app/src/main/assets/es/about_contributors_dark.html index 22292fc5..aa895a34 100644 --- a/app/src/main/assets/es/about_contributors_dark.html +++ b/app/src/main/assets/es/about_contributors_dark.html @@ -34,13 +34,14 @@ Hendrik Knackstedt

Traductores

- Stefan Erhardt: Alemán
Francesco Buratti: Italiano
Jose A. León: Español

Traductores anteriores

- Aaron Gerlach: Alemán
+ Stefan Erhardt: Alemán
+ Aaron Gerlach: Alemán +

Los colaboradores son bienvenidos para enviar tanto código como traducciones.

diff --git a/app/src/main/assets/es/about_contributors_light.html b/app/src/main/assets/es/about_contributors_light.html index e2f548f6..2ec2ef14 100644 --- a/app/src/main/assets/es/about_contributors_light.html +++ b/app/src/main/assets/es/about_contributors_light.html @@ -34,13 +34,14 @@ Hendrik Knackstedt

Traductores

- Stefan Erhardt: Alemán
Francesco Buratti: Italiano
Jose A. León: Español

Traductores anteriores

- Aaron Gerlach: Alemán
+ Stefan Erhardt: Alemán
+ Aaron Gerlach: Alemán +

Los colaboradores son bienvenidos para enviar tanto código como traducciones.

diff --git a/app/src/main/assets/it/about_contributors_dark.html b/app/src/main/assets/it/about_contributors_dark.html index 897e84e3..2466d651 100644 --- a/app/src/main/assets/it/about_contributors_dark.html +++ b/app/src/main/assets/it/about_contributors_dark.html @@ -34,13 +34,14 @@ Hendrik Knackstedt

Traduttori

- Stefan Erhardt: Tedesco
Francesco Buratti: Italiano
Jose A. León: Spagnolo

Traduttori precedenti

- Aaron Gerlach: Tedesco
+ Stefan Erhardt: Tedesco
+ Aaron Gerlach: Tedesco +

Si accettano contributi per lo sviluppo di codice e traduzioni.

diff --git a/app/src/main/assets/it/about_contributors_light.html b/app/src/main/assets/it/about_contributors_light.html index cdd366a5..cfa75ee1 100644 --- a/app/src/main/assets/it/about_contributors_light.html +++ b/app/src/main/assets/it/about_contributors_light.html @@ -34,13 +34,14 @@ Hendrik Knackstedt

Traduttori

- Stefan Erhardt: Tedesco
Francesco Buratti: Italiano
Jose A. León: Spagnolo

Traduttori precedenti

- Aaron Gerlach: Tedesco
+ Stefan Erhardt: Tedesco
+ Aaron Gerlach: Tedesco +

Si accettano contributi per lo sviluppo di codice e traduzioni.

diff --git a/app/src/main/assets/ru/about_contributors_dark.html b/app/src/main/assets/ru/about_contributors_dark.html index d4353b46..9be4b751 100644 --- a/app/src/main/assets/ru/about_contributors_dark.html +++ b/app/src/main/assets/ru/about_contributors_dark.html @@ -32,13 +32,14 @@ Hendrik Knackstedt

Переводчики

- Stefan Erhardt: немецкий
Francesco Buratti: итальянский
Jose A. León: испанский

Предыдущие переводчики

- Aaron Gerlach: немецкий
+ Stefan Erhardt: немецкий
+ Aaron Gerlach: немецкий +

Приглашаем помочь как кодом, так и переводом.

diff --git a/app/src/main/assets/ru/about_contributors_light.html b/app/src/main/assets/ru/about_contributors_light.html index d26a1875..7941a6fc 100644 --- a/app/src/main/assets/ru/about_contributors_light.html +++ b/app/src/main/assets/ru/about_contributors_light.html @@ -32,13 +32,14 @@ Hendrik Knackstedt

Переводчики

- Stefan Erhardt: немецкий
Francesco Buratti: итальянский
Jose A. León: испанский

Предыдущие переводчики

- Aaron Gerlach: немецкий
+ Stefan Erhardt: немецкий
+ Aaron Gerlach: немецкий +

Приглашаем помочь как кодом, так и переводом.

diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java index 16a02ad2..88e27260 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java @@ -2743,7 +2743,7 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); // Get the JavaScript preference. - javaScriptEnabled = sharedPreferences.getBoolean("javascript_enabled", false); + javaScriptEnabled = sharedPreferences.getBoolean("javascript", false); } // Apply the JavaScript setting to the WebView. @@ -4267,15 +4267,15 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook } } else { // The new URL does not have custom domain settings. Load the defaults. // Store the values from `sharedPreferences` in variables. - javaScriptEnabled = sharedPreferences.getBoolean("javascript_enabled", false); - firstPartyCookiesEnabled = sharedPreferences.getBoolean("first_party_cookies_enabled", false); - thirdPartyCookiesEnabled = sharedPreferences.getBoolean("third_party_cookies_enabled", false); - domStorageEnabled = sharedPreferences.getBoolean("dom_storage_enabled", false); - saveFormDataEnabled = sharedPreferences.getBoolean("save_form_data_enabled", false); // Form data can be removed once the minimum API >= 26. + javaScriptEnabled = sharedPreferences.getBoolean("javascript", false); + firstPartyCookiesEnabled = sharedPreferences.getBoolean("first_party_cookies", false); + thirdPartyCookiesEnabled = sharedPreferences.getBoolean("third_party_cookies", false); + domStorageEnabled = sharedPreferences.getBoolean("dom_storage", false); + saveFormDataEnabled = sharedPreferences.getBoolean("save_form_data", false); // Form data can be removed once the minimum API >= 26. easyListEnabled = sharedPreferences.getBoolean("easylist", true); easyPrivacyEnabled = sharedPreferences.getBoolean("easyprivacy", true); - fanboysAnnoyanceListEnabled = sharedPreferences.getBoolean("fanboy_annoyance_list", true); - fanboysSocialBlockingListEnabled = sharedPreferences.getBoolean("fanboy_social_blocking_list", true); + fanboysAnnoyanceListEnabled = sharedPreferences.getBoolean("fanboys_annoyance_list", true); + fanboysSocialBlockingListEnabled = sharedPreferences.getBoolean("fanboys_social_blocking_list", true); ultraPrivacyEnabled = sharedPreferences.getBoolean("ultraprivacy", true); blockAllThirdPartyRequests = sharedPreferences.getBoolean("block_all_third_party_requests", false); diff --git a/app/src/main/java/com/stoutner/privacybrowser/fragments/SettingsFragment.java b/app/src/main/java/com/stoutner/privacybrowser/fragments/SettingsFragment.java index be0d85b4..af87568b 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/fragments/SettingsFragment.java +++ b/app/src/main/java/com/stoutner/privacybrowser/fragments/SettingsFragment.java @@ -55,11 +55,11 @@ public class SettingsFragment extends PreferenceFragment { savedPreferences = getPreferenceScreen().getSharedPreferences(); // Get handles for the preferences. - final Preference javaScriptPreference = findPreference("javascript_enabled"); - final Preference firstPartyCookiesPreference = findPreference("first_party_cookies_enabled"); - final Preference thirdPartyCookiesPreference = findPreference("third_party_cookies_enabled"); - final Preference domStoragePreference = findPreference("dom_storage_enabled"); - final Preference saveFormDataPreference = findPreference("save_form_data_enabled"); // The form data preference can be removed once the minimum API >= 26. + final Preference javaScriptPreference = findPreference("javascript"); + final Preference firstPartyCookiesPreference = findPreference("first_party_cookies"); + final Preference thirdPartyCookiesPreference = findPreference("third_party_cookies"); + final Preference domStoragePreference = findPreference("dom_storage"); + final Preference saveFormDataPreference = findPreference("save_form_data"); // The form data preference can be removed once the minimum API >= 26. final Preference userAgentPreference = findPreference("user_agent"); final Preference customUserAgentPreference = findPreference("custom_user_agent"); final Preference incognitoModePreference = findPreference("incognito_mode"); @@ -67,8 +67,8 @@ public class SettingsFragment extends PreferenceFragment { final Preference allowScreenshotsPreference = findPreference("allow_screenshots"); final Preference easyListPreference = findPreference("easylist"); final Preference easyPrivacyPreference = findPreference("easyprivacy"); - final Preference fanboyAnnoyanceListPreference = findPreference("fanboy_annoyance_list"); - final Preference fanboySocialBlockingListPreference = findPreference("fanboy_social_blocking_list"); + final Preference fanboyAnnoyanceListPreference = findPreference("fanboys_annoyance_list"); + final Preference fanboySocialBlockingListPreference = findPreference("fanboys_social_blocking_list"); final Preference ultraPrivacyPreference = findPreference("ultraprivacy"); final Preference blockAllThirdPartyRequestsPreference = findPreference("block_all_third_party_requests"); final Preference proxyThroughOrbotPreference = findPreference("proxy_through_orbot"); @@ -104,11 +104,11 @@ public class SettingsFragment extends PreferenceFragment { String searchString = savedPreferences.getString("search", getString(R.string.search_default_value)); // Get booleans that are used in multiple places from the preferences. - final boolean javaScriptEnabled = savedPreferences.getBoolean("javascript_enabled", false); - boolean firstPartyCookiesEnabled = savedPreferences.getBoolean("first_party_cookies_enabled", false); - boolean thirdPartyCookiesEnabled = savedPreferences.getBoolean("third_party_cookies_enabled", false); - boolean fanboyAnnoyanceListEnabled = savedPreferences.getBoolean("fanboy_annoyance_list", true); - boolean fanboySocialBlockingEnabled = savedPreferences.getBoolean("fanboy_social_blocking_list", true); + final boolean javaScriptEnabled = savedPreferences.getBoolean("javascript", false); + boolean firstPartyCookiesEnabled = savedPreferences.getBoolean("first_party_cookies", false); + boolean thirdPartyCookiesEnabled = savedPreferences.getBoolean("third_party_cookies", false); + boolean fanboyAnnoyanceListEnabled = savedPreferences.getBoolean("fanboys_annoyance_list", true); + boolean fanboySocialBlockingEnabled = savedPreferences.getBoolean("fanboys_social_blocking_list", true); boolean proxyThroughOrbot = savedPreferences.getBoolean("proxy_through_orbot", false); boolean fullScreenBrowsingMode = savedPreferences.getBoolean("full_screen_browsing_mode", false); boolean hideSystemBars = savedPreferences.getBoolean("hide_system_bars", false); @@ -270,7 +270,7 @@ public class SettingsFragment extends PreferenceFragment { // Set the DOM storage icon. if (javaScriptEnabled || nightMode) { // The preference is enabled. - if (savedPreferences.getBoolean("dom_storage_enabled", false)) { // DOM storage is enabled. + if (savedPreferences.getBoolean("dom_storage", false)) { // DOM storage is enabled. domStoragePreference.setIcon(R.drawable.dom_storage_enabled); } else { // DOM storage is disabled. if (MainWebViewActivity.darkTheme) { @@ -289,7 +289,7 @@ public class SettingsFragment extends PreferenceFragment { // Set the save form data icon if API < 26. Save form data has no effect on API >= 26. if (Build.VERSION.SDK_INT < 26) { - if (savedPreferences.getBoolean("save_form_data_enabled", false)) { + if (savedPreferences.getBoolean("save_form_data", false)) { saveFormDataPreference.setIcon(R.drawable.form_data_enabled); } else { if (MainWebViewActivity.darkTheme) { @@ -711,9 +711,9 @@ public class SettingsFragment extends PreferenceFragment { // Listen for preference changes. preferencesListener = (SharedPreferences sharedPreferences, String key) -> { switch (key) { - case "javascript_enabled": + case "javascript": // Update the icons and the DOM storage preference status. - if (sharedPreferences.getBoolean("javascript_enabled", false)) { // The JavaScript preference is enabled. + if (sharedPreferences.getBoolean("javascript", false)) { // The JavaScript preference is enabled. // Update the icon for the JavaScript preference. javaScriptPreference.setIcon(R.drawable.javascript_enabled); @@ -721,7 +721,7 @@ public class SettingsFragment extends PreferenceFragment { domStoragePreference.setEnabled(true); // Update the icon for the DOM storage preference. - if (sharedPreferences.getBoolean("dom_storage_enabled", false)) { + if (sharedPreferences.getBoolean("dom_storage", false)) { domStoragePreference.setIcon(R.drawable.dom_storage_enabled); } else { if (MainWebViewActivity.darkTheme) { @@ -746,15 +746,15 @@ public class SettingsFragment extends PreferenceFragment { } break; - case "first_party_cookies_enabled": - // Update the icons for `first_party_cookies_enabled` and `third_party_cookies_enabled`. - if (sharedPreferences.getBoolean("first_party_cookies_enabled", false)) { - // Set the icon for `first_party_cookies_enabled`. + case "first_party_cookies": + // Update the icons for `first_party_cookies` and `third_party_cookies`. + if (sharedPreferences.getBoolean("first_party_cookies", false)) { + // Set the icon for `first_party_cookies`. firstPartyCookiesPreference.setIcon(R.drawable.cookies_enabled); - // Update the icon for `third_party_cookies_enabled`. + // Update the icon for `third_party_cookies`. if (Build.VERSION.SDK_INT >= 21) { - if (sharedPreferences.getBoolean("third_party_cookies_enabled", false)) { + if (sharedPreferences.getBoolean("third_party_cookies", false)) { thirdPartyCookiesPreference.setIcon(R.drawable.cookies_warning); } else { if (MainWebViewActivity.darkTheme) { @@ -770,15 +770,15 @@ public class SettingsFragment extends PreferenceFragment { thirdPartyCookiesPreference.setIcon(R.drawable.cookies_ghosted_light); } } - } else { // `first_party_cookies_enabled` is `false`. - // Update the icon for `first_party_cookies_enabled`. + } else { // `first_party_cookies` is `false`. + // Update the icon for `first_party_cookies`. if (MainWebViewActivity.darkTheme) { firstPartyCookiesPreference.setIcon(R.drawable.cookies_disabled_dark); } else { firstPartyCookiesPreference.setIcon(R.drawable.cookies_disabled_light); } - // Set the icon for `third_party_cookies_enabled` to be ghosted. + // Set the icon for `third_party_cookies` to be ghosted. if (MainWebViewActivity.darkTheme) { thirdPartyCookiesPreference.setIcon(R.drawable.cookies_ghosted_dark); } else { @@ -786,13 +786,13 @@ public class SettingsFragment extends PreferenceFragment { } } - // Enable `third_party_cookies_enabled` if `first_party_cookies_enabled` is `true` and API >= 21. - thirdPartyCookiesPreference.setEnabled(sharedPreferences.getBoolean("first_party_cookies_enabled", false) && (Build.VERSION.SDK_INT >= 21)); + // Enable `third_party_cookies` if `first_party_cookies` is `true` and API >= 21. + thirdPartyCookiesPreference.setEnabled(sharedPreferences.getBoolean("first_party_cookies", false) && (Build.VERSION.SDK_INT >= 21)); break; - case "third_party_cookies_enabled": + case "third_party_cookies": // Update the icon. - if (sharedPreferences.getBoolean("third_party_cookies_enabled", false)) { + if (sharedPreferences.getBoolean("third_party_cookies", false)) { thirdPartyCookiesPreference.setIcon(R.drawable.cookies_warning); } else { if (MainWebViewActivity.darkTheme) { @@ -803,9 +803,9 @@ public class SettingsFragment extends PreferenceFragment { } break; - case "dom_storage_enabled": + case "dom_storage": // Update the icon. - if (sharedPreferences.getBoolean("dom_storage_enabled", false)) { + if (sharedPreferences.getBoolean("dom_storage", false)) { domStoragePreference.setIcon(R.drawable.dom_storage_enabled); } else { if (MainWebViewActivity.darkTheme) { @@ -817,9 +817,9 @@ public class SettingsFragment extends PreferenceFragment { break; // Save form data can be removed once the minimum API >= 26. - case "save_form_data_enabled": + case "save_form_data": // Update the icon. - if (sharedPreferences.getBoolean("save_form_data_enabled", false)) { + if (sharedPreferences.getBoolean("save_form_data", false)) { saveFormDataPreference.setIcon(R.drawable.form_data_enabled); } else { if (MainWebViewActivity.darkTheme) { @@ -990,9 +990,9 @@ public class SettingsFragment extends PreferenceFragment { } break; - case "fanboy_annoyance_list": - boolean currentFanboyAnnoyanceList = sharedPreferences.getBoolean("fanboy_annoyance_list", true); - boolean currentFanboySocialBlockingList = sharedPreferences.getBoolean("fanboy_social_blocking_list", true); + case "fanboys_annoyance_list": + boolean currentFanboyAnnoyanceList = sharedPreferences.getBoolean("fanboys_annoyance_list", true); + boolean currentFanboySocialBlockingList = sharedPreferences.getBoolean("fanboys_social_blocking_list", true); // Update the Fanboy icons. if (currentFanboyAnnoyanceList) { // Fanboy's annoyance list is enabled. @@ -1037,9 +1037,9 @@ public class SettingsFragment extends PreferenceFragment { fanboySocialBlockingListPreference.setEnabled(!currentFanboyAnnoyanceList); break; - case "fanboy_social_blocking_list": + case "fanboys_social_blocking_list": // Update the icon. - if (sharedPreferences.getBoolean("fanboy_social_blocking_list", true)) { + if (sharedPreferences.getBoolean("fanboys_social_blocking_list", true)) { if (MainWebViewActivity.darkTheme) { fanboySocialBlockingListPreference.setIcon(R.drawable.social_media_enabled_dark); } else { @@ -1553,7 +1553,7 @@ public class SettingsFragment extends PreferenceFragment { // Store the current night mode status. boolean currentNightModeBoolean = sharedPreferences.getBoolean("night_mode", false); - boolean currentJavaScriptBoolean = sharedPreferences.getBoolean("javascript_enabled", false); + boolean currentJavaScriptBoolean = sharedPreferences.getBoolean("javascript", false); // Update the icon. if (currentNightModeBoolean) { @@ -1581,9 +1581,9 @@ public class SettingsFragment extends PreferenceFragment { javaScriptPreference.setIcon(R.drawable.privacy_mode); } - // Update the `domStoragePreference` icon. + // Update the DOM storage preference icon. if (currentNightModeBoolean || currentJavaScriptBoolean) { // The preference is enabled. - if (sharedPreferences.getBoolean("dom_storage_enabled", false)) { // DOM storage is enabled. + if (sharedPreferences.getBoolean("dom_storage", false)) { // DOM storage is enabled. domStoragePreference.setIcon(R.drawable.dom_storage_enabled); } else { // DOM storage is disabled. if (MainWebViewActivity.darkTheme) { diff --git a/app/src/main/java/com/stoutner/privacybrowser/helpers/DomainsDatabaseHelper.java b/app/src/main/java/com/stoutner/privacybrowser/helpers/DomainsDatabaseHelper.java index 2ed01cb4..9494d991 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/helpers/DomainsDatabaseHelper.java +++ b/app/src/main/java/com/stoutner/privacybrowser/helpers/DomainsDatabaseHelper.java @@ -161,8 +161,8 @@ public class DomainsDatabaseHelper extends SQLiteOpenHelper { // Get the default block list settings. boolean easyListEnabled = sharedPreferences.getBoolean("easylist", true); boolean easyPrivacyEnabled = sharedPreferences.getBoolean("easyprivacy", true); - boolean fanboyAnnoyanceListEnabled = sharedPreferences.getBoolean("fanboy_annoyance_list", true); - boolean fanboySocialBlockingListEnabled = sharedPreferences.getBoolean("fanboy_social_blocking_list", true); + boolean fanboyAnnoyanceListEnabled = sharedPreferences.getBoolean("fanboys_annoyance_list", true); + boolean fanboySocialBlockingListEnabled = sharedPreferences.getBoolean("fanboys_social_blocking_list", true); // Set EasyList for existing rows according to the current system-wide default. if (easyListEnabled) { @@ -276,15 +276,15 @@ public class DomainsDatabaseHelper extends SQLiteOpenHelper { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(appContext); // Get the default settings. - boolean javaScriptEnabled = sharedPreferences.getBoolean("javascript_enabled", false); - boolean firstPartyCookiesEnabled = sharedPreferences.getBoolean("first_party_cookies_enabled", false); - boolean thirdPartyCookiesEnabled = sharedPreferences.getBoolean("third_party_cookies_enabled", false); - boolean domStorageEnabled = sharedPreferences.getBoolean("dom_storage_enabled", false); - boolean saveFormDataEnabled = sharedPreferences.getBoolean("save_form_data_enabled", false); // Form data can be removed once the minimum API >= 26. + boolean javaScriptEnabled = sharedPreferences.getBoolean("javascript", false); + boolean firstPartyCookiesEnabled = sharedPreferences.getBoolean("first_party_cookies", false); + boolean thirdPartyCookiesEnabled = sharedPreferences.getBoolean("third_party_cookies", false); + boolean domStorageEnabled = sharedPreferences.getBoolean("dom_storage", false); + boolean saveFormDataEnabled = sharedPreferences.getBoolean("save_form_data", false); // Form data can be removed once the minimum API >= 26. boolean easyListEnabled = sharedPreferences.getBoolean("easylist", true); boolean easyPrivacyEnabled = sharedPreferences.getBoolean("easyprivacy", true); - boolean fanboyAnnoyanceListEnabled = sharedPreferences.getBoolean("fanboy_annoyance_list", true); - boolean fanboySocialBlockingListEnabled = sharedPreferences.getBoolean("fanboy_social_blocking_list", true); + boolean fanboyAnnoyanceListEnabled = sharedPreferences.getBoolean("fanboys_annoyance_list", true); + boolean fanboySocialBlockingListEnabled = sharedPreferences.getBoolean("fanboys_social_blocking_list", true); boolean ultraPrivacyEnabled = sharedPreferences.getBoolean("ultraprivacy", true); boolean blockAllThirdPartyRequests = sharedPreferences.getBoolean("block_all_third_party_requests", false); diff --git a/app/src/main/java/com/stoutner/privacybrowser/helpers/ImportExportDatabaseHelper.java b/app/src/main/java/com/stoutner/privacybrowser/helpers/ImportExportDatabaseHelper.java index 1312f8a1..5f8dcee0 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/helpers/ImportExportDatabaseHelper.java +++ b/app/src/main/java/com/stoutner/privacybrowser/helpers/ImportExportDatabaseHelper.java @@ -236,11 +236,11 @@ public class ImportExportDatabaseHelper { // Create a ContentValues with the preferences information. ContentValues preferencesContentValues = new ContentValues(); - preferencesContentValues.put(JAVASCRIPT, sharedPreferences.getBoolean("javascript_enabled", false)); - preferencesContentValues.put(FIRST_PARTY_COOKIES, sharedPreferences.getBoolean("first_party_cookies_enabled", false)); - preferencesContentValues.put(THIRD_PARTY_COOKIES, sharedPreferences.getBoolean("third_party_cookies_enabled", false)); - preferencesContentValues.put(DOM_STORAGE, sharedPreferences.getBoolean("dom_storage_enabled", false)); - preferencesContentValues.put(SAVE_FORM_DATA, sharedPreferences.getBoolean("save_form_data_enabled", false)); // Save form data can be removed once the minimum API >= 26. + preferencesContentValues.put(JAVASCRIPT, sharedPreferences.getBoolean(JAVASCRIPT, false)); + preferencesContentValues.put(FIRST_PARTY_COOKIES, sharedPreferences.getBoolean(FIRST_PARTY_COOKIES, false)); + preferencesContentValues.put(THIRD_PARTY_COOKIES, sharedPreferences.getBoolean(THIRD_PARTY_COOKIES, false)); + preferencesContentValues.put(DOM_STORAGE, sharedPreferences.getBoolean(DOM_STORAGE, false)); + preferencesContentValues.put(SAVE_FORM_DATA, sharedPreferences.getBoolean(SAVE_FORM_DATA, false)); // Save form data can be removed once the minimum API >= 26. preferencesContentValues.put(USER_AGENT, sharedPreferences.getString(USER_AGENT, context.getString(R.string.user_agent_default_value))); preferencesContentValues.put(CUSTOM_USER_AGENT, sharedPreferences.getString(CUSTOM_USER_AGENT, context.getString(R.string.custom_user_agent_default_value))); preferencesContentValues.put(INCOGNITO_MODE, sharedPreferences.getBoolean(INCOGNITO_MODE, false)); @@ -248,8 +248,8 @@ public class ImportExportDatabaseHelper { preferencesContentValues.put(ALLOW_SCREENSHOTS, sharedPreferences.getBoolean(ALLOW_SCREENSHOTS, false)); preferencesContentValues.put(EASYLIST, sharedPreferences.getBoolean(EASYLIST, true)); preferencesContentValues.put(EASYPRIVACY, sharedPreferences.getBoolean(EASYPRIVACY, true)); - preferencesContentValues.put(FANBOYS_ANNOYANCE_LIST, sharedPreferences.getBoolean("fanboy_annoyance_list", true)); - preferencesContentValues.put(FANBOYS_SOCIAL_BLOCKING_LIST, sharedPreferences.getBoolean("fanboy_social_blocking_list", true)); + preferencesContentValues.put(FANBOYS_ANNOYANCE_LIST, sharedPreferences.getBoolean(FANBOYS_ANNOYANCE_LIST, true)); + preferencesContentValues.put(FANBOYS_SOCIAL_BLOCKING_LIST, sharedPreferences.getBoolean(FANBOYS_SOCIAL_BLOCKING_LIST, true)); preferencesContentValues.put(ULTRAPRIVACY, sharedPreferences.getBoolean(ULTRAPRIVACY, true)); preferencesContentValues.put(BLOCK_ALL_THIRD_PARTY_REQUESTS, sharedPreferences.getBoolean(BLOCK_ALL_THIRD_PARTY_REQUESTS, false)); preferencesContentValues.put(PROXY_THROUGH_ORBOT, sharedPreferences.getBoolean(PROXY_THROUGH_ORBOT, false)); @@ -367,7 +367,7 @@ public class ImportExportDatabaseHelper { // Upgrade from schema version 2. case 2: - // Once the SQLite version is >= 3.25.0 `ALTER TABLE RENAME` can be used. https://www.sqlite.org/lang_altertable.html https://www.sqlite.org/changes.html + // Once the SQLite version is >= 3.25.0 `ALTER TABLE RENAME COLUMN` can be used. https://www.sqlite.org/lang_altertable.html https://www.sqlite.org/changes.html // https://developer.android.com/reference/android/database/sqlite/package-summary // In the meantime, we can create a new column with the new name. There is no need to delete the old column on the temporary import database. @@ -498,12 +498,12 @@ public class ImportExportDatabaseHelper { // Import the preference data. sharedPreferences.edit() - .putBoolean("javascript_enabled", importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(JAVASCRIPT)) == 1) - .putBoolean("first_party_cookies_enabled", importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(FIRST_PARTY_COOKIES)) == 1) - .putBoolean("third_party_cookies_enabled", importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(THIRD_PARTY_COOKIES)) == 1) - .putBoolean("dom_storage_enabled", importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(DOM_STORAGE)) == 1) + .putBoolean(JAVASCRIPT, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(JAVASCRIPT)) == 1) + .putBoolean(FIRST_PARTY_COOKIES, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(FIRST_PARTY_COOKIES)) == 1) + .putBoolean(THIRD_PARTY_COOKIES, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(THIRD_PARTY_COOKIES)) == 1) + .putBoolean(DOM_STORAGE, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(DOM_STORAGE)) == 1) // Save form data can be removed once the minimum API >= 26. - .putBoolean("save_form_data_enabled", importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(SAVE_FORM_DATA)) == 1) + .putBoolean(SAVE_FORM_DATA, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(SAVE_FORM_DATA)) == 1) .putString(USER_AGENT, importPreferencesCursor.getString(importPreferencesCursor.getColumnIndex(USER_AGENT))) .putString(CUSTOM_USER_AGENT, importPreferencesCursor.getString(importPreferencesCursor.getColumnIndex(CUSTOM_USER_AGENT))) .putBoolean(INCOGNITO_MODE, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(INCOGNITO_MODE)) == 1) @@ -511,8 +511,8 @@ public class ImportExportDatabaseHelper { .putBoolean(ALLOW_SCREENSHOTS, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(ALLOW_SCREENSHOTS)) == 1) .putBoolean(EASYLIST, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(EASYLIST)) == 1) .putBoolean(EASYPRIVACY, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(EASYPRIVACY)) == 1) - .putBoolean("fanboy_annoyance_list", importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(FANBOYS_ANNOYANCE_LIST)) == 1) - .putBoolean("fanboy_social_blocking_list", importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(FANBOYS_SOCIAL_BLOCKING_LIST)) == 1) + .putBoolean(FANBOYS_ANNOYANCE_LIST, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(FANBOYS_ANNOYANCE_LIST)) == 1) + .putBoolean(FANBOYS_SOCIAL_BLOCKING_LIST, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(FANBOYS_SOCIAL_BLOCKING_LIST)) == 1) .putBoolean(ULTRAPRIVACY, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(ULTRAPRIVACY)) == 1) .putBoolean(BLOCK_ALL_THIRD_PARTY_REQUESTS, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(BLOCK_ALL_THIRD_PARTY_REQUESTS)) == 1) .putBoolean(PROXY_THROUGH_ORBOT, importPreferencesCursor.getInt(importPreferencesCursor.getColumnIndex(PROXY_THROUGH_ORBOT)) == 1) diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index b0404343..8c24d1a7 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -24,32 +24,32 @@ android:title="@string/privacy" > @@ -105,13 +105,13 @@ android:defaultValue="true" /> diff --git a/fastlane/metadata/android/en-US/images/icon.png b/fastlane/metadata/android/en-US/images/icon.png index 7cde566f..eecb13ea 100644 Binary files a/fastlane/metadata/android/en-US/images/icon.png and b/fastlane/metadata/android/en-US/images/icon.png differ