diff --git a/common/src/main/java/com/yunbao/common/server/DownloadService.java b/common/src/main/java/com/yunbao/common/server/DownloadService.java index 95f5fe29a..15ac17b82 100644 --- a/common/src/main/java/com/yunbao/common/server/DownloadService.java +++ b/common/src/main/java/com/yunbao/common/server/DownloadService.java @@ -188,8 +188,10 @@ public class DownloadService extends Service { if (downloadFile == null || !downloadFile.exists()) return false; try { PackageManager pm = mContext.getPackageManager(); + PackageInfo packageInfo = pm.getPackageInfo(getPackageName(), Context.MODE_PRIVATE); PackageInfo info = pm.getPackageArchiveInfo(downloadFile.getAbsolutePath(), PackageManager.GET_ACTIVITIES); if (info == null) return false; + if(info.versionCode == packageInfo.versionCode) return false; } catch (Exception e) { e.printStackTrace(); }