0

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:


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.

Test
  • 571
  • 13
  • 32
  • 1
    From your linked question "get device IMEI in flutter", there's also an answer about Android >= 10, see https://stackoverflow.com/a/64657600/1741542 – Olaf Dietsche Jul 05 '23 at 06:26

0 Answers0