问题
I've just created a very simple Android application that captures an Intent, manipulates it a bit, and sends out a new Intent. I transferred the app to my phone with adb install
, and now looking at the app's requested permissions, I'm seeing that it requires permissions I never asked for:
- read phone status and identity
- modify or delete the contents of your USB storage
- test access to protected storage
There's nothing in my manifest file requesting permissions, and the app itself is dead simple (here's the source on GitHub). Are these extra permissions added because I installed it with adb install
, perhaps? Or is there something in my app that merits requiring these permissions that I'm just not seeing?
回答1:
You are missing a <uses-sdk>
element with android:minSdkVersion
. These permissions were added to Android after its initial release, and apps supporting very old Android devices have these permissions "grandfathered in".
You really should add <uses-sdk>
and add android:minSdkVersion
, saying how old of an Android device (from an API level standpoint) you are willing to support.
来源:https://stackoverflow.com/questions/17794673/my-android-application-requires-permissions-i-didnt-request