diff --git a/app/build.gradle.kts b/app/build.gradle.kts index cd8f29618..837c8a097 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -213,7 +213,7 @@ dependencies { // https://coil-kt.github.io/coil/changelog/ implementation("io.coil-kt:coil-compose:2.2.2") - implementation("io.ktor:ktor-client-apache5:2.3.0-eap-619") + implementation("io.ktor:ktor-client-okhttp:2.2.4") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4") implementation("org.jetbrains.kotlinx:kotlinx-serialization-cbor:1.5.0") implementation("org.jsoup:jsoup:1.15.4") diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 77ececcc6..c57e445f3 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -15,12 +15,6 @@ # Ktor logger -dontwarn org.slf4j.impl.StaticLoggerBinder --dontwarn org.ietf.jgss.GSSContext --dontwarn org.ietf.jgss.GSSCredential --dontwarn org.ietf.jgss.GSSException --dontwarn org.ietf.jgss.GSSManager --dontwarn org.ietf.jgss.GSSName --dontwarn org.ietf.jgss.Oid -keepattributes LineNumberTable,SourceFile -renamesourcefileattribute SourceFile diff --git a/app/src/main/java/com/hippo/ehviewer/EhApplication.kt b/app/src/main/java/com/hippo/ehviewer/EhApplication.kt index c50cdeb6f..6a838bb79 100644 --- a/app/src/main/java/com/hippo/ehviewer/EhApplication.kt +++ b/app/src/main/java/com/hippo/ehviewer/EhApplication.kt @@ -48,7 +48,7 @@ import eu.kanade.tachiyomi.core.preference.AndroidPreferenceStore import eu.kanade.tachiyomi.ui.reader.setting.ReaderPreferences import eu.kanade.tachiyomi.util.lang.launchIO import io.ktor.client.HttpClient -import io.ktor.client.engine.apache5.Apache5 +import io.ktor.client.engine.okhttp.OkHttp import kotlinx.coroutines.DelicateCoroutinesApi import okhttp3.Cache import okhttp3.OkHttpClient @@ -246,8 +246,11 @@ class EhApplication : Application(), DefaultLifecycleObserver, ImageLoaderFactor } val ktorClient by lazy { - if (Settings.dF) System.setProperty("jsse.enableSNIExtension", "false") - HttpClient(Apache5) + HttpClient(OkHttp) { + engine { + preconfigured = nonCacheOkHttpClient + } + } } @JvmStatic diff --git a/settings.gradle.kts b/settings.gradle.kts index d99e40034..103108a90 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -14,7 +14,6 @@ dependencyResolutionManagement { maven("https://jcenter.bintray.com") maven("https://jitpack.io") maven("https://androidx.dev/storage/compose-compiler/repository/") - maven("https://maven.pkg.jetbrains.space/public/p/ktor/eap") } }