获取apk文件包信息

PackageManager pm = context.getPackageManager();
PackageInfo info = pm.getPackageArchiveInfo(filePath, PackageManager.GET_ACTIVITIES);  // filePath为apk文件路径
return info.versionCode;  // apk安装包中的版本号

你可能感兴趣的:(获取apk文件包信息)