pull/2724/head
kunfei 2 years ago
parent c3159c2d4c
commit 7c237a9ac1
  1. 2
      app/src/app/java/io/legado/app/help/AppUpdateGitHub.kt
  2. 2
      app/src/app/java/io/legado/app/lib/cronet/AbsCallBack.kt
  3. 2
      app/src/app/java/io/legado/app/lib/cronet/BodyUploadProvider.kt
  4. 2
      app/src/app/java/io/legado/app/lib/cronet/CronetCoroutineInterceptor.kt
  5. 4
      app/src/app/java/io/legado/app/lib/cronet/CronetHelper.kt
  6. 3
      app/src/app/java/io/legado/app/lib/cronet/CronetInterceptor.kt
  7. 3
      app/src/app/java/io/legado/app/lib/cronet/CronetLoader.kt
  8. 3
      app/src/app/java/io/legado/app/lib/cronet/NewCallBack.kt
  9. 2
      app/src/app/java/io/legado/app/lib/cronet/OldCallback.kt

@ -1,5 +1,6 @@
package io.legado.app.help
import androidx.annotation.Keep
import io.legado.app.R
import io.legado.app.constant.AppConst
import io.legado.app.exception.NoStackTraceException
@ -11,6 +12,7 @@ import io.legado.app.utils.readString
import kotlinx.coroutines.CoroutineScope
import splitties.init.appCtx
@Keep
@Suppress("unused")
object AppUpdateGitHub: AppUpdate.AppUpdateInterface {

@ -1,5 +1,6 @@
package io.legado.app.lib.cronet
import androidx.annotation.Keep
import io.legado.app.help.http.okHttpClient
import io.legado.app.utils.DebugLog
import io.legado.app.utils.asIOException
@ -15,6 +16,7 @@ import java.io.IOException
import java.nio.ByteBuffer
import java.util.*
@Keep
abstract class AbsCallBack(
val originalRequest: Request,
val mCall: Call,

@ -1,5 +1,6 @@
package io.legado.app.lib.cronet
import androidx.annotation.Keep
import okhttp3.RequestBody
import okio.Buffer
import org.chromium.net.UploadDataProvider
@ -7,6 +8,7 @@ import org.chromium.net.UploadDataSink
import java.io.IOException
import java.nio.ByteBuffer
@Keep
class BodyUploadProvider(private val body: RequestBody) : UploadDataProvider(), AutoCloseable {
private val buffer = Buffer()

@ -1,5 +1,6 @@
package io.legado.app.lib.cronet
import androidx.annotation.Keep
import io.legado.app.help.http.cookieJar
import io.legado.app.utils.printOnDebug
import kotlinx.coroutines.runBlocking
@ -13,6 +14,7 @@ import java.io.IOException
import kotlin.coroutines.resume
import kotlin.coroutines.resumeWithException
@Keep
@Suppress("unused")
class CronetCoroutineInterceptor : Interceptor {
override fun intercept(chain: Interceptor.Chain): Response {

@ -1,5 +1,8 @@
@file:Keep
package io.legado.app.lib.cronet
import androidx.annotation.Keep
import io.legado.app.constant.AppLog
import io.legado.app.help.config.AppConfig
import io.legado.app.help.http.okHttpClient
@ -13,7 +16,6 @@ import org.chromium.net.UrlRequest
import org.json.JSONObject
import splitties.init.appCtx
val cronetEngine: ExperimentalCronetEngine? by lazy {
if (!AppConfig.isGooglePlay) {
CronetLoader.preDownload()

@ -1,13 +1,14 @@
package io.legado.app.lib.cronet
import android.os.Build
import androidx.annotation.Keep
import io.legado.app.help.http.cookieJar
import io.legado.app.utils.printOnDebug
import okhttp3.*
import okhttp3.internal.http.receiveHeaders
import java.io.IOException
@Keep
@Suppress("unused")
class CronetInterceptor : Interceptor {
@Throws(IOException::class)

@ -5,6 +5,7 @@ import android.content.Context
import android.content.pm.ApplicationInfo
import android.os.Build
import android.text.TextUtils
import androidx.annotation.Keep
import io.legado.app.BuildConfig
import io.legado.app.help.config.AppConfig
import io.legado.app.help.coroutine.Coroutine
@ -23,7 +24,7 @@ import java.net.URL
import java.security.MessageDigest
import java.util.*
@Keep
object CronetLoader : CronetEngine.Builder.LibraryLoader(), CronetLoaderInterface {
//https://storage.googleapis.com/chromium-cronet/android/92.0.4515.159/Release/cronet/libs/arm64-v8a/libcronet.92.0.4515.159.so

@ -1,7 +1,7 @@
package io.legado.app.lib.cronet
import android.os.Build
import androidx.annotation.Keep
import androidx.annotation.RequiresApi
import okhttp3.Call
import okhttp3.Request
@ -11,6 +11,7 @@ import java.io.IOException
import java.util.concurrent.CompletableFuture
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<Response>()

@ -1,12 +1,14 @@
package io.legado.app.lib.cronet
import android.os.ConditionVariable
import androidx.annotation.Keep
import okhttp3.Call
import okhttp3.Request
import okhttp3.Response
import org.chromium.net.UrlRequest
import java.io.IOException
@Keep
class OldCallback(originalRequest: Request, mCall: Call) : AbsCallBack(originalRequest, mCall) {
private val mResponseCondition = ConditionVariable()

Loading…
Cancel
Save