简体   繁体   English

未检测到写入 mifare 1k 卡的 Ndef 数据

[英]Ndef data written in mifare 1k card not getting detected

I have written Ndef data in a Mifare card, I want it to be readable by any android device having NFC support, irrespective of whether if supports Mifare cards.我已经在 Mifare 卡中写入了 Ndef 数据,我希望它可以被任何支持 NFC 的安卓设备读取,无论是否支持 Mifare 卡。

Some of the phones like Honor 8 pro(Does not have Mifare support) can read the tag but others like Samsung J7 are not able to read it.一些手机,如Honor 8 pro(不支持Mifare)可以读取标签,但其他手机(如三星J7)无法读取。

I have attached card data in an image.我在图像中附加了卡片数据。Mifare 数据转储 I have made the sector 2 and onwards private by using a non-standerd key我已使用非标准密钥将扇区 2 及以后的扇区设为私有

public void onTagDiscovered(Tag tag) {
// This is getting called for all devices
 Ndef ndef = Ndef.get(tag);
}

ndef is null in Samsung j7, whereas it has an object in Honor 8 pro. ndef 在三星 j7 中为 null,而在荣耀 8 pro 中有一个对象。

Any idea why this might be happening or any other way to achieve this?知道为什么会发生这种情况或任何其他方式来实现这一目标吗?

Note, that on some mobile phones the OS doesn't report Mifare support, although Mifare Classic cards can be read just fine.请注意,在某些手机上,操作系统不报告 Mifare 支持,尽管 Mifare Classic 卡可以正常读取。 Android is supposed to report the com.nxp.mifare system feature, if Mifare support is present, but some phones don't.如果存在 Mifare 支持,Android 应该报告com.nxp.mifare系统功能,但有些手机没有。

Some apps like NFC Check by Tapkey therefore sometimes report Mifare support as absent, although it's present.因此,某些应用程序(例如Tapkey 的 NFC Check)有时会报告 Mifare 支持不存在,尽管它存在。 To be clear, this is not these apps' fault but rather the fault of the OS.需要明确的是,这不是这些应用程序的错,而是操作系统的错。 Some older Moto phones are known to have this issue.已知一些较旧的 Moto 手机存在此问题。 According to your description it seems, that the Honor 8 pro has the same issue too, otherwise it wouldn't return an Ndef instance.根据你的描述,Honor 8 pro 似乎也有同样的问题,否则它不会返回Ndef实例。 On the other hand, probably the Samsung J7 actually really doesn't support Mifare, which is why it doesn't return a Ndef instance.另一方面,可能三星 J7 实际上真的不支持 Mifare,这就是它不返回Ndef实例的原因。

From your question I infer, that you are talking about Mifare Classic cards.从你的问题我推断,你说的是Mifare Classic卡。 Note, that in contrast to Mifare Classic, other Mifare cards, ie Mifare DESFire cards, can act as Type 4 NDEF tags and can therefore even be read by phones that don't have support for the proprietary Mifare classic.请注意,与 Mifare Classic 相比,其他 Mifare 卡,即 Mifare DESFire 卡,可以充当 Type 4 NDEF 标签,因此甚至可以被不支持专有 Mifare classic 的手机读取。 This is because Type 4 NDEF tags are standardized.这是因为 Type 4 NDEF 标签是标准化的。 They are based on the standardized ISO 7816 protocol and are supported by close to all NFC-enabled phones.它们基于标准化的 ISO 7816 协议,几乎所有支持 NFC 的手机都支持它们。

So making a long story short, probably you won't be able to read Mifare classic cards with phones that really don't have Mifare support while reading cards like the Mifare DESFire should work just fine.因此,长话短说,您可能无法使用真正不支持 Mifare 的手机读取 Mifare 经典卡,而读取像 Mifare DESFire 这样的卡应该可以正常工作。 Other pros of the DESFire are, that they are more secure, bigger in size and more flexible. DESFire 的其他优点是,它们更安全、尺寸更大且更灵活。 The biggest downside is, that they are significantly more expensive.最大的缺点是,它们要贵得多。

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

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