Hello I ask this question because I have an app where people will have to post very serious stuff and if a user posts something that is not right, then I want to ban that person forever but how can I achieve that? Do phones have some type of identifier which I can retrieve from my app, check in the database and if that person was banned then I won't let that phone upload anything, or maybe blocking IP address? How can it be achieved?
2 Answers
Phones have many IDs but pretty much all of them can be reset in one form or another, your best bet is to collect all the ids and possibly the IP address and check all of them. It's not fool-proof but the person would have to go through a lot of trouble to get around. Although, even if there were a fool-proof way, they could just buy a new phone.
Here are some options for IDs
General Android Guidence: https://developer.android.com/training/articles/user-data-ids
Option 1: Advertising Id http://www.androiddocs.com/google/play-services/id.html
Cons: Can be reset by user through settings https://www.ghacks.net/2015/04/20/how-to-reset-your-advertising-id-on-android/
Option 2: GUID https://developer.android.com/reference/java/util/UUID
Cons Can be reset by clearing app data or reinstalling
Option 3: Hardware Id IMEI https://developer.android.com/reference/android/telephony/TelephonyManager
Cons Requires permission READ_PHONE_STATE (which we already ask for) Users can toggle off so we wouldn’t have access
Option 4: Hardware Id SSAID https://android-developers.googleblog.com/2017/04/changes-to-device-identifiers-in.html
Cons Can be reset by factory resetting phone Starting in O this will be a per app id instead of a device id which means it can be reset by uninstalling and reinstalling
Option 5: ANDROID_ID https://developer.android.com/reference/android/provider/Settings.Secure#ANDROID_ID
Cons Users can create a new one by creating a new user on the device Reset with factory reset as well Can be null

- 1,051
- 9
- 23
-
Great thank you for the amazing info I will use the IMEI i guess, people will either have to let the app know the IMEI or they won't get the feature – Aug 27 '18 at 22:53
I would suggest using the IMEI number and block based on it. Make sure to get and save it somewhere during installation phase and add a step for IMEI verification once you install to check if it is blocked or not. Let me know if you can find another way.

- 139
- 1
- 5