Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove extra unwanted permissions from manifest android

I have android app, I want to check that every permissions mentioned in Manifest is required or not?

Basically I want remove unwanted permissions.

what should I do?

Thanks in advance

like image 572
Mitul Nakum Avatar asked Nov 24 '11 12:11

Mitul Nakum


2 Answers

For Android Studio:

1) Find which permissions are added (app\build\intermediates\manifests)

2) Add these permissions with tools:node="remove"

Example:

I found that I have unwanted permission:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

And I removed it by adding this to my app manifest:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:node="remove"/>
like image 136
Michal Avatar answered Sep 29 '22 10:09

Michal


The answer given by user370305 is generally the correct one. Your third-party code should adequately document what permissions it needs -- combine that with the permissions your own code needs, and you should be set.

If you feel that this is insufficient, then:

Step #1: Write a unit test suite.

Step #2: Add tests to the suite until you have complete statement coverage.

Step #3: Get all tests passing in the unit test suite.

Step #4: Remove a permission and see if tests fail. Restore the permissions that cause test suite failure. Repeat for all permissions you are uncertain of.

like image 42
CommonsWare Avatar answered Sep 29 '22 10:09

CommonsWare