From 316f43f840194492866a3623cfb8f23ccd751f9e Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 19 Oct 2021 15:13:28 +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 --- .../main/java/io/legado/app/help/http/cronet/CronetHelper.kt | 2 +- .../main/java/io/legado/app/help/http/cronet/CronetLoader.kt | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/http/cronet/CronetHelper.kt b/app/src/main/java/io/legado/app/help/http/cronet/CronetHelper.kt index a8ab18c5c..e13dbe228 100644 --- a/app/src/main/java/io/legado/app/help/http/cronet/CronetHelper.kt +++ b/app/src/main/java/io/legado/app/help/http/cronet/CronetHelper.kt @@ -38,7 +38,7 @@ val cronetEngine: ExperimentalCronetEngine by lazy { val engine = try { builder.build() } catch (e: Exception) { - CronetLoader.preDownload() + builder.setLibraryLoader(CronetLoader)//设置自定义so库加载 builder.build() } Timber.d("Cronet Version:" + engine.versionString) 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 20900f456..0f045b1d6 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 @@ -77,10 +77,6 @@ object CronetLoader : CronetEngine.Builder.LibraryLoader() { * 预加载Cronet */ fun preDownload() { - if (AppConfig.isGooglePlay) { - CronetProviderInstaller.installProvider(appCtx) - return - } Coroutine.async { //md5 = getUrlMd5(md5Url) if (soFile.exists() && md5 == getFileMD5(soFile)) {