gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 01:44:17 27 4
gpt4 key购买 nike

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

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

但是我想恢复应用信息下的部分

这是我从他们的应用程序中检索到的 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

我如何解码内存内容以检索此 key 编号?

回答,正如 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,用来验证key number。

最佳答案

从我在文档中可以读到的内容:http://www.emmicroelectronic.com/sites/default/files/public/products/datasheets/em4133_ds.pdf

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

关于android - Nfc-v 无法确定如何检索与其他应用程序相同的数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33961515/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com