apk - Android permission clean-up -


i know question has been answered here, while ago , since no answer has been given , might have changed, ask again:

is there tool or ide plugin analyzes either source code or apk see if permissions being used anywhere in app. there lot of libraries, , large project not wise remove permission , running smoke test on app since used @ subtle places.

for example, not know why have permission read_sms, if remove since there no obvious use of it, later cause crash.

lint check missing permissions can see on lint checks.

  • so, go androidmanifest.xml , remove tags <uses-permission> using android permissions (meaning, don't delete permissions belong app, such ua_data , c2d_message).
  • then run lint analysis. click on analyze inspect code...
  • look under android -> constant , resource type mismatches
  • you should see missing permissions.
  • then can right-click them , select apply fix "add permission". if select option, android studio include 1 permission every error. you'll end multiple copies of same permission on manifest file, delete duplicates. can manually too.

here description of lint rule:

 id resourcetype

 description

this inspection looks @ android api calls have been annotated various support annotations (such requirespermission or uithread) , flags calls not using api correctly specified annotations. examples of errors flagged inspection:

  • passing wrong type of resource integer (such r.string) api expects different type (such r.dimen).
  • forgetting invoke overridden method (via super) in methods require it
  • calling method requires permission without having declared permission in manifest
  • passing resource color reference method expects rgb integer value.

...and many more. more information, see documentation @ http://developer.android.com/tools/debugging/annotations.html


i'm using android studio 2.1.2.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -