Maher Tannous 3 Posted March 10, 2023 I tried to get IMEI number and succeeded in all Android versions except 10-11-12-13 in versions 10-11-12-13 the application not shown the main form I am using Android sdk 26.1.1.32 with api level 33 and android-ndk-r21 and jdk-17.0.6.10 and the default jar libraries and delphi 11.3 my code : procedure Tmainform.FormShow(Sender: TObject); var tm: JTelephonyManager; IMEI: String; begin IMEI := ''; if MobilePermissions1.Dangerous.ReadPhoneState = false then Begin MobilePermissions1.Dangerous.ReadPhoneState := true; MobilePermissions1.Apply; End; tm := TJTelephonyManager.Create; IMEI := JStringtoString(tm.getImei); End; Share this post Link to post
Dave Nottage 557 Posted March 10, 2023 16 minutes ago, Maher Tannous said: I tried to get IMEI number and succeeded in all Android versions except 10-11-12-13 Yes, this value can no longer be accessed by regular apps on Android since version 10. It might help to know why you need this value Share this post Link to post
Maher Tannous 3 Posted March 10, 2023 3 hours ago, Dave Nottage said: Yes, this value can no longer be accessed by regular apps on Android since version 10. It might help to know why you need this value I want to protect my app with imei to be run on only one device do you have another solution for running the app on one device only ? thx Share this post Link to post
Dave Nottage 557 Posted March 14, 2023 On 3/10/2023 at 4:34 PM, Maher Tannous said: do you have another solution for running the app on one device only ? There is no reliable way of uniquely identifying a specific Android device. On 3/10/2023 at 4:34 PM, Maher Tannous said: I want to protect my app with imei to be run on only one device If you were able to do this, what would be the process for ensuring that the IMEI is correct? Would the identifier be hard-coded into the app itself, or would there be some other measure external to the application? Share this post Link to post
Brian Evans 105 Posted March 14, 2023 There is a set of licensing APIs (Licensing Reference | Android Developers). One optional part looks like it might be useful: DeviceLimiter Interface that you implement if you want to restrict use of an application to a specific device. Called from LicenseValidator. Implementing DeviceLimiter is not recommended for most applications because it requires a backend server and may cause the user to lose access to licensed applications, unless designed with care. Share this post Link to post