Nfc-v 无法确定如何检索与其他应用程序相同的数据
Nfc-v can't figure how to retrieve same data as other app
我编写了一段代码,用于从 NFC-v 标签读取数据。
使用该代码,我可以从卡中读取二进制数据。
当我将此数据解码为 Hexa 时,我得到了与 Android 应用程序相同的内存数据 NXP Taginfo
。
但我想恢复 Application information
下的部分
这是我从他们的应用程序中检索到的 hexa 的转储
-- 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,用来验证密钥号。
根据我在文档中可以阅读的内容:http://www.emmicroelectronic.com/sites/default/files/public/products/datasheets/em4133_ds.pdf
要获取密钥编号,您必须读取 UID,并且在读取字节时要应用一个掩码,如文档第 7.2 点所示。
我编写了一段代码,用于从 NFC-v 标签读取数据。 使用该代码,我可以从卡中读取二进制数据。
当我将此数据解码为 Hexa 时,我得到了与 Android 应用程序相同的内存数据 NXP Taginfo
。
但我想恢复 Application information
这是我从他们的应用程序中检索到的 hexa 的转储
-- 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,用来验证密钥号。
根据我在文档中可以阅读的内容:http://www.emmicroelectronic.com/sites/default/files/public/products/datasheets/em4133_ds.pdf
要获取密钥编号,您必须读取 UID,并且在读取字节时要应用一个掩码,如文档第 7.2 点所示。