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

How to detect manufacturer from NFC tag using Android?

我正在尝试检测 NFC 标签的制造商名称。我发现制造商代码 here. But I can detect only Mifare Ultralight C tags using these IDs. The first byte of Ultralight C tag ID represents the manufacturer code. But other tags do not contain this property. This app 可以检测到 IC 制造商。是否可以检测其他 NFC 标签的制造商?

当然没有一劳永逸的方法。 NFC 标签的指纹识别(猜测制造商甚至确切的标签类型)相当困难,您可能需要为要检测的不同标签类型获取各种 datasheet/user 手册。即使那样,大多数标签也不只是告诉你 "I am XY developed by Z"。在某些应用程序用例中,甚至被认为不希望(通常出于隐蔽性安全原因)泄露制造商或产品代码。

但是,对于某些标签类型, 完善的机制来获取制造商标识符:

  • NfcA 具有 7 字节 UID 的标签(通过 Tag.getId() 获取)编码制造商的 ISO 7816-6 注册芯片制造商代码(参见 list that you already found, a newer list, or the JTC1/SC17 document library) 作为该 UID 的第一个字节。例如。 0x02意法半导体,0x04恩智浦,0x05英飞凌等

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

  • NfcF 标签通常有一个来自 Sony 的 RF 前端(至少我不知道有任何其他制造商)。不过,该前端可能会集成到其他制造商的产品中。 Sony 提供了一个series of datasheet/user manuals,可以为您提供足够的信息来区分不同的 FeliCa 标签。

  • 一些 IsoDep 标签(特别是 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 之后的智能卡,说明如何解释该信息。