使用Gradle下载Cronet,自动计算md5

pull/1276/head
ag2s20150909 3 years ago
parent 79978db56c
commit ecdfc0941e
  1. 9
      app/src/main/java/io/legado/app/help/http/cronet/CronetHelper.kt

@ -27,19 +27,16 @@ val cronetEngine: ExperimentalCronetEngine by lazy {
val builder = ExperimentalCronetEngine.Builder(appCtx).apply {
if (!AppConfig.isGooglePlay) {
if (!AppConfig.isGooglePlay&&CronetLoader.install()) {
setLibraryLoader(CronetLoader)//设置自定义so库加载
}
setStoragePath(appCtx.externalCacheDir?.absolutePath)//设置缓存路径
enableHttpCache(HTTP_CACHE_DISK, (1024 * 1024 * 50))//设置缓存模式
enableHttpCache(HTTP_CACHE_DISK, (1024 * 1024 * 50).toLong())//设置缓存模式
enableQuic(true)//设置支持http/3
enableHttp2(true) //设置支持http/2
enablePublicKeyPinningBypassForLocalTrustAnchors(true)
//enableNetworkQualityEstimator(true)
//Brotli压缩
enableBrotli(true)
//setExperimentalOptions("{\"quic_version\": \"h3-29\"}")
enableBrotli(true)//Brotli压缩
}
val engine = builder.build()
Log.d("Cronet", "Cronet Version:" + engine.versionString)

Loading…
Cancel
Save