breautek edited a comment on issue #91: URL: https://github.com/apache/cordova-plugin-device/issues/91#issuecomment-792727277
> So how i can get the serial number? In API 28+ you need to qualify in one of these conditions: https://developer.android.com/reference/android/os/Build#getSerial() * If the calling app has been granted the `READ_PRIVILEGED_PHONE_STATE` permission; this is a privileged permission that can only be granted to apps preloaded on the device. * If the calling app is the device or profile owner and has been granted the `READ_PHONE_STATE` permission. The profile owner is an app that owns a managed profile on the device; for more details see [Work profiles](https://developer.android.com/work/managed-profiles). Profile owner access is deprecated and will be removed in a future release. * If the calling app has carrier privileges on any active subscription. * If the calling app is the default SMS role holder In other words, unless if you're a very special app, you cannot read the serial number anymore. As of API 26, the native `serial` property will always be `unknown`. On API 28 or lower, the native `getSerial` method will be `unknown` unless if your app matches one of the conditions above. On API 29 or later, the native `getSerial` method will throw an exception unless if your app matches one of the conditions above. I advise reading Google's [recommendations](https://developer.android.com/training/articles/user-data-ids) for what to use instead. Closing this as won't fix. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
