androd packagemanager 获取 apk 信息

//已安装的应用信息
List<PackageInfo> packageInfos = getPackageManager()
				.getInstalledPackages(PackageManager.GET_UNINSTALLED_PACKAGES);
//判断是否是第三方应用
boolean thirdApp = false ;
if((packageInfo.applicationInfo.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0){
	thirdApp = true;
}else if((packageInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0){
	thirdApp = true;
}
     //获得当前应用的permission
      PackageInfo permissionInfo = null;
      try {
       permissionInfo = pm.getPackageInfo(packageInfo.packageName,
         PackageManager.GET_PERMISSIONS);
      } catch (Exception e) {
       e.printStackTrace();
      }
      
      if(permissionInfo != null){
       //得到当前应用的所有permission
       String[] permissions = permissionInfo.requestedPermissions;
 

 

你可能感兴趣的:(package)