简体   繁体   English

如何从Mifare 1k类(MF1S50)中受保护的块读取和写入ndef?

[英]How to read and write ndef from protected blocks in Mifare Class 1k (MF1S50)?

Currently i'm using the MF1S50 card and it follows the typical Mifare Classic structure of sectors and blocks, etc. 目前,我正在使用MF1S50卡,它遵循扇区和块等的典型Mifare Classic结构。

I'm able to read and write ndef messages when none of the blocks are protected. 当没有任何块受保护时,我能够读写ndef消息。 The message seems to consume 356 bytes which is just the first few blocks. 该消息似乎占用了356个字节,这只是前几个块。

I'm writing using Ndef.writeNdefMessage() and reading using Ndef.getNdefMessage() . 我用写Ndef.writeNdefMessage()并使用读Ndef.getNdefMessage()

Is it possible for me to password protect the blocks that i'm using and continue to use Ndef.getNdefMessage to read and Ndef.writeNdefMessage to write into these blocks? 是否有可能对我来说,密码保护,我使用并继续使用该块Ndef.getNdefMessage阅读和Ndef.writeNdefMessage写入这些块?

(My first instinct says no its not possible). (我的第一个直觉说不可能。) If not, what is the general procedure? 如果没有,一般程序是什么? Is this how it is going to work? 这是怎么工作的?

Connect-> Authenticate-> Read -> Increment -> Read -> Close. 连接->身份验证->读取->增量->读取->关闭。

I'm guessing if this happens, 我猜这是否会发生,

<action android:name="android.nfc.action.NDEF_DISCOVERED" />

cannot be used right? 无法使用对吗?

In case of NDEF stored on a MIFARE Classic card, key A for reading the contents of the sectors is fixed so that any NFC device can access the contents. 如果NDEF存储在MIFARE Classic卡上,则用于读取扇区内容的密钥A是固定的,因此任何NFC设备都可以访问该内容。 However, you can change key B and configure the sectors such that key A can only be used to read the message and not overwrite it. 但是,您可以更改密钥B并配置扇区,以使密钥A仅可用于读取消息而不能覆盖消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM