|
|
@ -2,6 +2,7 @@ package io.legado.app.help.http |
|
|
|
|
|
|
|
|
|
|
|
import io.legado.app.help.AppConfig |
|
|
|
import io.legado.app.help.AppConfig |
|
|
|
import io.legado.app.help.http.cronet.CronetInterceptor |
|
|
|
import io.legado.app.help.http.cronet.CronetInterceptor |
|
|
|
|
|
|
|
import io.legado.app.help.http.cronet.CronetLoader |
|
|
|
import kotlinx.coroutines.suspendCancellableCoroutine |
|
|
|
import kotlinx.coroutines.suspendCancellableCoroutine |
|
|
|
import okhttp3.ConnectionSpec |
|
|
|
import okhttp3.ConnectionSpec |
|
|
|
import okhttp3.Credentials |
|
|
|
import okhttp3.Credentials |
|
|
@ -44,7 +45,7 @@ val okHttpClient: OkHttpClient by lazy { |
|
|
|
.build() |
|
|
|
.build() |
|
|
|
chain.proceed(request) |
|
|
|
chain.proceed(request) |
|
|
|
}) |
|
|
|
}) |
|
|
|
if (AppConfig.isCronet&&CronetLoader.getInstance(appCtx).install()) { |
|
|
|
if (AppConfig.isCronet && CronetLoader.getInstance(appCtx).install()) { |
|
|
|
builder.addInterceptor(CronetInterceptor()) |
|
|
|
builder.addInterceptor(CronetInterceptor()) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|