是否有可能获取任何已安装的Android应用程序的清单权限?
是否有可能获取任何已安装的Android应用程序的清单权限?
感谢提示,我用以下代码让它运行起来:
final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
final List pkgAppsList = getPackageManager().queryIntentActivities(mainIntent, 0);
for (Object obj : pkgAppsList) {
ResolveInfo resolveInfo = (ResolveInfo) obj;
PackageInfo packageInfo = null;
try {
packageInfo = getPackageManager().getPackageInfo(resolveInfo.activityInfo.packageName, PackageManager.GET_PERMISSIONS);
} catch (NameNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String[] requestedPermissions = packageInfo.requestedPermissions;
}
final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
final List pkgAppsList = context.getPackageManager().queryIntentActivities( mainIntent, 0);
aapt d permissions D:\dina\app-debug.apk
请注意您编写的路径,然后您就可以获取此应用程序和包名称中所有权限的列表,就像这样:
package: com.example.dinasaif.facebookintegration
uses-permission: android.permission.INTERNET