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:
Go to Settings and make sure Lint with lost permissions is enabled.
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 pressCtrl+Alt+I
:
The error will appear at the bottom as follows:
Double-click a line to view a specific line of code.
- Once you’ve identified those, also check your list file and check if you’re using any dangerous permission