From dc7486a8b1608405a5449db0a76e996e16ba836b Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 26 Jan 2023 22:11:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/app/java/io/legado/app/lib/cronet/AbsCallBack.kt | 1 - app/src/app/java/io/legado/app/lib/cronet/BodyUploadProvider.kt | 1 + .../java/io/legado/app/lib/cronet/CronetCoroutineInterceptor.kt | 1 + app/src/app/java/io/legado/app/lib/cronet/CronetInterceptor.kt | 1 + app/src/app/java/io/legado/app/lib/cronet/NewCallBack.kt | 2 +- 5 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/app/java/io/legado/app/lib/cronet/AbsCallBack.kt b/app/src/app/java/io/legado/app/lib/cronet/AbsCallBack.kt index 31897d3c0..7627949b8 100644 --- a/app/src/app/java/io/legado/app/lib/cronet/AbsCallBack.kt +++ b/app/src/app/java/io/legado/app/lib/cronet/AbsCallBack.kt @@ -22,7 +22,6 @@ abstract class AbsCallBack( val mCall: Call, private val eventListener: EventListener? = null, private val responseCallback: Callback? = null - ) : UrlRequest.Callback(), AutoCloseable { val buffer = Buffer() diff --git a/app/src/app/java/io/legado/app/lib/cronet/BodyUploadProvider.kt b/app/src/app/java/io/legado/app/lib/cronet/BodyUploadProvider.kt index e62838369..a9d91c10d 100644 --- a/app/src/app/java/io/legado/app/lib/cronet/BodyUploadProvider.kt +++ b/app/src/app/java/io/legado/app/lib/cronet/BodyUploadProvider.kt @@ -10,6 +10,7 @@ import java.nio.ByteBuffer @Keep class BodyUploadProvider(private val body: RequestBody) : UploadDataProvider(), AutoCloseable { + private val buffer = Buffer() init { diff --git a/app/src/app/java/io/legado/app/lib/cronet/CronetCoroutineInterceptor.kt b/app/src/app/java/io/legado/app/lib/cronet/CronetCoroutineInterceptor.kt index 5bef442f4..477396467 100644 --- a/app/src/app/java/io/legado/app/lib/cronet/CronetCoroutineInterceptor.kt +++ b/app/src/app/java/io/legado/app/lib/cronet/CronetCoroutineInterceptor.kt @@ -17,6 +17,7 @@ import kotlin.coroutines.resumeWithException @Keep @Suppress("unused") class CronetCoroutineInterceptor : Interceptor { + override fun intercept(chain: Interceptor.Chain): Response { if (chain.call().isCanceled()) { throw IOException("Canceled") diff --git a/app/src/app/java/io/legado/app/lib/cronet/CronetInterceptor.kt b/app/src/app/java/io/legado/app/lib/cronet/CronetInterceptor.kt index 494e46674..b045c1632 100644 --- a/app/src/app/java/io/legado/app/lib/cronet/CronetInterceptor.kt +++ b/app/src/app/java/io/legado/app/lib/cronet/CronetInterceptor.kt @@ -11,6 +11,7 @@ import java.io.IOException @Keep @Suppress("unused") class CronetInterceptor : Interceptor { + @Throws(IOException::class) override fun intercept(chain: Interceptor.Chain): Response { if (chain.call().isCanceled()) { diff --git a/app/src/app/java/io/legado/app/lib/cronet/NewCallBack.kt b/app/src/app/java/io/legado/app/lib/cronet/NewCallBack.kt index 06929584b..4a17593bd 100644 --- a/app/src/app/java/io/legado/app/lib/cronet/NewCallBack.kt +++ b/app/src/app/java/io/legado/app/lib/cronet/NewCallBack.kt @@ -14,8 +14,8 @@ import java.util.concurrent.TimeUnit @Keep @RequiresApi(api = Build.VERSION_CODES.N) class NewCallBack(originalRequest: Request, mCall: Call) : AbsCallBack(originalRequest, mCall) { - private val responseFuture = CompletableFuture() + private val responseFuture = CompletableFuture() @Throws(IOException::class) override fun waitForDone(urlRequest: UrlRequest): Response {