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;
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");
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