From 3bc1a484194d3cbca03739cbf217dd21dd715f71 Mon Sep 17 00:00:00 2001
From: Soren Stoutner <soren@stoutner.com>
Date: Mon, 10 Sep 2018 21:32:44 -0700
Subject: [PATCH] Remove WebKit from About -> Version. 
 https://redmine.stoutner.com/issues/330

---
 .../privacybrowser/fragments/AboutTabFragment.java       | 9 +--------
 app/src/main/res/layout/about_tab_version.xml            | 5 -----
 app/src/main/res/values-de/strings.xml                   | 1 -
 app/src/main/res/values-es/strings.xml                   | 1 -
 app/src/main/res/values-it/strings.xml                   | 1 -
 app/src/main/res/values-ru/strings.xml                   | 1 -
 app/src/main/res/values/strings.xml                      | 1 -
 7 files changed, 1 insertion(+), 18 deletions(-)

diff --git a/app/src/main/java/com/stoutner/privacybrowser/fragments/AboutTabFragment.java b/app/src/main/java/com/stoutner/privacybrowser/fragments/AboutTabFragment.java
index 20045832..9b9f4fba 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/fragments/AboutTabFragment.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/fragments/AboutTabFragment.java
@@ -100,7 +100,6 @@ public class AboutTabFragment extends Fragment {
             TextView versionAndroidTextView = tabLayout.findViewById(R.id.about_version_android);
             TextView versionSecurityPatchTextView = tabLayout.findViewById(R.id.about_version_securitypatch);
             TextView versionBuildTextView = tabLayout.findViewById(R.id.about_version_build);
-            TextView versionWebKitTextView = tabLayout.findViewById(R.id.about_version_webkit);
             TextView versionChromeTextView = tabLayout.findViewById(R.id.about_version_chrome);
             TextView versionOrbotTextView = tabLayout.findViewById(R.id.about_version_orbot);
             TextView versionEasyListTextView = tabLayout.findViewById(R.id.about_version_easylist);
@@ -125,7 +124,6 @@ public class AboutTabFragment extends Fragment {
             String bootloaderLabel = getString(R.string.bootloader) + "  ";
             String androidLabel = getString(R.string.android) + "  ";
             String buildLabel = getString(R.string.build) + "  ";
-            String webKitLabel = getString(R.string.webkit) + "  ";
             String chromeLabel = getString(R.string.chrome) + "  ";
             String easyListLabel = getString(R.string.easylist_label) + "  ";
             String easyPrivacyLabel = getString(R.string.easyprivacy_label) + "  ";
@@ -154,9 +152,7 @@ public class AboutTabFragment extends Fragment {
             String radio = Build.getRadioVersion();
             String android = Build.VERSION.RELEASE + " (" + getString(R.string.api) + " " + Integer.toString(Build.VERSION.SDK_INT) + ")";
             String build = Build.DISPLAY;
-            // Select the substring that begins after "Safari/" and goes to the end of the string.
-            String webKit = userAgentString.substring(userAgentString.indexOf("Safari/") + 7);
-            // Select the substring that begins after "Chrome/" and goes until the next " ".
+            // Select the substring that begins after `Chrome/` and goes until the next ` `.
             String chrome = userAgentString.substring(userAgentString.indexOf("Chrome/") + 7, userAgentString.indexOf(" ", userAgentString.indexOf("Chrome/")));
 
             // Get the Orbot version name if Orbot is installed.
@@ -179,7 +175,6 @@ public class AboutTabFragment extends Fragment {
             SpannableStringBuilder bootloaderStringBuilder = new SpannableStringBuilder(bootloaderLabel + bootloader);
             SpannableStringBuilder androidStringBuilder = new SpannableStringBuilder(androidLabel + android);
             SpannableStringBuilder buildStringBuilder = new SpannableStringBuilder(buildLabel + build);
-            SpannableStringBuilder webKitStringBuilder = new SpannableStringBuilder(webKitLabel + webKit);
             SpannableStringBuilder chromeStringBuilder = new SpannableStringBuilder(chromeLabel + chrome);
             SpannableStringBuilder easyListStringBuilder = new SpannableStringBuilder(easyListLabel + MainWebViewActivity.easyListVersion);
             SpannableStringBuilder easyPrivacyStringBuilder = new SpannableStringBuilder(easyPrivacyLabel + MainWebViewActivity.easyPrivacyVersion);
@@ -207,7 +202,6 @@ public class AboutTabFragment extends Fragment {
             bootloaderStringBuilder.setSpan(blueColorSpan, bootloaderLabel.length(), bootloaderStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
             androidStringBuilder.setSpan(blueColorSpan, androidLabel.length(), androidStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
             buildStringBuilder.setSpan(blueColorSpan, buildLabel.length(), buildStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
-            webKitStringBuilder.setSpan(blueColorSpan, webKitLabel.length(), webKitStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
             chromeStringBuilder.setSpan(blueColorSpan, chromeLabel.length(), chromeStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
             easyListStringBuilder.setSpan(blueColorSpan, easyListLabel.length(), easyListStringBuilder.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
             easyPrivacyStringBuilder.setSpan(blueColorSpan, easyPrivacyLabel.length(), easyPrivacyStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
@@ -224,7 +218,6 @@ public class AboutTabFragment extends Fragment {
             versionBootloaderTextView.setText(bootloaderStringBuilder);
             versionAndroidTextView.setText(androidStringBuilder);
             versionBuildTextView.setText(buildStringBuilder);
-            versionWebKitTextView.setText(webKitStringBuilder);
             versionChromeTextView.setText(chromeStringBuilder);
             versionEasyListTextView.setText(easyListStringBuilder);
             versionEasyPrivacyTextView.setText(easyPrivacyStringBuilder);
diff --git a/app/src/main/res/layout/about_tab_version.xml b/app/src/main/res/layout/about_tab_version.xml
index ac900a5d..df2eccd4 100644
--- a/app/src/main/res/layout/about_tab_version.xml
+++ b/app/src/main/res/layout/about_tab_version.xml
@@ -143,11 +143,6 @@
                 android:layout_height="wrap_content"
                 android:layout_width="wrap_content" />
 
-            <TextView
-                android:id="@+id/about_version_webkit"
-                android:layout_height="wrap_content"
-                android:layout_width="wrap_content" />
-
             <TextView
                 android:id="@+id/about_version_chrome"
                 android:layout_height="wrap_content"
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index bfc071c0..7025760e 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -391,7 +391,6 @@
                 <string name="api">API</string>
             <string name="build">Build:</string>
             <string name="security_patch">Sicherheits-Patch:</string>
-            <string name="webkit">WebKit:</string>
             <string name="chrome">Chrome:</string>
             <string name="orbot">Orbot:</string>
             <string name="easylist_label">EasyList:</string>
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index 8afa404e..8cad4e19 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -492,7 +492,6 @@
                 <string name="api">API</string>
             <string name="build">Versión de compilación:</string>
             <string name="security_patch">Parche de seguridad:</string>
-            <string name="webkit">WebKit:</string>
             <string name="chrome">Chrome:</string>
             <string name="orbot">Orbot:</string>
             <string name="easylist_label">EasyList:</string>
diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml
index 0d092c31..4009ddcf 100644
--- a/app/src/main/res/values-it/strings.xml
+++ b/app/src/main/res/values-it/strings.xml
@@ -491,7 +491,6 @@
                 <string name="api">API</string>
             <string name="build">Build:</string>
             <string name="security_patch">Patch si sicurezza:</string>
-            <string name="webkit">WebKit:</string>
             <string name="chrome">Chrome:</string>
             <string name="orbot">Orbot:</string>
             <string name="easylist_label">EasyList:</string>
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index d753623c..b6a86b3c 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -489,7 +489,6 @@
                 <string name="api">API</string>
             <string name="build">Сборка:</string>
             <string name="security_patch">Патч безопасности:</string>
-            <string name="webkit">WebKit:</string>
             <string name="chrome">Chrome:</string>
             <string name="orbot">Orbot:</string>
             <string name="easylist_label">EasyList:</string>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index f370ba3b..c4fcfb96 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -562,7 +562,6 @@
                 <string name="api">API</string>
             <string name="build">Build:</string>
             <string name="security_patch">Security Patch:</string>
-            <string name="webkit">WebKit:</string>
             <string name="chrome">Chrome:</string>
             <string name="orbot">Orbot:</string>
             <string name="easylist_label">EasyList:</string>
-- 
2.47.2