简体   繁体   English

使用ACR122用于普通Java桌面应用程序的NFC Mifare Ultralight读/写

[英]NFC Mifare Ultralight Read/Write for plain Java Desktop app using ACR122

After consulting a lot of threads on stackoverflow, I still have not found a working "example" for reading/writing MiFare Ultralight or Classic NFC cards using a ACS ACR122 Usb smart card reader in a Java Application... Sure, I tried to consult the documentation of NXP or ACS but still did not manage to "simply" read/write a block of data. 在咨询了许多关于stackoverflow的线程之后,我仍然没有找到在Java应用程序中使用ACS ACR122 Usb智能卡读取器读取/写入MiFare Ultralight或Classic NFC卡的有效“示例”。当然,我尝试咨询NXP或ACS的文档,但仍无法“简单地”读取/写入数据块。

There are a lot of Android-specific libraries out there, but not any plain old J2SE libraries that simplify MiFare communication (using the javax.smartcardio and APDU commands...) 有很多Android特定的库,但是没有任何简单的旧的J2SE库可以简化MiFare通信(使用javax.smartcardio和APDU命令...)

Can anyone give me some real good and usefull pointers: 谁能给我一些真正的好和有用的指针:

  • using APDU command for MiFare Ultralight & classic 对MiFare Ultralight和Classic使用APDU命令
  • (help me develop) a J2SE library that removes the complexity of all HEX commands that are sent to/from card (帮助我开发)一个J2SE库,该库消除了发送到卡或从卡发送的所有HEX命令的复杂性
  • examples to be used on these cards (Ultralight / Classic) ... 这些卡上使用的示例(Ultralight / Classic)...

Any help is greatly appriciated. 任何帮助都非常有用。

Development is done with: 开发是通过以下方式完成的:

  • ACS acr122U NFC reader ACS acr122U NFC阅读器
  • Linux platform using PC/SC lite libraries 使用PC / SC lite库的Linux平台
  • MiFare Ultralight and Classic 1K/4K 7UID cards MiFare Ultralight和Classic 1K / 4K 7UID卡
  • Java SDK 1.6+ and higher Java SDK 1.6及更高版本
  • Android 4.4.x phone with NFC (eg Huwawei ...) 带有NFC的Android 4.4.x手机(例如Huwawei ...)

I wrote a small Java (1.7+) program to dump (and write to) MiFare Classic 1K tags using an ACS ACR122U. 我编写了一个小型Java(1.7+)程序,以使用ACS ACR122U转储(并写入)MiFare Classic 1K标签。 It is available on GitHub . 在GitHub上可用 Under the hood it uses a plain old J2SE library called NFCTools . 它在后台使用了一个普通的旧的J2SE库NFCTools

NFCTools helps you communicate with NFC cards by managing all the hexadecimal/APDU stuff. NFCTools通过管理所有十六进制/ APDU内容帮助您与NFC卡通信。 It comes with numerous examples . 它带有许多示例 However I don't know if the main developer still wants to maintain it. 但是我不知道主要开发者是否仍然想要维护它。 For instance he marked a lot of Mifare classes as deprecated in order to refactor Mifare support, but it's still a work-in-progress for 2 years now. 例如,为了重构Mifare支持,他将许多Mifare类标记为不推荐使用,但现在仍在进行中,为期两年。 From the mailing list : 从邮件列表中

I first wrote the support for mifare classic cards and it seemed as using those classes to describe the memory area was a good idea. 我首先写了对mifare经典卡的支持,似乎使用这些类来描述存储区是一个好主意。 However when I wanted to add support for the ultralight tags the above classes would not work. 但是,当我想添加对ultralight标签的支持时,上述类将无法工作。 With the ultralight tags I decided to use a new approach and create a org.nfctools.mf.ul.MemoryLayout class. 有了超轻标签,我决定使用一种新方法并创建org.nfctools.mf.ul.MemoryLayout类。 I think this is the way to go, so I marked the MfCard classes as deprecated. 我认为这是可行的方法,因此我将MfCard类标记为已弃用。

In spite of this intermediate state it supports a lot of readers and tag formats. 尽管处于这种中间状态,它仍支持许多阅读器和标签格式。 The examples are pretty useful. 这些示例非常有用。 Then if you have some specific requirements I advise you to contribute to this project or fork it. 然后,如果您有一些特定的要求,我建议您为这个项目做出贡献或分叉它。

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

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