Skip to content

修复Android 7.0升级闪退问题 #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -306,32 +306,30 @@ public void onResponse(File response, int id) {
* MD5 效验
*/
private boolean checkZipValidate(File file) {
if (file.exists()) {
byte[] json = FileManager.extractZip(file, "md5.json");
if (json == null) return false;
try {
Md5MapperModel mapper = ManagerFactory.getManagerService(ParseManager.class)
.parseObject(new String(json, "UTF-8"),
Md5MapperModel.class);
//校验文件正确性
List<Md5MapperModel.Item> lists = mapper.getFilesMd5();
// 按照md5值从小到大排列
Collections.sort(lists);
//所有md5想加得到总的md5
String total = "";
for (Md5MapperModel.Item item : lists) {
total = total + item.getMd5();
}
String finalMd5 = Md5Util.getMd5code(total);
//比较md5是否正确
newVersion = new JsVersionInfoBean(mapper.getJsVersion(), mapper.getAndroid(),
mapper.getTimestamp());
return mapper.getJsVersion().equals(finalMd5);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
if (!file.exists()) {
return false;
}
String json = FileManager.extractZip(file, "md5.json");
if (TextUtils.isEmpty(json)) {
return false;
}
Md5MapperModel mapper = ManagerFactory.getManagerService(ParseManager.class)
.parseObject(json,
Md5MapperModel.class);
//校验文件正确性
List<Md5MapperModel.Item> lists = mapper.getFilesMd5();
// 按照md5值从小到大排列
Collections.sort(lists);
//所有md5想加得到总的md5
String total = "";
for (Md5MapperModel.Item item : lists) {
total = total + item.getMd5();
}
return false;
String finalMd5 = Md5Util.getMd5code(total);
//比较md5是否正确
newVersion = new JsVersionInfoBean(mapper.getJsVersion(), mapper.getAndroid(),
mapper.getTimestamp());
return mapper.getJsVersion().equals(finalMd5);
}


Expand Down