大贤者
精华
|
战斗力 鹅
|
回帖 0
注册时间 2012-1-1
|
本帖最后由 すぴぱら 于 2020-4-28 19:33 编辑
我简短的翻译一下android官方文档(至于国产rom是怎么处理的,根据我的APP适配经验,10之后几个大厂都各有各的自家标识符方案,但至少应用拿不到imei了),READ_PHONE_STATE这个权限目前来说是废的,什么都拿不到,既不能获取到电话号,也不能拿到任何固定设备标识符,只是为了兼容android p以前的app而已。
Restriction on non-resettable device identifiers
对不可重置设备标识符的限制
Starting in Android 10, apps must have the READ_PRIVILEGED_PHONE_STATE privileged permission in order to access the device's non-resettable identifiers, which include both IMEI and serial number.
在Android 10之后,应用必须具有READ_PRIVILEGED_PHONE_STATE的系统级权限(这个权限只有系统app能拿到)才可访问不可重置设备标识符,包括IMEI和设备序列码。
Affected methods include the following:
以下方法会受到影响:
Build
getSerial() ,获取机器序列号
TelephonyManager
getImei(),获取IMEI
getDeviceId(),获取设备ID
getMeid(), 获取MEID
getSimSerialNumber(),获取ICCID
getSubscriberId(),获取IMSI
If your app doesn't have the permission and you try asking for information about non-resettable identifiers anyway, the platform's response varies based on target SDK version:
如果你的APP没有这个权限,却试图去获取不可重置标识符,根据目标SDK的版本有以下几种返回情况
If your app targets Android 10 or higher, a SecurityException occurs.
如果目标SDK是 Android 10 以上,则发生SecurityException异常
If your app targets Android 9 (API level 28) or lower, the method returns null or placeholder data if the app has the READ_PHONE_STATE permission.
如果目标SDK是 Android 9(API 等级28) 以下,会返回一个空值
除非国产ROM各种魔改,在Android 10之后在隐私方面耍流氓太难了
所以现在国产流氓APP怎么拿隐私呢,他靠用户注册,反正你们都要注册,自己会乖乖填微信号微博号QQ号手机号实名认证,用户嘴上说着不要,身体老实的很
|
|