In Flutter, I want to get the serial number of the sim. I used the package sim_data_plus. It works perfectly fine for Android 12 and lesser versions. But even though the package says that it provides support for Android 12 and above, I am not able to read the serial number of a sim present in a phone running on Android 13. I do not intend to get the mobile number, I intend to get the sim serial number.
Asked
Active
Viewed 110 times
0
-
2That is [an OS restriction](https://developer.android.com/about/versions/10/privacy/changes#non-resettable-device-ids). – CommonsWare Jul 10 '23 at 12:47
-
1it is not possible even android 12 devices also – Anand Jul 10 '23 at 13:09
-
It is possible in Flutter. I am able to get the serial number of a sim in android 11 and android 12. – Kirthana Jul 11 '23 at 06:15
1 Answers
1
It is not possible to get sim serial number android 10 or higher
According to android's official document
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:
If your app targets Android 10 or higher, a SecurityException occurs. 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. Otherwise, a SecurityException occurs.

Anand
- 4,355
- 2
- 35
- 45