Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Q 下 getUDID 发生 SecurityException 异常 #128

Open
shengdoushi opened this issue Jul 30, 2019 · 4 comments
Open

Android Q 下 getUDID 发生 SecurityException 异常 #128

shengdoushi opened this issue Jul 30, 2019 · 4 comments

Comments

@shengdoushi
Copy link
Contributor

应该是与 Android Q 的隐私权有关: https://developer.android.com/preview/privacy/data-identifiers#device-ids

@shengdoushi
Copy link
Contributor Author

当 android 项目的 目标改为 29 时,会发生.

@shengdoushi
Copy link
Contributor Author

mTelephonyManager.getDeviceId() 时发生异常

@shengdoushi
Copy link
Contributor Author

另一个问题是 在 Android 6.0(API 级别 23)及更高版本中,本地设备 MAC 地址(例如 WLAN 和蓝牙)无法通过第三方 API 获取。WifiInfo.getMacAddress() 方法和 BluetoothAdapter.getDefaultAdapter().getAddress() 方法都会返回 02:00:00:00:00:00。

所以 android 上的 getOpenUDID() 现有的两种方案(获取手机识别码和mac地址), 想要获取持久化的UDID比较难了

@chgowolf
Copy link

chgowolf commented Aug 1, 2019

可以考虑使用阿里的UTDID库,安卓和IOS都支持

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants