0

I would like to create a licensing system to activate my application. For that the user must send his IMEI (or number never changing on the telephone in order to identify it).

After my research I did not find how to get the IMEI of a phone. There is the device_info package but this one does not give me this information.

I saw that now we can use the UUID. But I'm wondering I read it could change if I reset the phone or reinstall the app. Is it true ?

Phones on which my app will be installed can be reset and the app reinstalled often. So what should I do to have a phone number that never changes, allowing me to build my License system which is offline ?

Thank you by advance for advices.

xenos92
  • 231
  • 6
  • 26

2 Answers2

1

Maybe try it with this Flutter plugin: https://pub.dev/packages/imei_plugin

[UPDATE]

According to the Documentation the UUID (Android 10 and higher) could change at a factory reset.

A 64-bit number (as a hex string) that is randomly generated when the user first sets up the device and should remain constant for the lifetime of the user's device. The value may change if a factory reset is performed on the device.

About UUID behaviour on Android update there isn't much documentation online, but you can check This answer

  • In some rare circumstances, this ID may change. In particular, if the device is factory reset a new device ID * may be generated. In addition, if a user upgrades their phone from certain buggy implementations of Android 2.2 * to a newer, non-buggy version of Android, the device ID may change. Or, if a user uninstalls your app on * a device that has neither a proper Android ID nor a Device ID, this ID may change on reinstallation.

So you should either think about a different licensing system method or make a support option to change the license to a new UUID after a factory reset.

w0rsti
  • 36
  • 2
  • Yes, get IMEI for Android devices less than android 10 with runtime permission for android greater than or equal to 10 returns a UUID. So on Android version greater than 10 I've an UUID. This is the same thing as IMEI ? Does this number never change even after reinitializing the phone or reinstalling the application? – xenos92 Dec 05 '20 at 10:33
  • Thank you for your response. My license system is offline so I generate an imei on the user's phone. He gives me this number and I generate his license. For validate his license I look in the multiple license informations if the imei is the same of the user's phone. My app must be offline and the user's phone could not be connected to internet and are erased sometimes. So UUID looks not good for do that. I'm not a pro and it's my first license program. Could you say me how to do this system? – xenos92 Dec 05 '20 at 15:56
  • the suggested plugin `imei_plugin` is not available for `null safe` versions of flutter apps – Jorge Luis Jun 20 '21 at 18:46
0

According to Android docs, starting from Android 10 and higher, apps downloaded from playstore cannot declare privileged permissions such as READ_PRIVILEGED_PHONE_STATE used in order to access IMEI:

Statement

I suggest using UUID and you can use unique_identifier plugin. Indeed, it changes, what about associating to another unique id that you manage on the server, like having a table on server where you store both, your mobile app UUID and another identifier that never changes, and when UUID changes on the mobile app, you can just update it on the server?

Fahima Mokhtari
  • 1,691
  • 2
  • 16
  • 30