To find list of permissions used by an installed application in android
The below code not only retrieves the permission , but will also retrieve services , receivers . Be careful on PackageManager tags. This will only fetch you the corresponding information on specific packages .
PackageManager p = this.getPackageManager(); final List < PackageInfo>; appinstall=p.getInstalledPackages(PackageManager.GET_PERMISSIONS|PackageManager.GET_RECEIVERS| PackageManager.GET_SERVICES|PackageManager.GET_PROVIDERS); for(PackageInfo pInfo:appinstall){ //PermissionInfo[] permission=pInfo.permissions; String[] reqPermission=pInfo.requestedPermissions; ServiceInfo[] services=pInfo.services; ProviderInfo[] providers=pInfo.providers; int versionCode=pInfo.versionCode; Log.d("versionCode-package ",Integer.toString(versionCode)); Log.d("Installed Applications", pInfo.applicationInfo .loadLabel(pm).toString()); Log.d("packegename",pInfo.packageName. toString()); if(reqPermission!=null) for(int i=0;i < reqPermission.length;i++) Log.d("permission list",reqPermission[i]);