HCE and Random UID

715 views
Skip to first unread message

William Roberts

unread,
Sep 9, 2014, 7:00:11 PM9/9/14
to android-...@googlegroups.com
The UID generated by Android HCE, as stated on the documents page (https://developer.android.com/guide/topics/connectivity/nfc/hce.html),

"In the first part of the exchange the HCE device will present its UID; HCE devices should be assumed to have a random UID. This means that on every tap, the UID that is presented to the reader will be a randomly generated UID. Because of this, NFC readers should not depend on the UID of HCE devices as a form of authentication or identification."

The Nexus however requires a screen off/on to see a new UID, so I am assuming it happens at power cycle and not field activation. Most devices seem to generate on field activation.
Each line below represents a field deactivation by pulling the device 2 feet away, and brining near the field again. I am using RFIDeas RDR-80581AKU

Nexus 4:
< Screen off on >
3382769160
3382769160
3382769160

Note 3/GS 5/Nexus 5 behavior:
2641041416
1403880200

So my question is simple, does anyone know where or how in the Android device this UID is generated? Is it by firmware configuration of the hardware or is it by software somwehere in the stack? I am trying to debug some legacy system that I don't have good access too, but I have a nexus 5 I can tinker with, Iv'e spent a few days searching, no luck.

Thanks for any help.

Martijn Coenen

unread,
Sep 22, 2014, 3:19:24 PM9/22/14
to android-...@googlegroups.com
Hi William,

The UID is generated in the firmware of the NFC controller. It is interesting though that on Nexus 4 the behavior is different than on Nexus 5. I will look into that. They do have different NFC controllers, so that may explain some of it.

Best,
Martijn

William Roberts

unread,
Sep 22, 2014, 6:35:02 PM9/22/14
to android-...@googlegroups.com

Thanks for the response,

Just clarifying what you mean by firmware for my own sanity.

By firmware do you mean machine code that is loaded to the NFC controller and executed by the NFC controller?

Thanks,
Bill

--
You received this message because you are subscribed to a topic in the Google Groups "android-platform" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-platform/o6vW3shpitk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-platfo...@googlegroups.com.
To post to this group, send email to android-...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-platform.
For more options, visit https://groups.google.com/d/optout.

Martijn Coenen

unread,
Sep 26, 2014, 12:51:29 AM9/26/14
to android-...@googlegroups.com
Yep - it's the code that is running inside the NFC controller.
Reply all
Reply to author
Forward
0 new messages