Is it possible to make an App detect phone's IMEI or number to function?

I am a student that is working with my classmates on an App that is meant to detect the user's phone number or IMEI in order to be functional.

Is there a way or an extension that could make this possible?

Thanks in advance,

Brian Villarreal

Software development student at Terciario Urquiza.

Search the forum for "IMEI" ... See also here.

"Android 10 (API level 29) adds restrictions for non-resettable identifiers, which include both IMEI and serial number. Your app must be a device or profile owner app, have special carrier permissions, or have the READ_PRIVILEGED_PHONE_STATE privileged permission in order to access these identifiers."

According to this, in case the App is managed and installed directly in the user's phone by a government entity, this could still be possible. Right?

PS: User would agree to these terms.

this last comment is correct, right ?