From 53be30e611a8178bb77313b20bc953555541b059 Mon Sep 17 00:00:00 2001 From: ag2s20150909 Date: Wed, 28 Jul 2021 23:07:01 +0800 Subject: [PATCH] =?UTF-8?q?Cronet:=E4=BC=98=E5=8C=96=E9=A2=84=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/help/http/cronet/CronetLoader.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/help/http/cronet/CronetLoader.java b/app/src/main/java/io/legado/app/help/http/cronet/CronetLoader.java index 77d8ffc5f..2f3117d1d 100644 --- a/app/src/main/java/io/legado/app/help/http/cronet/CronetLoader.java +++ b/app/src/main/java/io/legado/app/help/http/cronet/CronetLoader.java @@ -67,7 +67,13 @@ public class CronetLoader extends CronetEngine.Builder.LibraryLoader { public void preDownload() { new Thread(() -> { String md5 = getUrlMd5(md5Url); - download(soUrl, md5, downloadFile, soFile); + if(soFile.exists()&&Objects.equals(md5, getFileMD5(soFile))){ + Log.e(TAG,"So 库已存在"); + }else { + soFile.deleteOnExit(); + download(soUrl, md5, downloadFile, soFile); + } + Log.e(TAG, soName); }).start();