【发布时间】:2013-08-03 00:31:51
【问题描述】:
我正在尝试读取支付卡的跟踪数据(PayWave、PayPass)。据我了解,他们遵循 ISO 14443 B。 使用新的 NFC API,
- 我可以使用 IsoDep 格式连接而不会抛出任何异常
- 调用 getHiLayerResponse() - 什么也不返回 :(。现在怎么办?
后来我尝试调用 transceive() 方法,但都是徒劳的(我不知道 APDU 命令)。
有人可以帮我阅读/获取 PayWave 或 PayPass 卡(支付卡)的详细信息吗?
if ( NfcAdapter.ACTION_TAG_DISCOVERED.equals(action) ) {
Parcelable nfcTag = intent.getParcelableExtra("android.nfc.extra.TAG");
Tag t = (Tag)nfcTag;
IsoDep myTag = IsoDep.get(t);
String s1 = null, s2 = null;
byte[] b1 = myTag.getHiLayerResponse(); //b1 is not null, but length == 0
if( b1 != null && b1.length > 0 )
s1 = new String(b1);
byte[] b2 = myTag.getHistoricalBytes(); //returns nothing coz its NfcB
if(b2 != null && b2.length > 0)
s2 = new String(b2);
if( !myTag.isConnected() )
{
myTag.connect();
String sData = "0xBB"; // got this magic value from web
byte []data = sData.getBytes();
result = myTag.transceive(data);
if(result != null && result.length > 0)
{
s3 = new String(result); // value of s3 will be "m"
}
}
}
任何帮助都会很棒,请提供一些启示......在此先感谢
【问题讨论】:
标签: android