]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/commitdiff
Change the default search engine to Searx. https://redmine.stoutner.com/issues/308
authorSoren Stoutner <soren@stoutner.com>
Mon, 30 Jul 2018 23:21:01 +0000 (16:21 -0700)
committerSoren Stoutner <soren@stoutner.com>
Mon, 30 Jul 2018 23:21:01 +0000 (16:21 -0700)
app/src/main/java/com/stoutner/privacybrowser/activities/DomainsActivity.java
app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java
app/src/main/java/com/stoutner/privacybrowser/fragments/DomainsListFragment.java
app/src/main/java/com/stoutner/privacybrowser/fragments/SettingsFragment.java
app/src/main/res/values-de/strings.xml
app/src/main/res/values-es/strings.xml
app/src/main/res/values-it/strings.xml
app/src/main/res/values-ru/strings.xml
app/src/main/res/values/strings.xml
app/src/main/res/xml/preferences.xml

index cca885652f1fb04eccddabafcb71805fb62d9468..479b47a7332526c30e6d8440f51a7bb06bfb1c38 100644 (file)
@@ -507,6 +507,8 @@ public class DomainsActivity extends AppCompatActivity implements AddDomainDialo
                                 }
                             }
                         });
+
+                // Show the Snackbar.
                 undoDeleteSnackbar.show();
                 break;
         }
index d8481199b10a7499118316db311a23f1fb9882d5..bbaff98dd8f74741f5ec9830e30f34588af1731d 100644 (file)
@@ -3511,11 +3511,11 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
         SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
 
         // Store the values from the shared preferences in variables.
-        String homepageString = sharedPreferences.getString("homepage", "https://start.duckduckgo.com");
-        String torHomepageString = sharedPreferences.getString("tor_homepage", "https://3g2upl4pq6kufc4m.onion");
-        String torSearchString = sharedPreferences.getString("tor_search", "https://3g2upl4pq6kufc4m.onion/html/?q=");
+        String homepageString = sharedPreferences.getString("homepage", "https://searx.me/");
+        String torHomepageString = sharedPreferences.getString("tor_homepage", "http://ulrn6sryqaifefld.onion/");
+        String torSearchString = sharedPreferences.getString("tor_search", "http://ulrn6sryqaifefld.onion/?q=");
         String torSearchCustomURLString = sharedPreferences.getString("tor_search_custom_url", "");
-        String searchString = sharedPreferences.getString("search", "https://duckduckgo.com/html/?q=");
+        String searchString = sharedPreferences.getString("search", "https://searx.me/?q=");
         String searchCustomURLString = sharedPreferences.getString("search_custom_url", "");
         incognitoModeEnabled = sharedPreferences.getBoolean("incognito_mode", false);
         boolean doNotTrackEnabled = sharedPreferences.getBoolean("do_not_track", false);
index 3caccf529ca1c0edd842cf76926dd7c6ae3c2be5..8f50d2fc2565a06a94fa6c9878a85b57f7fa737b 100644 (file)
@@ -76,7 +76,7 @@ public class DomainsListFragment extends Fragment {
             Bundle argumentsBundle = new Bundle();
             argumentsBundle.putInt(DomainSettingsFragment.DATABASE_ID, DomainsActivity.currentDomainDatabaseId);
 
-            // Add `argumentsBundle` to `domainSettingsFragment`.
+            // Add the arguments bundle to the domain settings fragment.
             DomainSettingsFragment domainSettingsFragment = new DomainSettingsFragment();
             domainSettingsFragment.setArguments(argumentsBundle);
 
@@ -84,7 +84,7 @@ public class DomainsListFragment extends Fragment {
             if (DomainsActivity.twoPanedMode) {  // The device in in two-paned mode.
                 // enable `deleteMenuItem` if the system is not waiting for a `Snackbar` to be dismissed.
                 if (!DomainsActivity.dismissingSnackbar) {
-                    // Enable `deleteMenuItem`.
+                    // Enable the delete menu item.
                     DomainsActivity.deleteMenuItem.setEnabled(true);
 
                     // Set the delete icon according to the theme.
@@ -95,7 +95,7 @@ public class DomainsListFragment extends Fragment {
                     }
                 }
 
-                // Display `domainSettingsFragment`.
+                // Display the domain settings fragment.
                 supportFragmentManager.beginTransaction().replace(R.id.domain_settings_fragment_container, domainSettingsFragment).commit();
             } else { // The device in in single-paned mode
                 // Show `deleteMenuItem` if the system is not waiting for a `Snackbar` to be dismissed.
@@ -103,11 +103,11 @@ public class DomainsListFragment extends Fragment {
                     DomainsActivity.deleteMenuItem.setVisible(true);
                 }
 
-                // Hide `add_domain_fab`.
+                // Hide the add domain FAB.
                 FloatingActionButton addDomainFAB = getActivity().findViewById(R.id.add_domain_fab);
                 addDomainFAB.setVisibility(View.GONE);
 
-                // Display `domainSettingsFragment`.
+                // Display the domain settings fragment.
                 supportFragmentManager.beginTransaction().replace(R.id.domains_listview_fragment_container, domainSettingsFragment).commit();
             }
         });
index c8481c0b2548e0d31390fa45104e2c055055e44e..17f0bdc216b654302fdbbc2975798417333662c0 100644 (file)
@@ -96,8 +96,8 @@ public class SettingsFragment extends PreferenceFragment {
         hideSystemBarsPreference.setDependency("full_screen_browsing_mode");
 
         // Get Strings from the preferences.
-        String torSearchString = savedPreferences.getString("tor_search", "https://3g2upl4pq6kufc4m.onion/html/?q=");
-        String searchString = savedPreferences.getString("search", "https://duckduckgo.com/html/?q=");
+        String torSearchString = savedPreferences.getString("tor_search", "http://ulrn6sryqaifefld.onion/?q=");
+        String searchString = savedPreferences.getString("search", "https://searx.me/?q=");
 
         // Get booleans that are used in multiple places from the preferences.
         final boolean javaScriptEnabled = savedPreferences.getBoolean("javascript_enabled", false);
@@ -175,11 +175,11 @@ public class SettingsFragment extends PreferenceFragment {
         customUserAgentPreference.setEnabled(userAgentPreference.getSummary().equals(getString(R.string.custom_user_agent)));
 
 
-        // Set the Tor homepage URL as the summary text for the `tor_homepage` preference when the preference screen is loaded.  The default is DuckDuckGo: `https://3g2upl4pq6kufc4m.onion`.
-        torHomepagePreference.setSummary(savedPreferences.getString("tor_homepage", "https://3g2upl4pq6kufc4m.onion"));
+        // Set the Tor homepage URL as the summary text for the `tor_homepage` preference when the preference screen is loaded.  The default is Searx: `http://ulrn6sryqaifefld.onion/`.
+        torHomepagePreference.setSummary(savedPreferences.getString("tor_homepage", "http://ulrn6sryqaifefld.onion/"));
 
 
-        // Set the Tor search URL as the summary text for the Tor preference when the preference screen is loaded.  The default is `https://3g2upl4pq6kufc4m.onion/html/?q=`
+        // Set the Tor search URL as the summary text for the Tor preference when the preference screen is loaded.
         if (torSearchString.equals("Custom URL")) {
             // Use R.string.custom_url, which will be translated, instead of the array value, which will not.
             torSearchPreference.setSummary(R.string.custom_url);
@@ -195,7 +195,7 @@ public class SettingsFragment extends PreferenceFragment {
         torSearchCustomURLPreference.setEnabled(proxyThroughOrbot && torSearchString.equals("Custom URL"));
 
 
-        // Set the search URL as the summary text for the search preference when the preference screen is loaded.  The default is `https://duckduckgo.com/html/?q=`.
+        // Set the search URL as the summary text for the search preference when the preference screen is loaded.
         if (searchString.equals("Custom URL")) {
             // Use R.string.custom_url, which will be translated, instead of the array value, which will not.
             searchPreference.setSummary(R.string.custom_url);
@@ -219,7 +219,7 @@ public class SettingsFragment extends PreferenceFragment {
         clearCachePreference.setEnabled(!clearEverything);
 
         // Set the homepage URL as the summary text for the homepage preference.
-        homepagePreference.setSummary(savedPreferences.getString("homepage", "https://duckduckgo.com/?kao=-1&amp;kak=-1"));
+        homepagePreference.setSummary(savedPreferences.getString("homepage", "https://searx.me/"));
 
         // Set the default font size as the summary text for the preference.
         defaultFontSizePreference.setSummary(savedPreferences.getString("default_font_size", "100") + "%%");
@@ -1072,7 +1072,7 @@ public class SettingsFragment extends PreferenceFragment {
                 case "proxy_through_orbot":
                     // Get current settings.
                     boolean currentProxyThroughOrbot = sharedPreferences.getBoolean("proxy_through_orbot", false);
-                    String currentTorSearchString = sharedPreferences.getString("tor_search", "https://3g2upl4pq6kufc4m.onion/html/?q=");
+                    String currentTorSearchString = sharedPreferences.getString("tor_search", "http://ulrn6sryqaifefld.onion/?q=");
 
                     // Enable the Tor custom URL search option only if `currentProxyThroughOrbot` is true and the search is set to `Custom URL`.
                     torSearchCustomURLPreference.setEnabled(currentProxyThroughOrbot && currentTorSearchString.equals("Custom URL"));
@@ -1119,13 +1119,13 @@ public class SettingsFragment extends PreferenceFragment {
                     break;
 
                 case "tor_homepage":
-                    // Set the new tor homepage URL as the summary text for the `tor_homepage` preference.  The default is DuckDuckGo:  `https://3g2upl4pq6kufc4m.onion`.
-                    torHomepagePreference.setSummary(sharedPreferences.getString("tor_homepage", "https://3g2upl4pq6kufc4m.onion"));
+                    // Set the new tor homepage URL as the summary text for the `tor_homepage` preference.  The default is Searx:  `http://ulrn6sryqaifefld.onion/`.
+                    torHomepagePreference.setSummary(sharedPreferences.getString("tor_homepage", "http://ulrn6sryqaifefld.onion/"));
                     break;
 
                 case "tor_search":
                     // Get the present search string.
-                    String presentTorSearchString = sharedPreferences.getString("tor_search", "https://3g2upl4pq6kufc4m.onion/html/?q=");
+                    String presentTorSearchString = sharedPreferences.getString("tor_search", "http://ulrn6sryqaifefld.onion/?q=");
 
                     // Update the preferences.
                     if (presentTorSearchString.equals("Custom URL")) {
@@ -1164,7 +1164,7 @@ public class SettingsFragment extends PreferenceFragment {
 
                 case "search":
                     // Store the new search string.
-                    String newSearchString = sharedPreferences.getString("search", "https://duckduckgo.com/html/?q=");
+                    String newSearchString = sharedPreferences.getString("search", "https://searx.me/?q=");
 
                     // Update `searchPreference` and `searchCustomURLPreference`.
                     if (newSearchString.equals("Custom URL")) {  // `Custom URL` is selected.
@@ -1447,8 +1447,8 @@ public class SettingsFragment extends PreferenceFragment {
                     break;
 
                 case "homepage":
-                    // Set the new homepage URL as the summary text for the Homepage preference.  The default is `https://www.duckduckgo.com`.
-                    homepagePreference.setSummary(sharedPreferences.getString("homepage", "https://www.duckduckgo.com"));
+                    // Set the new homepage URL as the summary text for the Homepage preference.
+                    homepagePreference.setSummary(sharedPreferences.getString("homepage", "https://searx.me/"));
                     break;
 
                 case "default_font_size":
index 03ccd1fe836fbc557dc55cc8cbb3994cf4bbb409..8a4ec357ab4b0af9c324d6ab6011cd152e3f8118 100644 (file)
     <string name="tor">Tor</string>
         <string name="proxy_through_orbot">Proxy durch Orbot</string>
         <string name="proxy_through_orbot_summary">Sämtlichen Web-Verkehr durch Orbot mittels localhost:8118 leiten.</string>
+        <string-array name="tor_search_entries">
+            <item>Searx</item>
+            <item>DuckDuckGo - JavaScript disabled</item>
+            <item>DuckDuckGo - JavaScript enabled</item>
+            <item>Eigene</item>
+        </string-array>
     <string name="search">Suche</string>
         <string-array name="search_entries">
+            <item>Searx</item>
+            <item>StartPage</item>
             <item>DuckDuckGo - JavaScript disabled</item>
             <item>DuckDuckGo - JavaScript enabled</item>
-            <item>StartPage</item>
             <item>Qwant - JavaScript disabled</item>
             <item>Qwant - JavaScript enabled</item>
-            <item>Searx</item>
             <item>Google</item>
             <item>Bing</item>
             <item>Yahoo - JavaScript disabled</item>
index 7620f054dd353787b1a0b05ce94d205fb0177ba1..b2629d0a71c390dd4c42be0bab1ced7cb715ff0b 100644 (file)
         <string name="tor_homepage">Página de inicio de Tor</string>
         <string name="tor_search">Búsqueda en Tor</string>
         <string-array name="tor_search_entries">
+            <item>Searx</item>
             <item>DuckDuckGo - Javascript deshabilitado</item>
             <item>DuckDuckGo - Javascript habilitado</item>
             <item>Personalizado</item>
         <string name="tor_search_custom_url">URL personalizada de búsqueda en Tor</string>
     <string name="search">Búsqueda</string>
         <string-array name="search_entries">
+            <item>Searx</item>
+            <item>StartPage</item>
             <item>DuckDuckGo - Javascript deshabilitado</item>
             <item>DuckDuckGo - Javascript habilitado</item>
-            <item>StartPage</item>
             <item>Qwant - Javascript deshatilitado</item>
             <item>Qwant - Javascript habilitado</item>
-            <item>Searx</item>
             <item>Google</item>
             <item>Bing</item>
             <item>Yahoo - Javascript deshabilitado</item>
index 6c061eded87c801e038051e3029ed1df546de2bd..da628811815bc1f2011912a8b3cc2c63f66899d3 100644 (file)
         <string name="tor_homepage">Tor Homepage</string>
         <string name="tor_search">Tor - Ricerca</string>
         <string-array name="tor_search_entries">
+            <item>Searx</item>
             <item>DuckDuckGo - JavaScript disabilitato</item>
             <item>DuckDuckGo - JavaScript abilitato</item>
             <item>Personalizzata</item>
         <string name="tor_search_custom_url">Tor - Ricerca personalizzata</string>
     <string name="search">Ricerca</string>
         <string-array name="search_entries">
+            <item>Searx</item>
+            <item>StartPage</item>
             <item>DuckDuckGo - JavaScript disabilitato</item>
             <item>DuckDuckGo - JavaScript abilitato</item>
-            <item>StartPage</item>
             <item>Qwant - JavaScript disabilitato</item>
             <item>Qwant - JavaScript abilitato</item>
-            <item>Searx</item>
             <item>Google</item>
             <item>Bing</item>
             <item>Yahoo - JavaScript disabilitato</item>
index 1b48b2603154f45351f6e9df1fcfe3a1b2d38e89..b3f7cd3d694e6fa6a1862fc52651deceb9333658 100644 (file)
         <string name="tor_homepage">Домашняя страница Tor</string>
         <string name="tor_search">Поиск Tor</string>
         <string-array name="tor_search_entries">
+            <item>Searx</item>
             <item>DuckDuckGo - JavaScript выключен</item>
             <item>DuckDuckGo - JavaScript включен</item>
             <item>Настраиваемый</item>
         <string name="tor_search_custom_url">Настраиваемый URL поиска Tor</string>
     <string name="search">Поиск</string>
         <string-array name="search_entries">
+            <item>Searx</item>
+            <item>StartPage</item>
             <item>DuckDuckGo - JavaScript выключен</item>
             <item>DuckDuckGo - JavaScript включен</item>
-            <item>StartPage</item>
             <item>Qwant - JavaScript выключен</item>
             <item>Qwant - JavaScript включен</item>
-            <item>Searx</item>
             <item>Google</item>
             <item>Bing</item>
             <item>Yahoo - JavaScript выключен</item>
index d2501854b35f9e444b01f30702e70f0b368dd4c9..aefc1747220c7cd89f2d92b59b81586b8b9c6742 100644 (file)
         <string name="tor_homepage">Tor homepage</string>
         <string name="tor_search">Tor search</string>
         <string-array name="tor_search_entries">
+            <item>Searx</item>
             <item>DuckDuckGo - JavaScript disabled</item>
             <item>DuckDuckGo - JavaScript enabled</item>
             <item>Custom</item>
         </string-array>
         <string-array name="tor_search_entry_values" translatable="false">  <!-- None of the items in this `string-array` should be translated. -->
+            <item>http://ulrn6sryqaifefld.onion/?q=</item>
             <item>https://3g2upl4pq6kufc4m.onion/html/?q=</item>
             <item>https://3g2upl4pq6kufc4m.onion/?q=</item>
             <item>Custom URL</item><!-- This item must not be translated into other languages because it is referenced in code.  It is never displayed on the screen. -->
         <string name="tor_search_custom_url">Tor search custom URL</string>
     <string name="search">Search</string>
         <string-array name="search_entries">
+            <item>Searx</item>
+            <item>StartPage</item>
             <item>DuckDuckGo - JavaScript disabled</item>
             <item>DuckDuckGo - JavaScript enabled</item>
-            <item>StartPage</item>
             <item>Qwant - JavaScript disabled</item>
             <item>Qwant - JavaScript enabled</item>
-            <item>Searx</item>
             <item>Google</item>
             <item>Bing</item>
             <item>Yahoo - JavaScript disabled</item>
             <item>Custom</item>
         </string-array>
         <string-array name="search_entry_values" translatable="false">  <!-- None of the items in this `string-array` should be translated. -->
+            <item>https://searx.me/?q=</item>
+            <item>https://www.startpage.com/do/search?query=</item>
             <item>https://duckduckgo.com/html/?q=</item>
             <item>https://duckduckgo.com/?q=</item>
-            <item>https://www.startpage.com/do/search?query=</item>
             <item>https://lite.qwant.com/?q=</item>
             <item>https://www.qwant.com/?q=</item>
-            <item>https://searx.me/?q=</item>
             <item>https://www.google.com/search?q=</item>
             <item>https://www.bing.com/search?q=</item>
             <item>https://search.yahoo.com/mobile/s?nojs=1&amp;p=</item>
index d52f56c7e9a727bfb66378c82b09627e2edc0987..ecf94094280d10afa979406ed694d24b54591406 100644 (file)
         <EditTextPreference
             android:key="tor_homepage"
             android:title="@string/tor_homepage"
-            android:defaultValue="https://3g2upl4pq6kufc4m.onion/"
+            android:defaultValue="http://ulrn6sryqaifefld.onion/"
             android:inputType="textUri" />
 
         <ListPreference
             android:title="@string/tor_search"
             android:entries="@array/tor_search_entries"
             android:entryValues="@array/tor_search_entry_values"
-            android:defaultValue="https://3g2upl4pq6kufc4m.onion/html/?q=" />
+            android:defaultValue="http://ulrn6sryqaifefld.onion/?q=" />
 
         <!--suppress AndroidDomInspection -->
         <!--`suppress AndroidDomInspection` removes the error about the default value being blank. -->
             android:title="@string/search"
             android:entries="@array/search_entries"
             android:entryValues="@array/search_entry_values"
-            android:defaultValue="https://duckduckgo.com/html/?q="
+            android:defaultValue="https://searx.me/?q="
             android:icon="?attr/searchIcon" />
 
         <!--suppress AndroidDomInspection -->
         <EditTextPreference
             android:key="homepage"
             android:title="@string/homepage"
-            android:defaultValue="https://duckduckgo.com/?kao=-1&amp;kak=-1"
+            android:defaultValue="https://searx.me/"
             android:inputType="textUri"
             android:icon="?attr/homepageIcon" />