Unique identifier (when targeting Android 10, lasting after factory reset) - android

I have this internal android app for the phones.
The company has it's own custom management for all the devices.
Hole thing is working based on the imei , as a unique key to identify each phone.
As you know from Android 10, the imei identifier is not accessible anymore.
I have read a bunch of post and articles, but none seems to satisfy my needs, as I need an unique identifier, that lasts also after factory reset, reboot, uninstall and so on.
Please any suggestions, are welcomed.

Check first Answer here.
it's using UUID with MediaDrm.
Tested on Xiaomi Pocophone F1 with Android 10
and it survived reboot, uninstall.
I didn't test it yet over the factory reset.

Related

How to get Nexus 7 serial number programmatically?

We've developed an app that needs to identify every device uniquely. We first thought of using IMEI and we're obtaining it using the TelefonyManager's getDeviceId() method.
But one user reported that the app doesn't work and it seems we weren't able to get the IMEI. I read here that some Nexus 7 don't have an IMEI, that they use another way for serial number: CSSN. How can I obtain it? Or, even better, is there a preferable way to uniquely identify every android device?
PS: We do have one Nexus 7 here for testing and it works perfectly, that's why before I said some Nexus 7.
It's recommended to identify every installation instead of every device. There are indeed several ways of identifying device, for example, Mac address, IMEI, Serial Number, ANDROID_ID , however, due to different OS Versions, devices an vender implementations, none of these are truly reliable. Check this out.
Try the below code to get the device serial number :
Log.i("TAG","android.os.Build.SERIAL: " + Build.SERIAL);
You may go through the Android Documentation.

Purpose of Telephony Provider

Some background information:
I have a certain yet to be released tablet and sadly the people who designed it seemed to have removed TelephonyProvider.apk
Here's how I've reached that conclusion :
When I go to More... in WIRELESS & NETWORKS there are no options to change APN, VPN or access Mobile networks. (Please note that the table has no facility to lodge a SIM card) However, on my Karbonn ST10 (Android 4.1.1) all these options are found. The certain tablet is currently on Android 4.2.2
When I used an app called APN shortcuts I was able to launch the APN configuration screen, however every time I changed the MCC or MNC number, the APN could not be saved and was deleted.
When I tried to read the contents of content://telephony/carriers I received a NullPointerException.
Questions:
What is the purpose of TelephonyProvider.apk?
Will it be possible to install it without root access? If so, how? (I'm pretty sure this can't be done, but if someone else knows a magical method please enlighten the world)
Can 3G data connections via dongles be established on this device which seems to be missing TelephonyProvider? Or will the ROM have to be edited and TelephonyProvider be installed.
I'm pretty sure this is a programming question, but if it belongs on Android Enthusiasts, please move it.
It's just an apk... you should be able to sideload it with adb without root with adb sideload <your apk>. It would just be removable since its not it /system/app, ie built in with the ROM. If the makers of your device disabled certain features on the device, which would explain possibly why those menus do not display in the Settings app, then TelephonyProvider may not be all that you need to get the connections you want to establish working.
Hope this helps.
Update:
These features are probably disabled on the device you are using. based on what you described.
From the PackageManager documentation.
FEATURE_TELEPHONY Feature for getSystemAvailableFeatures() and hasSystemFeature(String): The device has a telephony radio with data communication support.
FEATURE_WIFI Feature for getSystemAvailableFeatures() and hasSystemFeature(String): The device supports WiFi (802.11) networking.

how does pay-per-install work on android?

I'm thinking to have a third party to promo my app, and I'll pay them per install. In order to avoid fraud, I need to have a unique ID stored in my database. My problem here is that I can't find a reliable unique ID.
IMEI - only works on phone
Android ID - can be changed even not a rooted device
WLAN MAC - not all devices have wifi, or the device has wifi turned off.
Bluetooth MAC - same as above
I know device with root access can easily change the IDs, but let's not worry about it now. I assume no one has a rooted device. How do I get a unique ID???
Please help. Thanks
Try looking into OpenUDID for Android, there doesn't seem to be a better way to do what you want for the time being:
https://github.com/vieux/OpenUDID

Android: How reliable is getMacAddress() as unique identifier

Are there known bugs or issues with getConnectionInfo().getMacAddress() when it's used as a unique device identifier?
One of the alternatives, the Android ID, seems to be not available (or not really unique) on some tablets. FAIL...
The only problem that I know of is that it is only available if Wi-Fi is enabled.
I think this is a big problem because some smartphone users probably never turn Wi-Fi on. Your app can turn Wi-Fi on itself, but this means your app needs an additional permission "android.permission.CHANGE_WIFI_STATE".
Your general issue - how to uniquely identify the device - is widely discussed, e.g.
Is there a unique Android device ID?
http://android-developers.blogspot.ca/2011/03/identifying-app-installations.html
In this video from last year Google I/O, Reto Meier talked about exactly that problem off identifieng a device correctly.
For the solution you will have to watch the video, because I don't remember it anymore. But I do remember his concerns about the "MacAddress"-Solution. The problem about this solution his that it addresses a particular device and not a particular "installation", think of the problem when a user, who installed your app, sells his phone to another person which will also install your app. With the MacAddress you have no chance to distinct between those two ...

Unique identifier for Android phone

I'm building Android application which needs to identify device by some unique number/string.
I've heard about ANDROID_ID but there are also reports that it can be the same on some phone models or even updates.
Another thing is that it is recreated after factory reset or system reinstall. I can live with that although I would prefer if it stayed the same.
Is there another way to identify the phone without asking for more permissions? IMEI requires them(android.permission.READ_PHONE_STATE) but it can scare away users.
How Shazam does that? I know it identifies the phone permanently (it remembers that I was a user before it introduced 5 tags a month restriction for new users) even though I completely reinstalled the system.
Why not create a GUID in a file in a well-known location and have that be your unique identifier? That way you have full control and without the need for any elevated permissions (except for file system access.)

Categories

Resources