Nfc-v无法确定如何检索与其他应用程序相同的数据

时间:2015-11-27 16:31:17

标签: android hex nfc

我编写了一个从NFC-v标签读取数据的代码。 使用该代码,我可以从卡中读取二进制数据。

当我将此数据解码为Hexa时,我获得的内存数据与Android应用NXP Taginfo相同。

但我希望恢复Application information

下的部分

这是我从他们的应用程序中恢复的六元组转储

-- INFO ------------------------------

# IC manufacturer:
EM Microelectronic-Marin SA

# IC type:
EM4x3x

# Application information:
SKIDATA keycard
* Key number: xx-16147133534646198558-x

-- NDEF ------------------------------

# No NFC data set storage:

-- EXTRA ------------------------------

# Memory size:
208 bytes
* 52 blocks, with 4 bytes per block

# IC detailed information:
Supported read commands:
* Single Block Read
* Multiple Block Read
* Get Multiple Block Security Status
* Get System Information
AFI supported
DSFID supported
IC reference value: 0x02
Customer ID: 0x066

-- TECH ------------------------------

# Technologies supported:
ISO/IEC 15693-3 compatible
ISO/IEC 15693-2 compatible

# Android technology information:
Tag description:
* TAG: Tech [android.nfc.tech.NfcV, android.nfc.tech.NdefFormatable]
android.nfc.tech.NdefFormatable
android.nfc.tech.NfcV
* Maximum transceive length: 253 bytes


# Detailed protocol information:
ID: E0:16:24:66:09:62:61:1E
AFI: 0x00
DSFID: 0x02

# Memory content:
You don't need it for find the number

  x:locked, .:unlocked

如何解码内存内容以检索此密钥号?

答案,正如Yrtiop所说,您需要阅读卡ID,这是正确的功能:

byte[] arrayOfByte = cardNfcTag.getId();
    for (int i1 = -1 + arrayOfByte.length; i1 >= 0; i1--)
    {
      Object[] arrayOfObject = new Object[1];
      arrayOfObject[0] = Integer.valueOf(0xFF & arrayOfByte[i1]);
      localStringBuilder.append(String.format("%02X", arrayOfObject));
    }
    BigInteger localBigInteger = new BigInteger(localStringBuilder.toString(), 16);
return "xx-" + localBigInteger.toString() + "-x";

XX是卡类型,最后一个x是用于验证密钥编号的CRC。

1 个答案:

答案 0 :(得分:1)

我可以在文档上阅读:http://www.emmicroelectronic.com/sites/default/files/public/products/datasheets/em4133_ds.pdf

要获取密钥编号,您必须读取UID,并且在读取字节时有一个要应用的掩码,如文档的第7.2点所示。