I have a problem. I want to get the IMEI
and or serial number
of an Android device with the framework flutter.
For all solutions what I found, there were a fake IMEI
/ serial number
or there were empty.
So what is the best option to get the real IMEI
/ serial number
of an Android device ? The permission for phone.status
isGranted
. There could be also a possible solution to write real Android source code in Kotline or Java to use this IMEI
/ serial number
.
await Permission.phone.request();
var statusPhone = await Permission.phone.status;
if (statusPhone.isGranted) {
...
}
dependencies:
device_info: ^2.0.0
import 'package:device_info/device_info.dart';
...
void getDeviceData() async {
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
String imei = androidInfo.androidId; // IMEI-Nummer
String serialNumber = androidInfo.serial; // Seriennummer
print('IMEI: $imei');
print('Serial Number: $serialNumber');
}
I also tried:
- get device IMEI in flutter
unique_identifier
- https://pub.dev/packages/device_info_plus
device_info_plus
EDIT
Starting from Android 10, access to such sensitive device identifiers is restricted for privacy and security reasons. Google Play Store policies also enforce these restrictions.
https://developer.android.com/training/articles/user-data-ids
Is it possible at all to get such sensetive information as e.g. IMEI
? It is a private app and not for Google Play Store use.