From a4addd362b90cd5c823bfbe7fb31f5d9d2adf2ff Mon Sep 17 00:00:00 2001 From: klosw Date: Tue, 27 Feb 2024 10:23:36 +0800 Subject: [PATCH] =?UTF-8?q?mod=20=E6=94=AF=E6=8C=81=20Android=204.4=20Glid?= =?UTF-8?q?e=E5=8A=A0=E8=BD=BDhttps=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/aminography/redirectglide/OkHttpUrlLoader.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/aminography/redirectglide/OkHttpUrlLoader.kt b/app/src/main/java/com/aminography/redirectglide/OkHttpUrlLoader.kt index 18591da4f7..5da82070f1 100644 --- a/app/src/main/java/com/aminography/redirectglide/OkHttpUrlLoader.kt +++ b/app/src/main/java/com/aminography/redirectglide/OkHttpUrlLoader.kt @@ -6,6 +6,7 @@ import com.bumptech.glide.load.model.ModelLoader import com.bumptech.glide.load.model.ModelLoader.LoadData import com.bumptech.glide.load.model.ModelLoaderFactory import com.bumptech.glide.load.model.MultiModelLoaderFactory +import com.github.catvod.net.SSLCompat import okhttp3.Call import okhttp3.OkHttpClient import java.io.InputStream @@ -45,7 +46,11 @@ class OkHttpUrlLoader( } companion object { - private val internalClient: Call.Factory = OkHttpClient().newBuilder().followRedirects(false).followSslRedirects(false).build()//modify by muziling + private val internalClient: Call.Factory = OkHttpClient().newBuilder().apply { + if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP) { + sslSocketFactory(SSLCompat(), SSLCompat.TM) + } + }.followRedirects(false).followSslRedirects(false).build()//modify by muziling } }