Java – How to find all the dangerous permissions used on earlier versions in Android Project

How to find all the dangerous permissions used on earlier versions in Android Project… here is a solution to the problem.

How to find all the dangerous permissions used on earlier versions in Android Project

The current targetSdkVersion is 21, but I want to update to 23. So I need to know all the APIs that require dangerous permissions. The amount of source code is huge. I can’t check the code line by line.

For example: CAMERA’s license; I need to take a picture in the app.

Is there a good way to search for APIs in the source code?

Solution

You can do it as follows:

  1. Go to Settings and make sure Lint with lost permissions is enabled.

    Lint

  2. Then go to Analyze -> Run inspection by name -> Enter Missing permission and press Enter. This will list all the places where you use the API and will need to be checked for proper permissions. Alternatively, you can press Ctrl+Alt+I:
    missing permission

    Select the appropriate range
    Scope

    The error will appear at the bottom as follows:

    lint error

    Double-click a line to view a specific line of code.

  3. Once you’ve identified those, also check your list file and check if you’re using any dangerous permission

Related Problems and Solutions