How to check my NFC TAG ID (UID)?

妖精的绣舞 提交于 2019-12-18 05:26:07

问题


It is possible to know others NFC TAG ID when we used to the APK & TAG each phones. For example, Phone A and B try to tag. Then Phone A can know Phone B's NFC TAG ID (4 Bytes - HEX). But I wanna know how to know my NFC TAG ID on my phone. Not used other phones. If you know any other information, please give me your advice on that.


回答1:


A phone does not necessarily have a fixed anti-collision identifier ("NFC Tag ID", as you call it). For instance, it could have an anti-collision identifier, that is randomly allocated on every activation (e.g. external HF field is turned on, phone is turned on, etc.) It could also have one or even multiple immutable anti-collision identifiers (e.g. from one or more secure elements).

This depends on several factors:

  • Is a secure element attached to the NFC controller in that phone?
  • Is the NFC controller configured to expose an attached secure element to the outside world?
  • Is the phone in card emulation mode or in passive peer-to-peer mode (or in a combined anti-collision phase for both modes)?
  • Does the NFC controller expose exactly one card-emulating entity (e.g. a secure element or the host controller) directly to the outside world or does it combine one or more emulating entities using NFCEE routing?
  • Etc.

As you mention "APK" I'm guessing that you refer to the Android platfrom (though you refused to answer my question on that). On newer Android devices (particularly those that support Host-based Card Emulation) and on Android devices that do not use card emulation at all, the anti-collision identifier (UID) visible to the outside world is typically not static and changes either on every activation or on every reboot of the device (some exceptions seem to exist). Particularly, with NFC peer-to-peer mode, the standard mandates the use of a per-session random identifier. Thus, the UID would not be of much use in those typical cases.

In general, Android does not provide any API to retrive the currently used anti-collision identifier from within the device. Usually, the random identifier is created within the NFC controller, so the Android system would not even know about it.

With regard to immutable IDs of secure element chips, vanilla Android does not contain public API to access secure elements, so the same applies to any identifing information of such secure elements.



来源:https://stackoverflow.com/questions/25195762/how-to-check-my-nfc-tag-id-uid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!