All device IDs will be protected by the privilege READ_PRIVILEGED_PHONE_STATE. ** This permission cannot be granted to third party apps. (Angry) **
Below, official. https://developer.android.com/about/versions/10/privacy/changes?hl=ja#non-resettable-device-ids The following methods are restricted.
Target.java
Build class
getSerial()
TelephonyManager class
getImei()
getDeviceId()
getMeid()
getSimSerialNumber()
getSubscriberId()
Instead of the usual grants such as request permissions It is necessary to describe the permission directly in the corresponding application part of the setting file existing on the terminal. The following article was helpful. https://qiita.com/hiesiea/items/6a2deb479958a3b44707#read_privileged_phone_state%E3%82%92%E3%83%9B%E3%83%AF%E3%82%A4%E3%83%88%E3%83%AA%E3%82%B9%E3%83%88%E3%81%AB%E8%BF%BD%E5%8A%A0%E3%81%99%E3%82%8B
However, this authority can be granted only Limited to pre-installed apps and apps distributed by mobile carriers.
Apps that you normally put on the Play Store I can no longer get the ID associated with the device. (Apps pre-installed on the device and You can use apps provided by mobile carriers)
It is called prohibition of direct path access by storage according to the target range, From API29, access to the terminal is being restricted more and more. (I overdo it and it is alleviated by API30 ...)
https://source.android.com/devices/tech/config/device-identifiers
Recommended Posts