去除volley 中TAG的滥用导致无法重复加载同一url,项目整理
This commit is contained in:
@ -73,28 +73,19 @@ public class PackageUtils {
|
||||
}
|
||||
|
||||
/*
|
||||
* 判断是否可以更新
|
||||
* 判断是否可以更新,只判断gh_version的大小
|
||||
*/
|
||||
public static boolean isCanUpdate(Context context, GameUpdateEntity gameUpdateEntity) {
|
||||
// 判断是否gh_version是否相同
|
||||
// 判断是否gh_version是否存在
|
||||
String gh_version = (String) PackageUtils.getMetaData(
|
||||
context, gameUpdateEntity.getPackageName(), "gh_version");
|
||||
if (gh_version != null) {
|
||||
gh_version = gh_version.substring(2);
|
||||
// 判断gh_version是否相同
|
||||
if (gh_version.equals(gameUpdateEntity.getGhVersion())) {
|
||||
// 判断version是否相同
|
||||
String version = PackageUtils.getVersionByPackage(
|
||||
context, gameUpdateEntity.getPackageName());
|
||||
if (version != null && version.equals(gameUpdateEntity.getVersion())) {
|
||||
// 版本相同,无需显示插件更新,继续查看是否有可更新的游戏包
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// 判断gh_version的大小
|
||||
return Long.parseLong(gh_version) < Long.parseLong(gameUpdateEntity.getGhVersion());
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -102,10 +93,7 @@ public class PackageUtils {
|
||||
*/
|
||||
public static boolean isSignature(Context context, String packageName) {
|
||||
String signature = getApkSignatureByPackageName(context, packageName);
|
||||
if (publicKey.equals(signature)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return publicKey.equals(signature);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user