Merge remote-tracking branch 'origin/dev' into dev-5.13.0

# Conflicts:
#	app/src/main/java/com/gh/common/util/DetailDownloadUtils.java
#	app/src/main/java/com/gh/gamecenter/forum/home/ForumActivityFragment.kt
#	app/src/main/java/com/gh/gamecenter/forum/home/ForumArticleListFragment.kt
#	app/src/main/java/com/gh/gamecenter/gamecollection/square/GameCollectionSquareFragment.kt
This commit is contained in:
chenjuntao
2022-08-17 15:57:56 +08:00
28 changed files with 473 additions and 143 deletions

View File

@ -137,6 +137,7 @@ public class PackageUtils {
if (vGameEntity != null) {
String md5FromInstalledVGame = ExtensionsKt.getMetaExtra(vGameEntity.getDownloadEntity(), Constants.APK_MD5);
String md5FromRequest = apkEntity.getMd5();
apkEntity.setPlatform(VHelper.PLATFORM_V);
shouldShowUpdate = md5FromRequest != null && !md5FromRequest.equals(md5FromInstalledVGame);
} else {
@ -502,8 +503,14 @@ public class PackageUtils {
* 注意目测只对能启动的app有效(有桌面图标),对一些没有桌面图标的应用无效(参考应用:魅族游戏框架)
*/
public static boolean isInstalled(Context context, String packageName) {
Intent intent = context.getApplicationContext().getPackageManager().getLaunchIntentForPackage(packageName);
return intent != null;
try {
Intent intent = context.getApplicationContext().getPackageManager().getLaunchIntentForPackage(packageName);
return intent != null;
} catch (IllegalArgumentException exception) {
// 一些设备调用获取 intent 的时候会触发 Parcel.readException !
exception.printStackTrace();
return false;
}
}
public static boolean isInstalledFromAllPackage(Context context, String packageName) {