From 589e855aba4cb9de6e7135952cc361e9033c4e9d Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Wed, 13 Nov 2024 10:53:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=8B=E8=BD=BD=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E4=B8=AD=E6=A3=80=E6=B5=8Bapk=E5=AE=8C=E6=95=B4?= =?UTF-8?q?=E6=80=A7=E6=97=B6=E9=A1=BA=E4=BE=BF=E5=90=8C=E6=AD=A5=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E7=89=88=E6=9C=AC=E5=8F=B7=E6=98=AF=E5=90=A6=E5=92=8C?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E5=90=A7=E7=89=88=E6=9C=AC=E5=8F=B7=E4=B8=80?= =?UTF-8?q?=E8=87=B4=EF=BC=8C=E5=A6=82=E6=9E=9C=E4=B8=80=E8=87=B4=E8=AE=A4?= =?UTF-8?q?=E4=B8=BA=E5=B0=B1=E6=98=AF=E6=9C=80=E6=96=B0=E5=8C=85=E4=B8=8D?= =?UTF-8?q?=E5=86=8D=E9=87=8D=E5=A4=8D=E5=AE=89=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/yunbao/common/server/DownloadService.java | 2 ++ 1 file changed, 2 insertions(+) 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(); }