Saturday, January 13, 2018

Read APK permission by shell command


I want to read the requested permissions of an .apk file on the computer (android sdk is installed) via command line.


I.E.:


$ android read-permissions /path/to/someapp.apk

I know this is possible, I just cant find the proper command.



Answer



If I'm interpreting "on the computer" correctly to mean "I want to use the command line on my computer to read an .apk file's permissions" then you can do that with aapt on a local file like so:



C:\>aapt d permissions "MyApp.apk"
package: com.app.myapp
uses-permission: android.permission.ACCESS_NETWORK_STATE
uses-permission: android.permission.INTERNET

If you mean that the .apk is on the device, then I'm not aware of a way to do this aside from pulling it and running aapt as above. pm has a list permissions command but it just lists all available permissions on the device and does not accept a package as a parameter (as far as I know, anyway).


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...