【发布时间】:2016-07-04 10:29:14
【问题描述】:
有没有办法记录发送到 NFC 标签的 tranceive 方法的二进制数据? https://developer.android.com/reference/android/nfc/tech/NfcV.html#transceive(byte[])
我正在尝试查找协议中最后几个缺失的部分,如果我能听到发送的数据会有所帮助。
【问题讨论】:
标签: android debugging nfc iso-15693
有没有办法记录发送到 NFC 标签的 tranceive 方法的二进制数据? https://developer.android.com/reference/android/nfc/tech/NfcV.html#transceive(byte[])
我正在尝试查找协议中最后几个缺失的部分,如果我能听到发送的数据会有所帮助。
【问题讨论】:
标签: android debugging nfc iso-15693
我猜:
抬头看收发源代码
public byte[] transceive(byte[] data) throws IOException {
return transceive(data, true);
}
重定向到:
byte[] transceive(byte[] data, boolean raw) throws IOException {
checkConnected();
try {
TransceiveResult result = mTag.getTagService().transceive(mTag.getServiceHandle(),
data, raw);
if (result == null) {
throw new IOException("transceive failed");
} else {
return result.getResponseOrThrow();
}
} catch (RemoteException e) {
Log.e(TAG, "NFC service dead", e);
throw new IOException("NFC service died");
}
}
接下来是 TransceiveResult 类。
我最好的选择(如果你想走到最后的话)是重新编译一个 Android 源代码,打印出输入到byte[] transceive(byte[] data) 函数的数据。祝你好运。
编辑:我碰巧意识到的另一个选择是使用 APDU 嗅探器,尽管我不知道这个选项有多合法。
【讨论】: