From 70c5de02b748297473611a048b35a0f9f9f993ee Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Sat, 8 Apr 2017 23:36:11 -0700 Subject: [PATCH] Remove Torch from the list of recommended Tor search engines. Fixes https://redmine.stoutner.com/issues/119. --- .../activities/MainWebViewActivity.java | 15 ++++++--------- app/src/main/res/values-es/strings.xml | 2 -- app/src/main/res/values-it/strings.xml | 2 -- app/src/main/res/values/strings.xml | 8 ++------ 4 files changed, 8 insertions(+), 19 deletions(-) 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 70f8581d..60ff2814 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java @@ -221,9 +221,6 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation // `translucentNavigationBarOnFullscreen` is used in `onCreate()` and `applyAppSettings()`. private boolean translucentNavigationBarOnFullscreen; - // `proxyThroughOrbot` is used in `onCreate()` and `applyAppSettings()`. - private boolean proxyThroughOrbot; - // `currentDomainName` is used in `onCreate(), `onNavigationItemSelected()`, and `applyDomainSettings()`. private String currentDomainName; @@ -676,7 +673,7 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation } // Update `urlTextBox` and apply domain settings if not waiting on Orbot. - if (!waitingForOrbot && !url.startsWith("data:text/html,

")) { // Sometimes `waitingForOrbot` is reset while the Orbot message `onPageFinished()` is running, causing a race condition. For this reason we check both. + if (!waitingForOrbot) { // Check to see if `WebView` has set `url` to be `about:blank`. if (url.equals("about:blank")) { // `WebView` is blank, so `formattedUrlString` should be `""` and `urlTextBox` should display a hint. // Set `formattedUrlString` to `""`. @@ -870,9 +867,6 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation // Initialize `webViewTitle`. webViewTitle = getString(R.string.no_title); - // Apply the app settings from the shared preferences. - applyAppSettings(); - // Initialize `favoriteIconBitmap`. We have to use `ContextCompat` until API >= 21. Drawable favoriteIconDrawable = ContextCompat.getDrawable(getApplicationContext(), R.drawable.world); BitmapDrawable favoriteIconBitmapDrawable = (BitmapDrawable) favoriteIconDrawable; @@ -883,6 +877,9 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation favoriteIconBitmap = favoriteIconDefaultBitmap; } + // Apply the app settings from the shared preferences. + applyAppSettings(); + // Load `formattedUrlString` if we are not waiting for Orbot to connect. if (!waitingForOrbot) { loadUrl(formattedUrlString); @@ -1825,7 +1822,7 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation } @Override - public void onResume() { + public void onResume() { // `onResume()` also runs every time the app starts after `onCreate()` and `onStart()`. super.onResume(); // Resume JavaScript (if enabled). @@ -2137,7 +2134,7 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation adBlockerEnabled = sharedPreferences.getBoolean("block_ads", true); incognitoModeEnabled = sharedPreferences.getBoolean("incognito_mode", false); boolean doNotTrackEnabled = sharedPreferences.getBoolean("do_not_track", false); - proxyThroughOrbot = sharedPreferences.getBoolean("proxy_through_orbot", false); + boolean proxyThroughOrbot = sharedPreferences.getBoolean("proxy_through_orbot", false); fullScreenBrowsingModeEnabled = sharedPreferences.getBoolean("enable_full_screen_browsing_mode", false); hideSystemBarsOnFullscreen = sharedPreferences.getBoolean("hide_system_bars", false); translucentNavigationBarOnFullscreen = sharedPreferences.getBoolean("translucent_navigation_bar", true); diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 1f791f78..03bee800 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -239,14 +239,12 @@ Buscar en Tor con Javascript deshabilitado. DuckDuckGo - Torch Personalizado URL personalizada de búsqueda en Tor con Javascript deshabilitado Buscar en Tor con JavaScript habilitado DuckDuckGo - Torch Personalizado URL personalizada de búsqueda en Tor con JavaScript habilitado diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 92e91601..ad63e71e 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -239,14 +239,12 @@ Tor - Ricerca con JavaScript disabilitato DuckDuckGo - Torch Custom Tor - Ricerca personalizzata con JavaScript disabilitato Tor - Ricerca con JavaScript abilitato DuckDuckGo - Torch Custom Tor - Ricerca personalizzata con JavaScript abilitato diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7b41f49f..0f4d64b3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -260,24 +260,20 @@ Tor JavaScript-disabled search DuckDuckGo - Torch Custom - http://3g2upl4pq6kufc4m.onion/html/?q= - http://xmh57jrzrnw6insl.onion/4a1f6b371c/search.cgi?q= + https://3g2upl4pq6kufc4m.onion/html/?q= Custom URL Tor JavaScript-disabled search custom URL Tor JavaScript-enabled search DuckDuckGo - Torch Custom - http://3g2upl4pq6kufc4m.onion/?q= - http://xmh57jrzrnw6insl.onion/4a1f6b371c/search.cgi?q= + https://3g2upl4pq6kufc4m.onion/?q= Custom URL Tor JavaScript-enabled search custom URL -- 2.45.2