]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/backgroundtasks/GetSourceBackgroundTask.java
Release 3.12.
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / backgroundtasks / GetSourceBackgroundTask.java
index b076fd38b2e62cc6d7eafd8672941b6c08ccb3cd..26f57a12511a1d0f965513813905dc985d802ddd 100644 (file)
@@ -1,20 +1,20 @@
 /*
- * Copyright © 2017-2021 Soren Stoutner <soren@stoutner.com>.
+ * Copyright © 2017-2022 Soren Stoutner <soren@stoutner.com>.
  *
- * This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
+ * This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android>.
  *
- * Privacy Browser is free software: you can redistribute it and/or modify
+ * Privacy Browser Android 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,
+ * Privacy Browser Android 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/>.
+ * along with Privacy Browser Android.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 package com.stoutner.privacybrowser.backgroundtasks;
@@ -24,7 +24,6 @@ import android.content.ContentResolver;
 import android.database.Cursor;
 import android.graphics.Typeface;
 import android.net.Uri;
-import android.os.Build;
 import android.text.SpannableStringBuilder;
 import android.text.Spanned;
 import android.text.style.StyleSpan;
@@ -147,15 +146,6 @@ public class GetSourceBackgroundTask {
                 requestHeadersBuilder.append(userAgent);
 
 
-                // Set the `x-requested-with` header property.
-                httpUrlConnection.setRequestProperty("x-requested-with", "");
-
-                // Add the `x-requested-with` header to the string builder and format the text.
-                requestHeadersBuilder.append(System.getProperty("line.separator"));
-                requestHeadersBuilder.append("x-requested-with", new StyleSpan(Typeface.BOLD), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
-                requestHeadersBuilder.append(":  ");
-
-
                 // Set the `Sec-Fetch-Site` header property.
                 httpUrlConnection.setRequestProperty("Sec-Fetch-Site", "none");
 
@@ -233,8 +223,9 @@ public class GetSourceBackgroundTask {
                         return true;
                     };
 
-                    // Create a new trust manager.
-                    TrustManager[] trustManager = new TrustManager[] {
+                    // Create a new trust manager.  Lint wants to warn us that it is hard to securely implement an X509 trust manager.
+                    // But the point of this trust manager is that it should accept all certificates no matter what, so that isn't an issue in our case.
+                    @SuppressLint("CustomX509TrustManager") TrustManager[] trustManager = new TrustManager[] {
                             new X509TrustManager() {
                                 @SuppressLint("TrustAllX509TrustManager")
                                 @Override