Display the IP Address in the View SSL Certificate dialog. https://redmine.stoutner...
authorSoren Stoutner <soren@stoutner.com>
Wed, 23 Jan 2019 22:51:43 +0000 (15:51 -0700)
committerSoren Stoutner <soren@stoutner.com>
Wed, 23 Jan 2019 22:51:43 +0000 (15:51 -0700)
12 files changed:
.idea/dictionaries/soren.xml
app/src/free/res/values-tr/strings.xml [new file with mode: 0644]
app/src/main/assets/it/about_licenses_dark.html
app/src/main/assets/it/about_licenses_light.html
app/src/main/assets/ru/about_licenses_dark.html
app/src/main/assets/ru/about_licenses_light.html
app/src/main/java/com/stoutner/privacybrowser/activities/ViewSourceActivity.java
app/src/main/java/com/stoutner/privacybrowser/dialogs/MoveToFolderDialog.java
app/src/main/java/com/stoutner/privacybrowser/dialogs/ViewSslCertificateDialog.java
app/src/main/res/layout/view_ssl_certificate.xml
app/src/main/res/values-tr/strings.xml
app/src/main/res/values/strings.xml

index 6bd3f77..87f9d7e 100644 (file)
@@ -80,6 +80,7 @@
       <w>homescreen</w>
       <w>huawei</w>
       <w>imageview</w>
+      <w>inet</w>
       <w>intl</w>
       <w>ipleak</w>
       <w>isfolder</w>
diff --git a/app/src/free/res/values-tr/strings.xml b/app/src/free/res/values-tr/strings.xml
new file mode 100644 (file)
index 0000000..58048a9
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+  Copyright © 2015-2019 Soren Stoutner <soren@stoutner.com>.
+
+  This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
+
+  Privacy Browser is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  Privacy Browser is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with Privacy Browser.  If not, see <http://www.gnu.org/licenses/>. -->
+
+<resources>
+    <!-- Activities. -->
+    <string name="privacy_browser">Privacy Browser Ücretsiz</string>
+
+    <!-- Ad Consent. -->
+    <string name="ad_consent_text">Privacy Browser Ücretsiz ekranın altında bir banner reklam gösterir.
+    Bu reklamlar, Google\'ın sık kullanılan sağlayıcılarından gelmektedir ve kişiselleştirilmeyecek şekilde yapılandırılmıştır.
+    \n\nPrivacy Browser standart versiyonu uygulama reklamları içermez.</string>
+    <string name="close_browser">Tarayıcıyı kapat</string>
+    <string name="accept_ads">Reklamları kabul et</string>
+</resources>
\ No newline at end of file
index b9244d9..caba0d3 100644 (file)
         <h3>Librerie</h3>
         <p>Privacy Browser è sviluppato con la <a href="https://developer.android.com/topic/libraries/support-library/index.html">Android Support Library</a>,
             che è rilasciata con <a href="https://www.apache.org/licenses/LICENSE-2.0">Licenza Apache 2.0</a>.</p>
-        <p>The free flavor of Privacy Browser is built with <a href="https://mvnrepository.com/artifact/com.google.firebase/firebase-ads">Firebase Ads</a>,
-            which is released under the <a href="https://developer.android.com/studio/terms">Android Software Development Kit License</a>.</p>
-
-        <h3>Classes</h3>
-        <p><code>com.stoutner.privacybrowser.views.CheckedLinearLayout</code> is a modified version of a class contained in the
-            <a href="https://android.googlesource.com/platform/packages/apps/Camera/+/master/src/com/android/camera/ui/CheckedLinearLayout.java">Android Camera</a> source code.
-            The original file was released under the <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>.
-            The modified file is released under the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+ license</a>.</p>
+        <p>La versione gratuita di Privacy Browser è compilata con <a href="https://mvnrepository.com/artifact/com.google.firebase/firebase-ads">Firebase Ads</a>,
+            che è rilasciato sotto la <a href="https://developer.android.com/studio/terms">Licenza Android Software Development Kit</a>.</p>
+
+        <h3>Classi</h3>
+        <p><code>com.stoutner.privacybrowser.views.CheckedLinearLayout</code> è la versione modificata di una classe contenuta nel codice sorgente della
+            <a href="https://android.googlesource.com/platform/packages/apps/Camera/+/master/src/com/android/camera/ui/CheckedLinearLayout.java">Fotocamera Android</a>.
+            Il file originale è stato rilasciato sotto la <a href="https://www.apache.org/licenses/LICENSE-2.0">Licenza Apache 2.0</a>.
+            Il file modificato è rilasciato sotto la <a href="https://www.gnu.org/licenses/gpl-3.0.html">Licenza GPLv3+</a>.</p>
 
         <h3>Icone</h3>
         <p><img class="left" src="../shared_images/privacy_browser.png"> <img class="left" src="../shared_images/privacy_browser_free.png"> <img class="left" src="../shared_images/warning.png">
index 6759c41..3b92019 100644 (file)
         <h3>Librerie</h3>
         <p>Privacy Browser è sviluppato con la <a href="https://developer.android.com/topic/libraries/support-library/index.html">Android Support Library</a>,
             che è rilasciata con <a href="https://www.apache.org/licenses/LICENSE-2.0">Licenza Apache 2.0</a>.</p>
-        <p>The free flavor of Privacy Browser is built with <a href="https://mvnrepository.com/artifact/com.google.firebase/firebase-ads">Firebase Ads</a>,
-            which is released under the <a href="https://developer.android.com/studio/terms">Android Software Development Kit License</a>.</p>
-
-        <h3>Classes</h3>
-        <p><code>com.stoutner.privacybrowser.views.CheckedLinearLayout</code> is a modified version of a class contained in the
-            <a href="https://android.googlesource.com/platform/packages/apps/Camera/+/master/src/com/android/camera/ui/CheckedLinearLayout.java">Android Camera</a> source code.
-            The original file was released under the <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>.
-            The modified file is released under the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+ license</a>.</p>
+        <p>La versione gratuita di Privacy Browser è compilata con <a href="https://mvnrepository.com/artifact/com.google.firebase/firebase-ads">Firebase Ads</a>,
+            che è rilasciato sotto la <a href="https://developer.android.com/studio/terms">Licenza Android Software Development Kit</a>.</p>
+
+        <h3>Classi</h3>
+        <p><code>com.stoutner.privacybrowser.views.CheckedLinearLayout</code> è la versione modificata di una classe contenuta nel codice sorgente della
+            <a href="https://android.googlesource.com/platform/packages/apps/Camera/+/master/src/com/android/camera/ui/CheckedLinearLayout.java">Fotocamera Android</a>.
+            Il file originale è stato rilasciato sotto la <a href="https://www.apache.org/licenses/LICENSE-2.0">Licenza Apache 2.0</a>.
+            Il file modificato è rilasciato sotto la <a href="https://www.gnu.org/licenses/gpl-3.0.html">Licenza GPLv3+</a>.</p>
 
         <h3>Icone</h3>
         <p><img class="left" src="../shared_images/privacy_browser.png"> <img class="left" src="../shared_images/privacy_browser_free.png"> <img class="left" src="../shared_images/warning.png">
index 2fdeef6..d2ed014 100644 (file)
         <h3>Библиотеки</h3>
         <p>Privacy Browser создан с использованием <a href="https://developer.android.com/topic/libraries/support-library/index.html">Android Support Library</a>,
             которая выпущена под <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>.</p>
-        <p>The free flavor of Privacy Browser is built with <a href="https://mvnrepository.com/artifact/com.google.firebase/firebase-ads">Firebase Ads</a>,
-            which is released under the <a href="https://developer.android.com/studio/terms">Android Software Development Kit License</a>.</p>
-
-        <h3>Classes</h3>
-        <p><code>com.stoutner.privacybrowser.views.CheckedLinearLayout</code> is a modified version of a class contained in the
-            <a href="https://android.googlesource.com/platform/packages/apps/Camera/+/master/src/com/android/camera/ui/CheckedLinearLayout.java">Android Camera</a> source code.
-            The original file was released under the <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>.
-            The modified file is released under the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+ license</a>.</p>
+        <p>Бесплатный вариант Privacy Browser создан с помощью <a href="https://mvnrepository.com/artifact/com.google.firebase/firebase-ads">Firebase Ads</a>,
+            выпущенной по лицензии <a href="https://developer.android.com/studio/terms">Android Software Development Kit License</a>.</p>
+
+        <h3>Классы</h3>
+        <p><code>com.stoutner.privacybrowser.views.CheckedLinearLayout</code> является модифицированной версией класса, содержащегося в исходном коде
+            <a href="https://android.googlesource.com/platform/packages/apps/Camera/+/master/src/com/android/camera/ui/CheckedLinearLayout.java">Android Camera</a>.
+            Оригинальный файл был выпущен под лицензией <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache 2.0</a>.
+            Модифицированный файл выпущен под лицензией <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+</a>.</p>
 
         <h3>Иконки</h3>
         <p><img class="left" src="../shared_images/privacy_browser.png"> <img class="left" src="../shared_images/privacy_browser_free.png"> <img class="left" src="../shared_images/warning.png">
index 3aacc9a..5408995 100644 (file)
         <h3>Библиотеки</h3>
         <p>Privacy Browser создан с использованием <a href="https://developer.android.com/topic/libraries/support-library/index.html">Android Support Library</a>,
             которая выпущена под <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>.</p>
-        <p>The free flavor of Privacy Browser is built with <a href="https://mvnrepository.com/artifact/com.google.firebase/firebase-ads">Firebase Ads</a>,
-            which is released under the <a href="https://developer.android.com/studio/terms">Android Software Development Kit License</a>.</p>
-
-        <h3>Classes</h3>
-        <p><code>com.stoutner.privacybrowser.views.CheckedLinearLayout</code> is a modified version of a class contained in the
-            <a href="https://android.googlesource.com/platform/packages/apps/Camera/+/master/src/com/android/camera/ui/CheckedLinearLayout.java">Android Camera</a> source code.
-            The original file was released under the <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>.
-            The modified file is released under the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+ license</a>.</p>
+        <p>Бесплатный вариант Privacy Browser создан с помощью <a href="https://mvnrepository.com/artifact/com.google.firebase/firebase-ads">Firebase Ads</a>,
+            выпущенной по лицензии <a href="https://developer.android.com/studio/terms">Android Software Development Kit License</a>.</p>
+
+        <h3>Классы</h3>
+        <p><code>com.stoutner.privacybrowser.views.CheckedLinearLayout</code> является модифицированной версией класса, содержащегося в исходном коде
+            <a href="https://android.googlesource.com/platform/packages/apps/Camera/+/master/src/com/android/camera/ui/CheckedLinearLayout.java">Android Camera</a>.
+            Оригинальный файл был выпущен под лицензией <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache 2.0</a>.
+            Модифицированный файл выпущен под лицензией <a href="https://www.gnu.org/licenses/gpl-3.0.html">GPLv3+</a>.</p>
 
         <h3>Иконки</h3>
         <p><img class="left" src="../shared_images/privacy_browser.png"> <img class="left" src="../shared_images/privacy_browser_free.png"> <img class="left" src="../shared_images/warning.png">
index db9bf79..50e7d65 100644 (file)
@@ -181,7 +181,7 @@ public class ViewSourceActivity extends AppCompatActivity {
             // Get the URL.
             String url = urlEditText.getText().toString();
 
-            // Get new source data for the URL if it begins with `http`/
+            // Get new source data for the URL if it begins with `http`.
             if (url.startsWith("http")) {
                 new GetSource(this).execute(url);
             } else {
index 5149534..28d0fa5 100644 (file)
@@ -165,7 +165,7 @@ public class MoveToFolderDialog extends AppCompatDialogFragment {
                 }
             }
 
-            // Get a `Cursor` containing the folders to display.
+            // Get a cursor containing the folders to display.
             foldersCursor = bookmarksDatabaseHelper.getFoldersExcept(exceptFolders.toString());
 
             // Setup `foldersCursorAdaptor` with `this` context.  `false` disables autoRequery.
index 90a1327..c236d3a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2016-2018 Soren Stoutner <soren@stoutner.com>.
+ * Copyright © 2016-2019 Soren Stoutner <soren@stoutner.com>.
  *
  * This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
  *
@@ -20,6 +20,7 @@
 package com.stoutner.privacybrowser.dialogs;
 
 import android.annotation.SuppressLint;
+import android.app.Activity;
 import android.app.AlertDialog;
 import android.app.Dialog;
 import android.app.DialogFragment;
@@ -27,6 +28,7 @@ import android.graphics.drawable.BitmapDrawable;
 import android.graphics.drawable.Drawable;
 import android.net.Uri;
 import android.net.http.SslCertificate;
+import android.os.AsyncTask;
 import android.os.Bundle;
 import android.text.SpannableStringBuilder;
 import android.text.Spanned;
@@ -38,6 +40,9 @@ import android.widget.TextView;
 import com.stoutner.privacybrowser.activities.MainWebViewActivity;
 import com.stoutner.privacybrowser.R;
 
+import java.lang.ref.WeakReference;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
 import java.text.DateFormat;
 import java.util.Calendar;
 import java.util.Date;
@@ -113,8 +118,9 @@ public class ViewSslCertificateDialog extends DialogFragment {
             // The alert dialog must be shown before items in the layout can be modified.
             alertDialog.show();
 
-            // Get handles for the `TextViews`.
+            // Get handles for the text views.
             TextView domainTextView = alertDialog.findViewById(R.id.domain);
+            TextView ipAddressesTextView = alertDialog.findViewById(R.id.ip_addresses);
             TextView issuedToCNameTextView = alertDialog.findViewById(R.id.issued_to_cname);
             TextView issuedToONameTextView = alertDialog.findViewById(R.id.issued_to_oname);
             TextView issuedToUNameTextView = alertDialog.findViewById(R.id.issued_to_uname);
@@ -132,43 +138,46 @@ public class ViewSslCertificateDialog extends DialogFragment {
             String startDateLabel = getString(R.string.start_date) + "  ";
             String endDateLabel = getString(R.string.end_date) + "  ";
 
-            // Parse `formattedUrlString` to a `URI`.
+            // Convert the formatted URL string to a URI.
             Uri uri = Uri.parse(MainWebViewActivity.formattedUrlString);
 
-            // Extract the domain name from `uri`.
+            // Extract the domain name from the URI.
             String domainString = uri.getHost();
 
+            // Get the IP addresses.
+            new GetIpAddresses(getActivity(), alertDialog).execute(domainString);
+
             // Get the SSL certificate.
             SslCertificate sslCertificate = MainWebViewActivity.sslCertificate;
 
             // Get the strings from the SSL certificate.
-            String issuedToCNameString = sslCertificate.getIssuedTo().getCName();
-            String issuedToONameString = sslCertificate.getIssuedTo().getOName();
-            String issuedToUNameString = sslCertificate.getIssuedTo().getUName();
-            String issuedByCNameString = sslCertificate.getIssuedBy().getCName();
-            String issuedByONameString = sslCertificate.getIssuedBy().getOName();
-            String issuedByUNameString = sslCertificate.getIssuedBy().getUName();
+            String issuedToCName = sslCertificate.getIssuedTo().getCName();
+            String issuedToOName = sslCertificate.getIssuedTo().getOName();
+            String issuedToUName = sslCertificate.getIssuedTo().getUName();
+            String issuedByCName = sslCertificate.getIssuedBy().getCName();
+            String issuedByOName = sslCertificate.getIssuedBy().getOName();
+            String issuedByUName = sslCertificate.getIssuedBy().getUName();
             Date startDate = sslCertificate.getValidNotBeforeDate();
             Date endDate = sslCertificate.getValidNotAfterDate();
 
-            // Create a `SpannableStringBuilder` for each `TextView` that needs multiple colors of text.
+            // Create spannable string builders for each text view that needs multiple colors of text.
             SpannableStringBuilder domainStringBuilder = new SpannableStringBuilder(domainLabel + domainString);
-            SpannableStringBuilder issuedToCNameStringBuilder = new SpannableStringBuilder(cNameLabel + issuedToCNameString);
-            SpannableStringBuilder issuedToONameStringBuilder = new SpannableStringBuilder(oNameLabel + issuedToONameString);
-            SpannableStringBuilder issuedToUNameStringBuilder = new SpannableStringBuilder(uNameLabel + issuedToUNameString);
-            SpannableStringBuilder issuedByCNameStringBuilder = new SpannableStringBuilder(cNameLabel + issuedByCNameString);
-            SpannableStringBuilder issuedByONameStringBuilder = new SpannableStringBuilder(oNameLabel + issuedByONameString);
-            SpannableStringBuilder issuedByUNameStringBuilder = new SpannableStringBuilder(uNameLabel + issuedByUNameString);
+            SpannableStringBuilder issuedToCNameStringBuilder = new SpannableStringBuilder(cNameLabel + issuedToCName);
+            SpannableStringBuilder issuedToONameStringBuilder = new SpannableStringBuilder(oNameLabel + issuedToOName);
+            SpannableStringBuilder issuedToUNameStringBuilder = new SpannableStringBuilder(uNameLabel + issuedToUName);
+            SpannableStringBuilder issuedByCNameStringBuilder = new SpannableStringBuilder(cNameLabel + issuedByCName);
+            SpannableStringBuilder issuedByONameStringBuilder = new SpannableStringBuilder(oNameLabel + issuedByOName);
+            SpannableStringBuilder issuedByUNameStringBuilder = new SpannableStringBuilder(uNameLabel + issuedByUName);
             SpannableStringBuilder startDateStringBuilder = new SpannableStringBuilder(startDateLabel + DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.LONG).format(startDate));
             SpannableStringBuilder endDateStringBuilder = new SpannableStringBuilder(endDateLabel + DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.LONG).format(endDate));
 
-            // Create a red `ForegroundColorSpan`.  We have to use the deprecated `getColor` until API >= 23.
+            // Create a red foreground color span.  The deprecated `getColor` must be used until the minimum API >= 23.
             @SuppressWarnings("deprecation") ForegroundColorSpan redColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.red_a700));
 
-            // Create a blue `ForegroundColorSpan`.
+            // Create a blue foreground color span.
             ForegroundColorSpan blueColorSpan;
 
-            // Set `blueColorSpan` according to the theme.  We have to use the deprecated `getColor()` until API >= 23.
+            // Set the blue color span according to the theme.  The deprecated `getColor()` must be used until the minimum API >= 23.
             if (MainWebViewActivity.darkTheme) {
                 //noinspection deprecation
                 blueColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.blue_400));
@@ -177,14 +186,17 @@ public class ViewSslCertificateDialog extends DialogFragment {
                 blueColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.blue_700));
             }
 
+            // Remove the incorrect lint error that `.equals` might produce a NullPointerException.
+            assert domainString != null;
+
             // Formet the `domainString` and `issuedToCName` colors.
-            if (domainString.equals(issuedToCNameString)) {  // `domainString` and `issuedToCNameString` match.
+            if (domainString.equals(issuedToCName)) {  // `domainString` and `issuedToCName` match.
                 // Set the strings to be blue.
                 domainStringBuilder.setSpan(blueColorSpan, domainLabel.length(), domainStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
                 issuedToCNameStringBuilder.setSpan(blueColorSpan, cNameLabel.length(), issuedToCNameStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
-            } else if(issuedToCNameString.startsWith("*.")){  // `issuedToCNameString` begins with a wildcard.
+            } else if(issuedToCName.startsWith("*.")){  // `issuedToCName` begins with a wildcard.
                 // Remove the initial `*.`.
-                String baseCertificateDomain = issuedToCNameString.substring(2);
+                String baseCertificateDomain = issuedToCName.substring(2);
 
                 // Setup a copy of `domainString` to test subdomains.
                 String domainStringSubdomain = domainString;
@@ -219,7 +231,7 @@ public class ViewSslCertificateDialog extends DialogFragment {
                 issuedToCNameStringBuilder.setSpan(redColorSpan, cNameLabel.length(), issuedToCNameStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
             }
 
-            // Setup the issued to and issued by spans to display the certificate information in blue.  `SPAN_INCLUSIVE_INCLUSIVE` allows the span to grow in either direction.
+            // Set the issued to and issued by spans to display the certificate information in blue.  `SPAN_INCLUSIVE_INCLUSIVE` allows the span to grow in either direction.
             issuedToONameStringBuilder.setSpan(blueColorSpan, oNameLabel.length(), issuedToONameStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
             issuedToUNameStringBuilder.setSpan(blueColorSpan, uNameLabel.length(), issuedToUNameStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
             issuedByCNameStringBuilder.setSpan(blueColorSpan, cNameLabel.length(), issuedByCNameStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
@@ -244,6 +256,7 @@ public class ViewSslCertificateDialog extends DialogFragment {
 
             // Display the strings.
             domainTextView.setText(domainStringBuilder);
+            ipAddressesTextView.setText(getString(R.string.ip_addresses));
             issuedToCNameTextView.setText(issuedToCNameStringBuilder);
             issuedToONameTextView.setText(issuedToONameStringBuilder);
             issuedToUNameTextView.setText(issuedToUNameStringBuilder);
@@ -257,4 +270,97 @@ public class ViewSslCertificateDialog extends DialogFragment {
             return alertDialog;
         }
     }
-}
+
+    // This must run asynchronously because it involves a network request.  `String` declares the parameters.  `Void` does not declare progress units.  `String` contains the results.
+    private static class GetIpAddresses extends AsyncTask<String, Void, SpannableStringBuilder> {
+        // The weak references are used to determine if the activity or the alert dialog have disappeared while the AsyncTask is running.
+        private WeakReference<Activity> activityWeakReference;
+        private WeakReference<AlertDialog> alertDialogWeakReference;
+
+        GetIpAddresses(Activity activity, AlertDialog alertDialog) {
+            // Populate the weak references.
+            activityWeakReference = new WeakReference<>(activity);
+            alertDialogWeakReference = new WeakReference<>(alertDialog);
+        }
+
+        @Override
+        protected SpannableStringBuilder doInBackground(String... domainName) {
+            // Get handles for the activity and the alert dialog.
+            Activity activity = activityWeakReference.get();
+            AlertDialog alertDialog = alertDialogWeakReference.get();
+
+            // Abort if the activity or the dialog is gone.
+            if ((activity == null) || (activity.isFinishing()) || (alertDialog == null)) {
+                return new SpannableStringBuilder();
+            }
+
+            // Initialize an IP address string builder.
+            StringBuilder ipAddresses = new StringBuilder();
+
+            // Get an array with the IP addresses for the host.
+            try {
+                // Get an array with all the IP addresses for the domain.
+                InetAddress[] inetAddressesArray = InetAddress.getAllByName(domainName[0]);
+
+                // Add each IP address to the string builder.
+                for (InetAddress inetAddress : inetAddressesArray) {
+                    if (ipAddresses.length() == 0) {  // This is the first IP address.
+                        // Add the IP Address to the string builder.
+                        ipAddresses.append(inetAddress.getHostAddress());
+                    } else {  // This is not the first IP address.
+                        // Add a line break to the string builder first.
+                        ipAddresses.append("\n");
+
+                        // Add the IP address to the string builder.
+                        ipAddresses.append(inetAddress.getHostAddress());
+                    }
+                }
+            } catch (UnknownHostException exception) {
+                // Do nothing.
+            }
+
+            // Set the label.
+            String ipAddressesLabel = activity.getString(R.string.ip_addresses) + "  ";
+
+            // Create a spannable string builder.
+            SpannableStringBuilder ipAddressesStringBuilder = new SpannableStringBuilder(ipAddressesLabel + ipAddresses);
+
+            // Create a blue foreground color span.
+            ForegroundColorSpan blueColorSpan;
+
+            // Set the blue color span according to the theme.  The deprecated `getColor()` must be used until the minimum API >= 23.
+            if (MainWebViewActivity.darkTheme) {
+                //noinspection deprecation
+                blueColorSpan = new ForegroundColorSpan(activity.getResources().getColor(R.color.blue_400));
+            } else {
+                //noinspection deprecation
+                blueColorSpan = new ForegroundColorSpan(activity.getResources().getColor(R.color.blue_700));
+            }
+
+            // Set the string builder to display the certificate information in blue.  `SPAN_INCLUSIVE_INCLUSIVE` allows the span to grow in either direction.
+            ipAddressesStringBuilder.setSpan(blueColorSpan, ipAddressesLabel.length(), ipAddressesStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
+
+            // Return the formatted string.
+            return ipAddressesStringBuilder;
+        }
+
+        // `onPostExecute()` operates on the UI thread.
+        @Override
+        protected void onPostExecute(SpannableStringBuilder ipAddresses) {
+            // Get handles for the activity and the alert dialog.
+            Activity activity = activityWeakReference.get();
+            AlertDialog alertDialog = alertDialogWeakReference.get();
+
+            // Abort if the activity or the alert dialog is gone.
+            if ((activity == null) || (activity.isFinishing()) || (alertDialog == null)) {
+                return;
+            }
+
+            // Get a handle for the IP addresses text view.
+            TextView ipAddressesTextView = alertDialog.findViewById(R.id.ip_addresses);
+
+            // Populate the IP addresses text view.
+            ipAddressesTextView.setText(ipAddresses);
+        }
+    }
+}
\ No newline at end of file
index 1403869..89da39c 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 
 <!--
-  Copyright © 2016-2017 Soren Stoutner <soren@stoutner.com>.
+  Copyright © 2016-2017,2019 Soren Stoutner <soren@stoutner.com>.
 
   This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
 
             android:layout_height="wrap_content"
             android:layout_width="wrap_content" />
 
+        <TextView
+            android:id="@+id/ip_addresses"
+            android:layout_height="wrap_content"
+            android:layout_width="wrap_content"/>
+
         <!-- Issued To. -->
         <TextView
             android:layout_height="wrap_content"
index 1f209cc..f0d42b2 100644 (file)
@@ -66,8 +66,8 @@
     <string name="no_ssl_certificate">Bu web sitesiyle bağlantınız şifrelenmemiştir. Bu, üçüncü kişilere bilgilerinizi ele geçirme, bağlantınızı izleme ve zararlı yazılımları yükleme fırsatını verir.</string>
     <string name="ssl_certificate">SSL Sertifikası</string>
     <string name="close">Kapat</string>
-    <string name="domain">Etki Alanı</string>
-    <string name="domain_label">Etki Alanı:</string>
+    <string name="domain">Domain</string>
+    <string name="domain_label">Domain:</string>
     <string name="issued_to">Verilen</string>
     <string name="issued_by">Veren</string>
     <string name="common_name">Ortak Ad (CN):</string>
         <string name="clear_cookies">Çerezleri Temizle</string>
         <string name="clear_dom_storage">DOM Depolama Alanını Temizle</string>
         <string name="clear_form_data">Form Verisini Temizle</string>  <!-- The form data strings can be removed once the minimum API >= 26. -->
-    <string name="options_fanboys_annoyance_list">Fanboy’s Annoyance Listesi</string>
-    <string name="options_fanboys_social_blocking_list">Fanboy’s Social Blocking Listesi</string>
+    <string name="options_fanboys_annoyance_list">Fanboy Rahatsızlık Listesi</string>
+    <string name="options_fanboys_social_blocking_list">Fanboy Sosyal Engelleme Listesi</string>
     <string name="options_block_all_third_party_requests">Tüm Üçüncü Taraf İstekleri Engelle</string>
     <string name="layout">Düzen</string>
         <string name="user_agent_webview_default">Varsayılan Web Görünümü</string>
         <string name="third_party_blocked">Üçüncü Taraf - Engellendi</string>
         <string name="blocked">Engellendi</string>
         <string name="blocked_plural">Engellendi</string>
-    <string name="blocklist">Engellenenler</string>
-        <string name="main_whitelist">Ana beyaz liste</string>
-        <string name="final_whitelist">Final beyaz liste</string>
+    <string name="blocklist">Engel listesi</string>
+    <string name="sublist">Alt liste</string>
+        <string name="main_whitelist">Ana beyaz listesi</string>
+        <string name="final_whitelist">Son beyaz listesi</string>
         <string name="domain_whitelist">Domain beyaz listesi</string>
         <string name="domain_initial_whitelist">Domain başlangıç beyaz listesi</string>
-        <string name="domain_final_whitelist">Domain final beyaz listesi</string>
+        <string name="domain_final_whitelist">Domain son beyaz listesi</string>
         <string name="third_party_whitelist">Üçüncü taraf beyaz listesi</string>
         <string name="third_party_domain_whitelist">Üçüncü taraf domain beyaz listesi</string>
         <string name="third_party_domain_initial_whitelist">Üçüncü taraf domain başlangıç beyaz listesi</string>
-        <string name="main_blacklist">Ana kara liste</string>
+        <string name="main_blacklist">Ana kara listesi</string>
         <string name="initial_blacklist">Başlangıç kara listesi</string>
-        <string name="final_blacklist">Final kara liste</string>
+        <string name="final_blacklist">Son kara listesi</string>
         <string name="domain_blacklist">Domain kara listesi</string>
         <string name="domain_initial_blacklist">Domain başlangıç kara listesi</string>
-        <string name="domain_final_blacklist">Domain final kara listesi</string>
+        <string name="domain_final_blacklist">Domain son kara listesi</string>
+        <string name="domain_regular_expression_blacklist">Domain düzenli ifade kara listesi</string>
         <string name="third_party_blacklist">Üçüncü taraf kara listesi</string>
         <string name="third_party_initial_blacklist">Üçüncü taraf başlangıç kara listesi</string>
         <string name="third_party_domain_blacklist">Üçüncü taraf domain kara listesi</string>
         <string name="third_party_domain_initial_blacklist">Üçüncü taraf domain başlangıç kara listesi</string>
+        <string name="third_party_regular_expression_blacklist">Üçüncü taraf düzenli ifade kara listesi</string>
+        <string name="third_party_domain_regular_expression_blacklist">Üçüncü taraf domain düzenli ifade kara listesi</string>
+        <string name="regular_expression_blacklist">Düzenli ifade kara listesi</string>
+    <string name="blocklist_entries">Engel listesi girdileri</string>
+    <string name="blocklist_original_entry">Engel listesi orijinal girdisi</string>
 
     <!-- Domains. -->
     <string name="domains">Domainler</string>
     <string name="add">Ekle</string>
     <string name="domain_name">Domain adı</string>
     <string name="domain_deleted">Domain silinmiş</string>
+    <string name="domain_name_instructions">*. tüm altdomainleri içeren bir domain başına getirilebilir (örn. *.stoutner.com)</string>
     <string-array name="swipe_to_refresh_array">
         <item>Sistem varsayılanı</item>
         <item>Yenilemek için kaydır etkin</item>
     </string-array>
     <string name="pinned_ssl_certificate">İğneli SSL sertifikası</string>
     <string name="saved_ssl_certificate">Kayıtlı SSL sertifikası</string>
-    <string name="current_website_ssl_certificate">Geçerli web site SSL sertifikası</string>
+    <string name="current_website_ssl_certificate">Geçerli web sitesi SSL sertifikası</string>
+    <string name="load_an_encrypted_website">Geçerli web sitesinin SSL sertifikasını doldurmak için Domain Ayarlarını açmadan önce şifrelenmiş bir web sitesi yükleyin.</string>
 
     <!-- Import/Export. -->
+    <string name="encryption">Şifreleme</string>
+    <string-array name="encryption_type">
+        <item>Hiçbiri</item>
+        <item>Parola</item>
+        <item>OpenPGP</item>
+    </string-array>
+    <string name="kitkat_password_encryption_message">Android KitKat sürümünde parola şifrelemesi çalışmaz.</string>
+    <string name="openkeychain_required">OpenPGP şifrelemesinin çalışması için OpenKeychain yüklü olmalıdır.</string>
+    <string name="openkeychain_import_instructions">Şifresi çözüldükten sonra, şifrelenmemiş dosya ayrı bir adımda içeri aktarılmak zorundadır.</string>
+    <string name="file_location">Dosya Konumu</string>
+    <string name="browse">Gözat</string>
+    <string name="export">Dışarı aktar</string>
+    <string name="import_button">İçeri aktar</string>  <!-- `import` is a reserved word and cannot be used as the name -->
+    <string name="decrypt">Şifre Çözmek</string>
+    <string name="export_successful">Dışa aktarım başarılı.</string>
+    <string name="export_failed">Dışa aktarım başarısız oldu:</string>
+    <string name="import_failed">İçe aktarım başarısız oldu:</string>
+    <string name="cannot_export">Ayarlar, depolama alanı izni onaylanmadığından bu konuma aktarılamıyor.</string>
+    <string name="cannot_import">Ayarlar, depolama alanı izni onaylanmadığından bu konumdan aktarılamıyor.</string>
+    <string name="invalid_location">geçerli bir konum değildir.</string>
+    <string name="storage_permission">Depolama Alanı İzni</string>
+    <string name="storage_permission_message">Privacy Browser, genel dizinlere erişmek için depolama alanı iznine ihtiyaç duymaktadır. Reddedildiği takdirde, uygulamanın dizinleri hala kullanılabilir.</string>
+    <string name="storage_permission_explanation">Genel dizinlerdeki dosyalara erişim icin depolama alanı izni gerekmektedir. Aksi takdirde, sadece uygulamanın dizinleri çalışacaktır.</string>
 
     <!-- Guide. -->
     <string name="privacy_browser_guide">Privacy Browser Rehberi</string>
     <string name="download_location">İndirme Konumu</string>
     <string name="download_location_message">Privacy Browser\'ın genel indirme dizinini kullanması için depolama alanı izni gerekmektedir.
         Eğer reddedilirse, onun yerine uygulamanın indirme dizini kullanılacaktır.</string>
+    <string name="ok">OK</string>
 
     <!-- Orbot. -->
-    <string name="orbot_proxy_not_installed">Orbot yüklenmeden Orbot proxy çalışmayacaktır.</string>
+    <string name="orbot_proxy_not_installed">Orbot yüklenmeden Orbot vekil sunucusu çalışmayacaktır.</string>
     <string name="waiting_for_orbot">Orbot\'un bağlanması bekleniyor...</string>
 
     <!-- About Activity. -->
     <string name="hardware">Donanım</string>
     <string name="brand">Marka:</string>
     <string name="manufacturer">Üretici:</string>
+    <string name="model">Model:</string>
     <string name="device">Cihaz:</string>
     <string name="bootloader">Bootloader:</string>
     <string name="radio">Donanım Yazılımı:</string>
     <string name="openkeychain">OpenKeychain:</string>
     <string name="easylist_label">EasyList:</string>
     <string name="easyprivacy_label">EasyPrivacy:</string>
-    <string name="fanboy_annoyance_label">Fanboy’s Annoyance Listesi:</string>
-    <string name="fanboy_social_label">Fanboy’s Social Blocking Listesi:</string>
+    <string name="fanboy_annoyance_label">Fanboy Rahatsızlık Listesi:</string>
+    <string name="fanboy_social_label">Fanboy Sosyal Engelleme Listesi:</string>
     <string name="ultraprivacy_label">UltraPrivacy:</string>
     <string name="package_signature">Paket İmzası</string>
     <string name="issuer_dn">Yayınlayan DA:</string>
         <string name="easylist_summary">Ana reklam engelleme listesi.</string>
         <string name="easyprivacy">EasyPrivacy</string>
         <string name="easyprivacy_summary">Ana takipçi engelleme listesi.</string>
-        <string name="fanboys_annoyance_list">Fanboy’s annoyance listesi</string>
+        <string name="fanboys_annoyance_list">Fanboy Rahatsızlık Listesi</string>
         <string name="fanboys_annoyance_list_summary">Rahatsız eden popupları ve linkleri engeller. Fanboy’s social blocking listesini de içerir.</string>
-        <string name="fanboys_social_blocking_list">Fanboy’s social blocking listesi</string>
+        <string name="fanboys_social_blocking_list">Fanboy Sosyal Engelleme Listesi</string>
         <string name="fanboys_social_blocking_list_summary">Üçüncü taraf sosyal medya içeriklerini engeller.</string>
         <string name="ultraprivacy">UltraPrivacy</string>
         <string name="ultraprivacy_summary">UltraPrivacy, EasyPrivacy\'de olmayan takipçileri de engeller fakat bu seçenek bazı web sitelerinin çökmesine sebep olabilir.</string>
         <string name="block_all_third_party_requests">Tüm üçüncü taraf istekleri engelle</string>
         <string name="block_all_third_party_requests_summary">Tüm üçüncü taraf istekleri engellemek gizliliği arttırır, fakat çoğu web sitesinin çökmesine sebep olur.</string>
+    <string name="tor">Tor</string>
+        <string name="proxy_through_orbot">Orbot vasıtasıyla vekil sunucusu</string>
+        <string name="proxy_through_orbot_summary">localhost:8118 üzerinden Orbot vasıtasıyla tüm web trafiği vekil sunucusu.</string>
+        <string name="tor_homepage">Tor anasayfa</string>
+        <string name="tor_search">Tor arama</string>
         <string-array name="tor_search_entries">
             <item>Searx</item>
             <item>DuckDuckGo - JavaScript devre dışı</item>
             <item>DuckDuckGo - JavaScript etkin</item>
             <item>Özel</item>
         </string-array>
+        <string name="tor_search_custom_url">Tor özel URL arama</string>
     <string name="search">Arama</string>
         <string-array name="search_entries">
             <item>Searx</item>
         <string name="translucent_navigation_bar">Yarı saydam gezinti çubuğu</string>
         <string name="translucent_navigation_bar_summary">Gezinti çubuğunu, tam ekran modunda yarı saydam yapar.</string>
     <string name="clear_everything">Her şeyi temizle</string>
+        <string name="clear_everything_summary">Çerezleri, DOM depolama alanını, form verisini ve Web Görünümü ön belleğini temizler.
+            Sonrasında, manuel olarak bütün “app_webview” ve “cache” dizinlerini siler.</string>
         <string name="clear_cookies_preference">Çerezleri temizle</string>
         <string name="clear_cookies_summary">Birinci ve Üçüncü taraf çerezleri temizler</string>
         <string name="clear_dom_storage_preference">Dom Depolama Alanını temizle</string>
         <string name="download_with_external_app">Harici uygulamayla indir</string>
         <string name="download_with_external_app_summary">Android indirme yönetecisi bazı cihazlarda iyi çalışmayabilir.</string>
         <string name="display_additional_app_bar_icons">Ek uygulama çubuğu simgelerini göster</string>
+        <string name="display_additional_app_bar_icons_summary">Web Görünümünü yenilemek ve yer varsa çerezler ve DOM depolama alanını değiştirmek için uygulama çubuğunda simgeler gösterir.</string>
         <string name="dark_theme">Koyu tema</string>
         <string name="dark_theme_summary">Temayı değiştirmek Privacy Browser\'ı yeniden başlatacak.</string>
-        <string name="night_mode">Gece mody</string>
+        <string name="night_mode">Gece modu</string>
         <string name="night_mode_summary">Gece modunu etkinleştirmek aynı zamanda tüm sitelerde JavaScript\'i etkinleştirecek.</string>
         <string name="display_webpage_images">Web sitesi resimlerini göster</string>
         <string name="display_webpage_images_summary">Bant genişliği korumayı devre dışı bırak.</string>
index a5dece7..d39bf64 100644 (file)
@@ -75,6 +75,7 @@
     <string name="close">Close</string>
     <string name="domain">Domain</string>
     <string name="domain_label">Domain:</string>
+    <string name="ip_addresses">IP Addresses:</string>
     <string name="issued_to">Issued To</string>
     <string name="issued_by">Issued By</string>
     <string name="common_name">Common Name (CN):</string>