version:2.0.1.6_release
update:2020.07.09 fix:主页区分教管易和设备信息更新,进入主页不自动检查自身更新 add:统一下载逻辑
This commit is contained in:
@@ -39,6 +39,10 @@ import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.arialyy.aria.core.Aria;
|
||||
import com.blankj.utilcode.util.EncryptUtils;
|
||||
import com.blankj.utilcode.util.PathUtils;
|
||||
import com.google.zxing.BarcodeFormat;
|
||||
import com.google.zxing.EncodeHintType;
|
||||
import com.google.zxing.WriterException;
|
||||
@@ -969,4 +973,26 @@ public class Utils {
|
||||
context.startActivity(iReboot);
|
||||
}
|
||||
|
||||
}
|
||||
private static String getFileNamefromURL(String url) {
|
||||
int position = url.lastIndexOf("/");
|
||||
return url.substring(position + 1);
|
||||
}
|
||||
|
||||
private String getMD5fromFileName(String fileName) {
|
||||
int position = fileName.lastIndexOf("/");
|
||||
return fileName.substring(position + 9);
|
||||
|
||||
}
|
||||
|
||||
public static void ariaDownload(Context context, String url, JSONObject jsonObject) {
|
||||
String fileName = getFileNamefromURL(url);
|
||||
Aria.download(context)
|
||||
.load(url) //读取下载地址
|
||||
.setFilePath(PathUtils.getExternalDownloadsPath() + "/jgy/" + fileName, true)
|
||||
.setExtendField(jsonObject.toJSONString())
|
||||
.create(); //启动下载}
|
||||
// SaveListUtils.addDownLoadList(app_package);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user