Remove extra unwanted permissions from manifest android

15,091

Solution 1

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.

Solution 2

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"/>

Solution 3

You can remove the permission and check the lint results. If the results are clean then the permission is not being used.

Analyse -> Run Inspection by Name -> Type "Missing Permissions" -> Run

Android studio Version: 3.0.1

Share:
15,091
Mitul Nakum
Author by

Mitul Nakum

-Mobile Solutions RulTech’s developer teams can meet any mobile need our clients may have. Development is carried out in a methodical, efficient process in order to achieve maximum customer satisfaction. Smart phones are an indispensable tool for businesses and consumers alike. RulTech sees the long-term evolution of the marketplace and can align your product with those trends. -Visual Design And User Experience These go hand in hand. Visual design makes your app attractive. The user experience makes your app easy to use and intuitive. We'll bring them together and make your application look and feel great. Our creative team will work with your company to understand your users' preferences and will then tailor an app just for them. As a client, deliverable you would receive include User Storyboards, Illustrations, Animations, Wire frames, and Prototypes. -Mobile Engineering Simply put, our apps work extraordinarily well. Mobile platforms, devices, and carriers all add complexities to creating a workable app. We develop with all of these factors in mind and then test, test, test, and test some more to ensure the quality of the product and, ultimately, the satisfaction of your users.

Updated on June 08, 2022

Comments

  • Mitul Nakum
    Mitul Nakum almost 2 years

    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