为什么要添加READ_PHONE_STATE权限? [英] Why has the READ_PHONE_STATE permission been added?

查看:2874
本文介绍了为什么要添加READ_PHONE_STATE权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我刚刚发布到Play商店的最新Beta版本中,我注意到READ_PHONE_STATE是自先前版本以来添加的.

In the latest beta version I just published to the Play Store, I notice that the READ_PHONE_STATE has been added since the previous version.

我还没有添加此内容.我可以回想起的所有事情,因为以前的版本使用的是各种播放服务库的v9.6.0(原为v9.4.0):

I haven't added this myself. All I can recall doing since the previous version is using v9.6.0 of various play-services libraries (was v9.4.0):

compile 'com.google.android.gms:play-services-location:9.6.0'
compile 'com.google.android.gms:play-services-places:9.6.0'
compile 'com.google.android.gms:play-services-auth:9.6.0'

这会做到吗?我看不到有文件记录.我可以取消许可吗?

Would this have done it? I can't see it documented. Can I get rid of the permission?

根据此答案 ...在我的情况下没有区别.

And I've ensured that all the of the libraries I'm using match the main app, as per this answer... makes no difference in my case.

编辑

基于此内容确定文章,我已深入研究日志输出以查找:

OK based on this article, I've delved into my log output to find:

ADDED from [Meteogram:jobdispatcher:unspecified] C:\Users\Me\AndroidStudioProjects\Meteogram\app\build\intermediates\exploded-aar\Meteogram\jobdispatcher\unspecified\AndroidManifest.xml:37:25-84 android:uses-permission#android.permission.READ_PHONE_STATE

但是自上一个版本以来,jobdispatcher库(我将其作为gradle模块导入到我的项目中)的库没有任何改变.

But nothing has changed in the jobdispatcher library (which I imported into my project as a gradle module) since the last version.

EDIT2

该日志中还有更多内容,我的感觉可能是由于怀疑的播放服务库版本?

Here is a bit more from that log, and my feeling is that maybe it is due to the play-services library version as suspected?

ADDED from [Meteogram:jobdispatcher:unspecified] C:\Users\Me\AndroidStudioProjects\Meteogram\app\build\intermediates\exploded-aar\Meteogram\jobdispatcher\unspecified\AndroidManifest.xml:37:17-87
    android:name
        ADDED from [Meteogram:jobdispatcher:unspecified] C:\Users\Me\AndroidStudioProjects\Meteogram\app\build\intermediates\exploded-aar\Meteogram\jobdispatcher\unspecified\AndroidManifest.xml:37:25-84
android:uses-permission#android.permission.READ_PHONE_STATE
IMPLIED from C:\Users\Me\AndroidStudioProjects\Meteogram\app\src\pro\AndroidManifest.xml:2:1-12:12 reason: com.google.android.gmscore.integ.client.location has a targetSdkVersion < 4
activity#com.google.android.gms.common.api.GoogleApiActivity

targetSdkVersion < 4与上面链接的其他答案匹配,但是在这种情况下我可以做些什么,因为play-services库不是我的?

The targetSdkVersion < 4 matches with the other answer linked above, but is there anything I can do in this situation, since the play-services library is not mine?

EDIT3

我找到了答案...而不是删除此问题,我会保留解决方案,以防其他人使用(如果其他人有更好的解决方案!)

I found an answer... rather than delete this question I'll leave it up, with solution, in case it's useful for others (and in case someone else has a better solution!)

EDIT4

它似乎已在9.6.1中修复.

推荐答案

我最终找到了答案#3 中提到了一种解决方法删除手动"权限(我的假设是,只有非常早的Android版本才需要该权限,因为我的minSdk是16,这对我来说是可以的):

I eventually found this, which reports the same issue. One workaround is mentioned in Answer #3, which is to remove the permission "manually" (my assumption is that the permission is only required for very early Android versions, which is OK for me since my minSdk is 16):

<manifest ...
    xmlns:tools="http://schemas.android.com/tools"
    ... >

<uses-permission
    android:name="android.permission.READ_PHONE_STATE"
    tools:node="remove" />

这篇关于为什么要添加READ_PHONE_STATE权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆