6

Is it possible to get the manifest permissions of any installed Android application?

Krypton
  • 3,307
  • 5
  • 31
  • 51
kopi_b
  • 1,423
  • 3
  • 15
  • 19

3 Answers3

16

Thanks for the hint,got it running with:

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;
}
Parvaz Bhaskar
  • 1,357
  • 9
  • 29
kopi_b
  • 1,423
  • 3
  • 15
  • 19
2

Get installed packages using this.

final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
final List pkgAppsList = context.getPackageManager().queryIntentActivities( mainIntent, 0);

And use the package name to get the info.

http://developer.android.com/reference/android/content/pm/PackageInfo.html

Brian Matthews
  • 8,229
  • 6
  • 43
  • 67
Aniket Awati
  • 1,363
  • 3
  • 13
  • 19
0

If you have apk file it is very simple just open cmd from start menu and write this command line:

aapt d permissions D:\dina\app-debug.apk 

take care for the path you write then you can get list from all permissions in this application and package name also like this:

package: com.example.dinasaif.facebookintegration
uses-permission: android.permission.INTERNET
Cœur
  • 34,719
  • 24
  • 185
  • 251
dina saif
  • 11
  • 3