3

The current targetSdkVersion is 21, but I want to update it to 23. So I need to know all the API which need dangerous permissions. The amount of source code is huge. I cannot check code line by line.

eg: The permission of CAMERA; I need to take a pic in the app.

Is there a good idea could search the API in the source code?

SonhnLab
  • 321
  • 1
  • 11
Stone305585
  • 101
  • 1
  • 10
  • @NileshRathod I think the question is not duplicate since he wants to find out which API needs dangerous permission rather than, which permissions fall in dangerous category. – Sagar Jun 28 '18 at 05:51

2 Answers2

3

You can do it as follows:

  1. Go to settings and ensure Lint for missing 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 are using the APIs and proper permission check is required. Alternatively you can press Ctrl+Alt+I: missing permission

    Choose appropriate Scope Scope

    The errors will be shown at bottom as follows:

    lint error

    Double click on line to view specific line of code.

  3. Once you have identified those, check out your Manifest file too and check if you are using any of the dangerous permission
Sagar
  • 23,903
  • 4
  • 62
  • 62
0

If you want to know about the permissions then check the manifest file. you can find permissions there

MarGin
  • 2,078
  • 1
  • 17
  • 28
  • When I update the targetsdkversion to 23,I need to check dangerous permissions by code not write statements in manifest. So the most important is to know the api that need dangerous permissions. – Stone305585 Jun 28 '18 at 05:10