admin
2023-10-08 2c5b6e472c368e80d85b8ea2b461c9ea62981d9b
library-APPUpdate/src/com/yeshi/appupdate/util/PackageUtils2.java
@@ -14,8 +14,7 @@
            int currentVersion = info.versionCode;
            SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
            int lastVersion = prefs.getInt("version_code", 0);
            if (currentVersion > lastVersion) { // 濡傛灉褰撳墠鐗堟湰澶т簬涓婃鐗堟湰锛岃鐗堟湰灞炰簬绗竴娆″惎鍔?
                // 灏嗗綋鍓嶇増鏈啓鍏reference涓紝鍒欎笅娆″惎鍔ㄧ殑鏃跺?锛屾嵁姝ゅ垽鏂紝涓嶅啀涓洪娆″惎鍔?
            if (currentVersion > lastVersion) {
                prefs.edit().putInt("version_code", currentVersion).commit();
                return true;
            } else {
@@ -28,10 +27,10 @@
    }
    
    /**
     * 鑾峰彇versionCode
     * 获取versionCode
     * 
     * @param context
     * @return 鐗堟湰鍙?
     * @return
     */
    public static int getVersionCode(Context context) {
        try {