package com.bonait.bnframework.common.helper;

import android.content.Context;

/**
 * 获取当前的包版本
 */
public class Utils {

    /*
     * 获取当前app的versionCode
     * return int
     */
    public static int getversionCode(Context context) {
        int verCode = -1;
        try {
            verCode = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionCode;
        } catch (Exception e) {
            android.util.Log.e("mUtils-gerversionCode", e.getMessage());
        }
        return verCode;
    }
}