gpt4 book ai didi

安卓/NFC : read ATR from Smartcard (EMV)

转载 作者:行者123 更新时间:2023-11-29 02:02:50 28 4
gpt4 key购买 nike

我有一张 EMV 智能卡,我想用它与我的手机进行通信。通过 IsoDep,通信本身没有问题,但我不知道如何获得 ATR。据我所知, Intent 应该包含 ATR,有人可以告诉我我需要的代码吗?

或者,如果这是不可能的,也许有人知道如何使用 SELECT 之类的命令对卡进行热重置,其中答案是 ATR。

最佳答案

非接触式卡没有 ATR。不过,您可能对 ATS(选择答案)的历史字节感兴趣。您可以通过调用 getHistoricalBytes() 来检索这些:

Tag tag = (Tag) intent.getParcelableExtra(NfcAdapter.EXTRA_TAG));
IsoDep iso = IsoDep.get(tag);
NfcA nfcA = NfcA.get(tag);
if (nfcA == null || iso == null)
return; // not an IsoDep+NfcA tag
byte[] histBytes = iso.getHistoricalBytes();
...

请记住,这仅适用于 ISO 14443 A 类标签 (NfcA)。对于 B 类标签 (NfcB),您可能需要调查 getHiLayerResponse() .

关于安卓/NFC : read ATR from Smartcard (EMV),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11657028/

28 4 0
文章推荐: ios - 如何通过单击按钮移动到 iOS 中的另一个 View Controller ?
文章推荐: android - 如何设置系统应用不被禁用?
文章推荐: ios - 从 UINavigationController 启动新的 UIViewController
文章推荐: android - TriggerIO 1.4 破坏了 Android