简体   繁体   English

Android上的MIFARE Ultralight仿真

[英]MIFARE Ultralight emulation on Android

I need to create a simple Android application that emulates a Mifare Ultralight card. 我需要创建一个模拟Mifare Ultralight卡的简单Android应用程序。 It should only "sends" data (to be taken from an editable buffer) when is read and write on the same buffer when it receives data. 当它接收数据时,只能在同一缓冲区上读写时“发送”数据(要从可编辑缓冲区中获取)。

But I don't know how to emuate this kind of communication between reader and emulated card. 但是我不知道如何消除读卡器和模拟卡之间的这种通信。 I already read about Android HCE, but I don't know how to implement Mifare Ultralight communication (ISO 14443 type A). 我已经阅读了有关Android HCE的文章,但是我不知道如何实现Mifare Ultralight通信(ISO 14443 type A)。

I also read this , this and of course I read about Android HCE . 我也看了这个这个 ,当然我读到的Android HCE

I really don't know how communication must be implemented. 我真的不知道如何实现沟通。 Suppose that I've already registered and correctly setup android service for HCE etc., from the Android Developer Website (with basic application) I can send for the first time data when emulator is read. 假设我已经从Android开发者网站(带有基本应用程序)注册并正确设置了HCE等android服务,那么当我读取模拟器时,我可以第一次发送数据。

But for MIFARE Ultralight card emulation: 但是对于MIFARE Ultralight卡仿真:

1) Should I use the basic NFC methods after get the buffer? 1)获取缓冲区后,我应该使用基本的NFC方法吗?

2) How to enable communication between the card emulator and the reader? 2)如何启用卡仿真器和读卡器之间的通信?

3) Where these methods for read and write must be used? 3)必须在何处使用这些读写方法?

EDIT: Let's imagine a MIFARE wallet.... So, like if I need to store and get data of cards. 编辑:让我们想象一个MIFARE钱包....所以,就像我需要存储和获取卡的数据一样。 At mifare4mobile website they told me that SDK is available but anybody know how and where. 在mifare4mobile网站上,他们告诉我SDK可用,但是任何人都知道如何以及在哪里。

Thank you! 谢谢!

It's simply not possible to emulate MIFARE Ultralight on top of Android HCE. 根本不可能在Android HCE上模拟MIFARE Ultralight。 Android HCE allows emulation of ISO/IEC 7816-4 APDU based applications on top of the ISO/IEC 14443-4 transport protocol only. Android HCE仅允许在ISO / IEC 14443-4传输协议之上模拟基于ISO / IEC 7816-4 APDU的应用程序。

MIFARE Ultralight uses only lower protocol layers. MIFARE Ultralight仅使用较低的协议层。 Specifically, the Ultralight communication protocol sits directly on top of the framing defined in ISO/IEC 14443-3 Type A without the additional transport protocol. 具体来说,Ultralight通信协议直接位于ISO / IEC 14443-3 Type A中定义的帧之上,而无需其他传输协议。 As a consequence, it's impossible to emulate that using a HCE service on Android. 因此,不可能在Android上使用HCE服务来模仿它。

This does not mean that the hardware is incapable of emulating the MIFARE Ultralight protocol. 这并不意味着硬件无法仿真MIFARE Ultralight协议。 I've verified that at least Broadcom NFC controllers are capable of emulating that protocol. 我已验证至少Broadcom NFC控制器能够模拟该协议。 However, implementing that would require quite extensive modifications of the NFC stack and is, consequently, not possible on unmodified, of-the-shelf Android devices. 但是,要实现该功能,需要对NFC堆栈进行相当大的修改,因此,在未修改的现成Android设备上是不可能的。

Also see Emulate Mifare card with Android 4.4 另请参阅使用Android 4.4模拟Mifare卡

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

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