Read permission of installed Application in android phone?

二次信任 提交于 2020-01-03 07:16:06

问题


I want to read permission of other applications installed in my android mobile using programming.

I think Android Cleaner read permission of other apps and display details like

I want get detail like this Image.

In this it's give details of Ad Network

How i get details like this app in my app?

If this app not Read Permission then How it's do it?


回答1:


Well you can scrape the playstore app page for a given app and get the permissions it needs :)

Well that's just off the top of my head. On a serious note, you can do the following:

Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
List appsList = getPackageManager().queryIntentActivities(intent, 0);

for (Object app : appsList) {
    ResolveInfo resolveInfo = (ResolveInfo) app;
    PackageInfo packageInfo = null;
    try {
        packageInfo = getPackageManager().getPackageInfo(resolveInfo.activityInfo.packageName, PackageManager.GET_PERMISSIONS);
    } catch (NameNotFoundException ex) {
        ex.printStackTrace();
    }

    String[] requestedPermissions = packageInfo.requestedPermissions;
}


来源:https://stackoverflow.com/questions/25244456/read-permission-of-installed-application-in-android-phone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!