Mohsen Afshin
Mohsen Afshin

Reputation: 13436

Which properties of android.os.Build are fixed?

I require the list of fixed properties of android.os.Build class. I've obtained the list from here I bold those that I know are fixed. By fix I mean no change by firmware update, reset factory, ...

  1. android.os.Build.VERSION.RELEASE //The current development codename, or the string "REL" if this is a release build.

  2. android.os.Build.BOARD //The name of the underlying board, like "goldfish".

  3. android.os.Build.BOOTLOADER // The system bootloader version number.

  4. android.os.Build.BRAND //The brand (e.g., carrier) the software is customized for, if any.

  5. android.os.Build.CPU_ABI //The name of the instruction set (CPU type + ABI convention) of native code.

  6. android.os.Build.CPU_ABI2 // The name of the second instruction set (CPU type + ABI convention) of native code.

  7. android.os.Build.DEVICE // The name of the industrial design.

  8. android.os.Build.DISPLAY //A build ID string meant for displaying to the user

  9. android.os.Build.FINGERPRINT //A string that uniquely identifies this build.

  10. android.os.Build.HARDWARE //The name of the hardware (from the kernel command line or /proc).

  11. android.os.Build.HOST

  12. android.os.Build.ID //Either a changelist number, or a label like "M4-rc20".

  13. android.os.Build.MANUFACTURER //The manufacturer of the product/hardware.

  14. android.os.Build.MODEL //The end-user-visible name for the end product.

  15. android.os.Build.PRODUCT //The name of the overall product.

  16. android.os.Build.TAGS //Comma-separated tags describing the build, like "unsigned,debug".

  17. android.os.Build.TYPE //The type of build, like "user" or "eng".

  18. android.os.Build.USER

Please help me complete the list

Upvotes: 4

Views: 11113

Answers (3)

Andreas Klöber
Andreas Klöber

Reputation: 5920

If I understand correctly (regarding your follow-up comment) you want to identify a device without integrating some kind of registration or login mechanism.

Instead of implementing yout own ID computation algorithm I would suggest using an OpenUDID implementation for android (see https://github.com/vieux/OpenUDID).

Upvotes: 1

Paul Lammertsma
Paul Lammertsma

Reputation: 38272

I'm not going to address the woes with consistencies of Build as Mark has illustrated why there isn't a guaranteed answer. Instead I want to respond to what your purpose and intent is.

If I understand correctly, you are trying to uniquely identify a single device. I point you firstly to this answer, from which you can simply conclude that a generic solution is not possible. Either resetting factory defaults or switching SIM cards (if the device has one) will change any sort of unique ID and fool your app into thinking it's a different user.

You need to rethink what you're trying to accomplish. Why do you need to uniquely identify a device? If you're trying to identify a user, then this mindset doesn't cope for multiple devices either. This is now especially the case with Jellybean 4.2, where a device may support multiple users. See also this insightful blog post on the Android Developers Blog.

Can you have the user attach his Google account? Or account for your own service? If you can identify a user, it is then trivial to identify individual devices through UUID.randomUUID().

Upvotes: 2

CommonsWare
CommonsWare

Reputation: 1007444

If you look at the source code to Build, you will see that all of these values -- including those you have in bold -- come from system properties files. Hence, any of these values can be modified by ROM modders or the original device manufacturer as they see fit.

Upvotes: 16

Related Questions