且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用Android从NFC标签中检测制造商?

更新时间:2023-01-11 15:58:32

当然,没有一种万能的方法.对NFC标签进行指纹识别(以猜测制造商甚至是确切的标签类型)非常困难,您可能需要获取要检测的不同标签类型的各种数据表/用户手册.即使那样,大多数标签也不会仅仅告诉您我是Z开发的XY".在某些应用程序用例中,甚至不希望透露制造商或产品代码(通常是出于安全性的原因).

There is certainly no one-catches-all approach to this. Fingerprinting of NFC tags (to guess the manufacturer or even the exact tag type) is rather difficult and you will probably need to obtain the various datasheet/user manuals for the different tag types that you want to detect. Even then, most tags don't just tell you "I am XY developed by Z". In some application use-cases it is even considered undesirable (typically for security-by-obscurity reasons) to reveal the manufacturer or product code.

但是,对于某些标签类型,有 个建立良好的机制来获取制造商标识符:

For certain tag types, however, there are well-established mechanisms to obtain a manufacturer identifier:

    具有7字节UID(通过Tag.getId()获取)的
  • NfcA标签对制造商的ISO 7816-6注册芯片制造商代码进行编码(请参见新列表,或

  • NfcA tags that have a 7-byte UID (get it via Tag.getId()) encode the manufacturer's ISO 7816-6 registered chip manufacturer code (cf. the list that you already found, a newer list, or the JTC1/SC17 document library) as the first byte of that UID. E.g. 0x02 for STMicroelectronics, 0x04 for NXP, 0x05 for Infineon, etc.

NfcV标签具有8字节UID,其中制造商的ISO 7816-6注册芯片制造商代码(与7字节UID NfcA标签相同)被编码为UID的第二个字节. (请注意NfcV的不同字节顺序,这导致该字节是通过Tag.getId()获得的倒数第二个字节).

NfcV tags have an 8-byte UID where the manufacturer's ISO 7816-6 registered chip manufacturer code (same as for 7-byte-UID NfcA tags) is encoded as the second byte of the UID (note the different byte order for NfcV which results in that byte being the second last byte obtained through Tag.getId()).

NfcF标签通常具有来自Sony的RF前端(至少我不知道任何其他制造商).该前端可能会被其他制造商集成到产品中.索尼提供了系列数据表/用户手册,为您提供足够的信息,以区分不同的FeliCa标签.

NfcF tags typically have an RF front-end that comes from Sony (at least I'm not aware of any other manufacturers). That front-end may be integrated into products by other manufacturers though. Sony provides a series of datasheet/user manuals that give you sufficient information to distinuguish between different FeliCa tags.

某些IsoDep标记(特别是那些遵循 GlobalPlatform 规范的智能卡)标记通过卡片生产生命周期数据(CPLC)获得制造商信息.请参阅 Nikolay的博客文章以及有关如何使用GP的规范可以从典型的GP兼容卡上获得该信息.参见 CPLC.java 关于如何解释该信息.

Some IsoDep tags (specifically those that are smartcards following GlobalPlatform specifications) may reveals manufacturer information through their card production life-cycle data (CPLC). See Nikolay's blog post and the GP specifications on how to get that from typical GP compliant cards. See CPLC.java on how to interpret that information.