我通过gradlew assembleRelease
制作了APK。我的APK需要下一个权限:
> aapt d permissions app-release.apk
package: <my-package>
permission: <my-package>.permission.C2D_MESSAGE
uses-permission: name='<my-package>.permission.C2D_MESSAGE'
uses-permission: name='android.permission.INTERNET'
uses-permission: name='android.permission.ACCESS_NETWORK_STATE'
uses-permission: name='android.permission.ACCESS_FINE_LOCATION'
uses-permission: name='android.permission.RECEIVE_SMS'
uses-permission: name='android.permission.WAKE_LOCK'
uses-permission: name='android.permission.WRITE_EXTERNAL_STORAGE' maxSdkVersion='18'
uses-permission: name='com.google.android.c2dm.permission.RECEIVE'
但是当我将该apk上传到Google Play时,我获得了此权限:
android.permission.ACCESS_FINE_LOCATION
android.permission.ACCESS_NETWORK_STATE
android.permission.INTERNET
android.permission.READ_EXTERNAL_STORAGE
android.permission.RECEIVE_SMS
android.permission.WAKE_LOCK
android.permission.WRITE_EXTERNAL_STORAGE maxSdkVersion=18
<my-package>.permission.C2D_MESSAGE
com.google.android.c2dm.permission.RECEIVE
因此,当我尝试通过Google Play更新我的应用时,它需要额外的权限(之前的版本不需要android.permission.READ_EXTERNAL_STORAGE)。但是如果我在设备上打开相同的apk,则不需要许可。
也许,我真的需要这个权限,但我的apk不包含它(并且应该在运行时崩溃)。那么,为什么谷歌会添加它以及我如何避免它呢?
答案 0 :(得分:1)
我相信这已在以下问题中得到解答:
Google Play shows the implicit READ_EXTERNAL_STORAGE permission