Toast.makeText(this, "read : " + str, Toast.LENGTH_SHORT).show() Log.i("hey", "read bytes : " + Arrays.toString(bRead)) String str = new String(bRead, StandardCharsets.US_ASCII) Log.i("hey", "write : " + Arrays.toString(bWrite)) System.arraycopy(hello, 0, bWrite, 0, hello.length) MifareClassic mfc = MifareClassic.get(tag) īoolean authA = mfc.authenticateSectorWithKeyA(2, MifareClassic.KEY_NFC_FORUM) īoolean authB = mfc.authenticateSectorWithKeyB(2, MifareClassic.KEY_DEFAULT) īyte hello = "hello".getBytes(StandardCharsets.US_ASCII) Log.i("hey", Arrays.toString(tag.getTechList())) Here is my code: Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG) I found the keys and the access conditions of the card thanks to this app : I am trying to read and write data on a Mifare Classic 1k NFC tag.
0 Comments
Leave a Reply. |