If I wanted to research how and where permissions [requested in the Mainfest.xml] were used in an Android app for the purposes of removing them is there an easy way of doing
Take a look at http://developer.android.com/reference/android/Manifest.permission.html look for the permission you used in your Mainfest
Best way is to understand what the may actually do. If it is ever going to use the camera then you know you need the camera permission.
The way I would do it for an app for which I didn't write the code would be to remove the permissions one by one and test the app end-to-end each time. When it fails, narrow it down. If not, that permission may not be used.
You will have to try removing them one by one and checking i fthe app still works OK. This is not checked by lint in any way (it should be).
When they come back (they are currently down), you can upload your apk to this website (if that's ok with you) and let them statically analyse the permissions you are using: http://www.android-permissions.org/
I came from the future to save your lives.
Here (in the future), LINT does check for missing permissions as you can see on LINT checks.
AndroidManifest.xml
and remove all tags <uses-permission>
using Android permissions (meaning, don't delete permissions that belong to your app, such as UA_DATA
and C2D_MESSAGE
).Analyze
then Inspect Code...
Android -> Constant and Resource Type Mismatches
Apply fix "Add Permission"
. If you select this option, Android Studio will include one permission for every error. So you'll end up with multiple copies of the same permission on your Manifest file, just delete the duplicates. You can do it manually too.Here is the description of the LINT rule:
ID ResourceType
Description
This inspection looks at Android API calls that have been annotated with various support annotations (such as RequiresPermission or UiThread) and flags any calls that are not using the API correctly as specified by the annotations. Examples of errors flagged by this inspection:
- Passing the wrong type of resource integer (such as R.string) to an API that expects a different type (such as R.dimen).
- Forgetting to invoke the overridden method (via super) in methods that require it
- Calling a method that requires a permission without having declared that permission in the manifest
- Passing a resource color reference to a method which expects an RGB integer value.
...and many more. For more information, see the documentation at http://developer.android.com/tools/debugging/annotations.html
I'm using Android Studio 2.1.2.
Or you could just learn what your app does and then go through the permissions and see which ones are extra. What does your app do, what phone features does it use. There should be some documentation somewhere on what it should do and what methods are in there