小编Man*_*ani的帖子

如何使用自定义键编写MifareClassic

我需要找到一个解决方案,用自定义密钥编写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();
}
Run Code Online (Sandbox Code Playgroud)

请帮助我这方面.我需要用自己的密钥编写Mifare Classic 1 K标签.

android nfc mifare

2
推荐指数
1
解决办法
2802
查看次数

标签 统计

android ×1

mifare ×1

nfc ×1