From: Soren Stoutner Date: Sat, 26 Nov 2016 19:56:42 +0000 (-0700) Subject: Change the default user-agent to `PrivacyBrowser/1.0`. X-Git-Tag: v1.13~3 X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=b0ddee839c666ba339e374749588f910070658ee;p=PrivacyBrowserAndroid.git Change the default user-agent to `PrivacyBrowser/1.0`. --- diff --git a/.idea/misc.xml b/.idea/misc.xml index 1caa1363..95f0f031 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -37,7 +37,7 @@ - + diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebView.java b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebView.java index 952f5aae..1024a7db 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebView.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebView.java @@ -1560,7 +1560,7 @@ public class MainWebView extends AppCompatActivity implements NavigationView.OnN SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); // Store the values from `sharedPreferences` in variables. - String userAgentString = sharedPreferences.getString("user_agent", "Default user agent"); + String userAgentString = sharedPreferences.getString("user_agent", "PrivacyBrowser/1.0"); String customUserAgentString = sharedPreferences.getString("custom_user_agent", "PrivacyBrowser/1.0"); String javaScriptDisabledSearchString = sharedPreferences.getString("javascript_disabled_search", "https://duckduckgo.com/html/?q="); String javaScriptDisabledCustomSearchString = sharedPreferences.getString("javascript_disabled_search_custom_url", ""); 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 f1706184..535b647a 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/fragments/SettingsFragment.java +++ b/app/src/main/java/com/stoutner/privacybrowser/fragments/SettingsFragment.java @@ -60,7 +60,7 @@ public class SettingsFragment extends PreferenceFragment { // Set the current user-agent as the summary text for the "user_agent" preference when the preference screen is loaded. final Preference userAgentPreference = findPreference("user_agent"); - switch (savedPreferences.getString("user_agent", "Default user agent")) { + switch (savedPreferences.getString("user_agent", "PrivacyBrowser/1.0")) { case "Default user agent": // Get the user agent text from the webview (which changes based on the version of Android and WebView installed). userAgentPreference.setSummary(bareWebView.getSettings().getUserAgentString()); @@ -73,7 +73,7 @@ public class SettingsFragment extends PreferenceFragment { default: // Display the user agent from the preference as the summary text. - userAgentPreference.setSummary(savedPreferences.getString("user_agent", "Default user agent")); + userAgentPreference.setSummary(savedPreferences.getString("user_agent", "PrivacyBrowser/1.0")); break; } @@ -84,7 +84,7 @@ public class SettingsFragment extends PreferenceFragment { // Set the JavaScript-disabled search URL as the summary text for the JavaScript-disabled search preference when the preference screen is loaded. - // The default is "https://duckduckgo.com/html/?q=". + // The default is `https://duckduckgo.com/html/?q=`. final Preference javaScriptDisabledSearchPreference = findPreference("javascript_disabled_search"); String javaScriptDisabledSearchString = savedPreferences.getString("javascript_disabled_search", "https://duckduckgo.com/html/?q="); if (javaScriptDisabledSearchString.equals("Custom URL")) { @@ -95,14 +95,14 @@ public class SettingsFragment extends PreferenceFragment { javaScriptDisabledSearchPreference.setSummary(javaScriptDisabledSearchString); } - // Set the summary text for "javascript_disabled_search_custom_url" (the default is "") and enable it if "javascript_disabled_search" is set to "Custom URL". + // Set the summary text for `javascript_disabled_search_custom_url` (the default is `""`) and enable it if `javascript_disabled_search` is set to `Custom URL`. final Preference javaScriptDisabledSearchCustomURLPreference = findPreference("javascript_disabled_search_custom_url"); javaScriptDisabledSearchCustomURLPreference.setSummary(savedPreferences.getString("javascript_disabled_search_custom_url", "")); javaScriptDisabledSearchCustomURLPreference.setEnabled(javaScriptDisabledSearchString.equals("Custom URL")); // Set the JavaScript-enabled searchURL as the summary text for the JavaScript-enabled search preference when the preference screen is loaded. - // The default is "https://duckduckgo.com/?q=". + // The default is `https://duckduckgo.com/?q=`. final Preference javaScriptEnabledSearchPreference = findPreference("javascript_enabled_search"); String javaScriptEnabledSearchString = savedPreferences.getString("javascript_enabled_search", "https://duckduckgo.com/?q="); if (javaScriptEnabledSearchString.equals("Custom URL")) { @@ -113,7 +113,7 @@ public class SettingsFragment extends PreferenceFragment { javaScriptEnabledSearchPreference.setSummary(javaScriptEnabledSearchString); } - // Set the summary text for "javascript_enabled_search_custom_url" (the default is "") and enable it if "javascript_enabled_search" is set to "Custom URL". + // Set the summary text for `javascript_enabled_search_custom_url` (the default is `""`) and enable it if `javascript_enabled_search` is set to `Custom URL`. final Preference javaScriptEnabledSearchCustomURLPreference = findPreference("javascript_enabled_search_custom_url"); javaScriptEnabledSearchCustomURLPreference.setSummary(savedPreferences.getString("javascript_enabled_search_custom_url", "")); javaScriptEnabledSearchCustomURLPreference.setEnabled(javaScriptEnabledSearchString.equals("Custom URL")); @@ -154,7 +154,7 @@ public class SettingsFragment extends PreferenceFragment { break; case "user_agent": - String userAgentString = sharedPreferences.getString("user_agent", "Default user agent"); + String userAgentString = sharedPreferences.getString("user_agent", "PrivacyBrowser/1.0"); switch (userAgentString) { case "Default user agent": @@ -171,14 +171,14 @@ public class SettingsFragment extends PreferenceFragment { default: // Display the user agent as the summary text for userAgentPreference, and disable customUserAgent. - userAgentPreference.setSummary(sharedPreferences.getString("user_agent", "Default user agent")); + userAgentPreference.setSummary(sharedPreferences.getString("user_agent", "PrivacyBrowser/1.0")); customUserAgent.setEnabled(false); break; } break; case "custom_user_agent": - // Set the new custom user agent as the summary text for "custom_user_agent". The default is "PrivacyBrowser/1.0". + // Set the new custom user agent as the summary text for `custom_user_agent`. The default is `PrivacyBrowser/1.0`. customUserAgent.setSummary(sharedPreferences.getString("custom_user_agent", "PrivacyBrowser/1.0")); break; diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 26f9482a..7e3eb5c5 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -198,8 +198,8 @@ Mit gespeicherten Formulardaten können Formularfelder auf Websites automatisch ausgefüllt werden. User Agent - WebView-Standard Privacy Browser 1.0 + WebView-Standard Firefox 48 auf Android 6.0.1 Chrome 52 auf Android 6.0.1 Safari auf iOS 10 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 19ecf961..fc46d3de 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -198,8 +198,8 @@ Saved form data can auto-populate fields on websites. User agent - WebView Default Privacy Browser 1.0 + WebView Default Firefox 48 on Android 6.0.1 Chrome 52 on Android 6.0.1 Safari on iOS 10 @@ -214,8 +214,8 @@ Custom - Default user agent PrivacyBrowser/1.0 + Default user agent Mozilla/5.0 (Android 6.0.1; Mobile; rv:48.0) Gecko/48.0 Firefox/48.0 Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MTC20F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.98 Mobile Safari/537.36 Mozilla/5.0 (iPhone; CPU iPhone OS 10_0 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/14A5345a Safari/602.1