From 350ef56ddf4dde7c7ce9ddf82d3480d11166c445 Mon Sep 17 00:00:00 2001 From: ag2s20150909 Date: Wed, 28 Jul 2021 23:10:46 +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 --- .../io/legado/app/help/http/cronet/CronetLoader.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 44775980a..bad5053ac 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,9 +67,9 @@ public class CronetLoader extends CronetEngine.Builder.LibraryLoader { public void preDownload() { new Thread(() -> { String md5 = getUrlMd5(md5Url); - if(soFile.exists()&&Objects.equals(md5, getFileMD5(soFile))){ - Log.e(TAG,"So 库已存在"); - }else { + if (soFile.exists() && Objects.equals(md5, getFileMD5(soFile))) { + Log.e(TAG, "So 库已存在"); + } else { download(soUrl, md5, downloadFile, soFile); } @@ -156,8 +156,8 @@ public class CronetLoader extends CronetEngine.Builder.LibraryLoader { private static String getUrlMd5(String url) { - InputStream inputStream = null; - OutputStream outputStream = null; + InputStream inputStream; + OutputStream outputStream; try { outputStream = new ByteArrayOutputStream(); HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();