X-Git-Url: https://gitweb.stoutner.com/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Fbackgroundtasks%2FGetSourceBackgroundTask.java;h=26f57a12511a1d0f965513813905dc985d802ddd;hb=514e93baaa8389dc9c5abdb79e68c890c260b8d3;hp=b076fd38b2e62cc6d7eafd8672941b6c08ccb3cd;hpb=ab11ca2de00c56982e46627c8e7fc670462b0b3c;p=PrivacyBrowserAndroid.git diff --git a/app/src/main/java/com/stoutner/privacybrowser/backgroundtasks/GetSourceBackgroundTask.java b/app/src/main/java/com/stoutner/privacybrowser/backgroundtasks/GetSourceBackgroundTask.java index b076fd38..26f57a12 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/backgroundtasks/GetSourceBackgroundTask.java +++ b/app/src/main/java/com/stoutner/privacybrowser/backgroundtasks/GetSourceBackgroundTask.java @@ -1,20 +1,20 @@ /* - * Copyright © 2017-2021 Soren Stoutner . + * Copyright © 2017-2022 Soren Stoutner . * - * This file is part of Privacy Browser . + * This file is part of 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 . + * along with Privacy Browser Android. If not, see . */ 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