我需要找到一种解决方案来使用自定义密钥编写 Mifare Classic 1 K 标签。我无法编写它,我尝试了所有选项,但不幸的是我一直收到错误“IOException:Transceive Failed”。
下面是我的代码片段:
byte custom_key[]={
(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff
};
// 16 bytes of Data. Otherwise it was throwing IllegalArgumentException .
byte[] data="Hello world of N".getBytes();
getMfc().connect();
if(getMfc().authenticateSectorWithKeyA(4, custom_key)) {
getMfc().writeBlock(3, data); // Here I receive IOException all the time.
} else {
getMfc().close();
}
请在这方面帮助我。我需要用自己的密钥编写 Mifare Classic 1 K Tag。