diff --git a/app/src/main/java/io/legado/app/help/http/HttpHelper.kt b/app/src/main/java/io/legado/app/help/http/HttpHelper.kt index 3e5ac9fa7..ffdb66f9b 100644 --- a/app/src/main/java/io/legado/app/help/http/HttpHelper.kt +++ b/app/src/main/java/io/legado/app/help/http/HttpHelper.kt @@ -3,7 +3,6 @@ package io.legado.app.help.http import io.legado.app.help.AppConfig import io.legado.app.help.http.cronet.CronetInterceptor import io.legado.app.help.http.cronet.CronetLoader -import io.legado.app.help.http.cronet.cronetEngine import okhttp3.ConnectionSpec import okhttp3.Credentials import okhttp3.Interceptor @@ -44,7 +43,7 @@ val okHttpClient: OkHttpClient by lazy { .build() chain.proceed(request) }) - if (AppConfig.isCronet && CronetLoader.install() && cronetEngine != null) { + if (AppConfig.isCronet && CronetLoader.install() && !AppConfig.isGooglePlay) { builder.addInterceptor(CronetInterceptor(null)) } builder.build() diff --git a/app/src/main/java/io/legado/app/help/http/cronet/CronetLoader.kt b/app/src/main/java/io/legado/app/help/http/cronet/CronetLoader.kt index 2e926d10d..e077166e0 100644 --- a/app/src/main/java/io/legado/app/help/http/cronet/CronetLoader.kt +++ b/app/src/main/java/io/legado/app/help/http/cronet/CronetLoader.kt @@ -261,7 +261,7 @@ object CronetLoader : CronetEngine.Builder.LibraryLoader() { downloadTempFile: File, destSuccessFile: File ) { - if (download) { + if (download || AppConfig.isGooglePlay) { return } download = true diff --git a/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt b/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt index 5322e8967..b4b4d4ceb 100644 --- a/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt +++ b/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt @@ -37,6 +37,9 @@ class OtherConfigFragment : BasePreferenceFragment(), override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { putPrefBoolean(PreferKey.processText, isProcessTextEnabled()) addPreferencesFromResource(R.xml.pref_config_other) + if (AppConfig.isGooglePlay) { + preferenceScreen.removePreferenceRecursively("Cronet") + } upPreferenceSummary(PreferKey.userAgent, AppConfig.userAgent) upPreferenceSummary(PreferKey.preDownloadNum, AppConfig.preDownloadNum.toString()) upPreferenceSummary(PreferKey.threadCount, AppConfig.threadCount.toString())