Cronet:优化预下载逻辑

pull/1181/head
ag2s20150909 3 years ago
parent 3f4baaa646
commit 53be30e611
  1. 6
      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() { public void preDownload() {
new Thread(() -> { new Thread(() -> {
String md5 = getUrlMd5(md5Url); String md5 = getUrlMd5(md5Url);
if(soFile.exists()&&Objects.equals(md5, getFileMD5(soFile))){
Log.e(TAG,"So 库已存在");
}else {
soFile.deleteOnExit();
download(soUrl, md5, downloadFile, soFile); download(soUrl, md5, downloadFile, soFile);
}
Log.e(TAG, soName); Log.e(TAG, soName);
}).start(); }).start();

Loading…
Cancel
Save