ACR122U | This library is used to read , write Mifare Classic | Android library
kandi X-RAY | ACR122U Summary
kandi X-RAY | ACR122U Summary
This library is used to read, write Mifare Classic 1k Cards using ACR122U Reader using Java
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Method encrypting card data
- Create basic authentication key cmd
- Get trailer block
- Send apdu command to card
- Read card block
- Gets the authentication key
- Gets the auth command
- Reset the authentication card data
- Gets format card
- Performs the authentication
- Connect to the adapter
- Returns the reader list
- Write data into card
- Get write card command
- Read card code
- Get the UID command
- Send APdu command
- Convert byte array to string array
- Connect card
- Returns true if the card is present
- Stop the card reading process
- Waits for CardAbsent
- Waits for a card to be present in the terminal
ACR122U Key Features
ACR122U Examples and Code Snippets
Community Discussions
Trending Discussions on ACR122U
QUESTION
I’m in the process of writing a macOS application that will provide features to read and write data to nfc tags using the ACR122u usb reader. I’m having a difficult time finding examples of how to send commands to the device in this environment. I came across this question but can’t seem to adapt it to Swift or Objective C. Any help would be greatly appreciated.
Here's what I have so far but I can't seem to wrap my head around how to send an array of bytes.
...ANSWER
Answered 2022-Feb-21 at 17:57It turns out that using CryptoTokenKit was a better fit than what I had previously found. You init the reader as a TKSmartCardSlot and the card as a TKSmartCard. You then transmit the byte array to the TKSmartCard through the transmit function. Please send a dm if anyone needs additional information about this workflow.
https://developer.apple.com/documentation/cryptotokenkit/tksmartcardslot
QUESTION
I would like to set an NDEF message on my website if it is opened from android chrome and read it with an NFC Reader using nfcpy.
According to https://developer.mozilla.org/en-US/docs/Web/API/NDEFMessage/NDEFMessage I think I should be able to do this.
My page looks like this:
...ANSWER
Answered 2021-Dec-13 at 12:55https://stackoverflow.com/a/65659726/2373819 should give you some background as why this won't work, Android Chrome NFC is an NFC reader and 2 readers won't work.
Though with the acr122u NFC reader can usually be configure to behave as an NFC Tag, then Android Chrome should be able read and write NDEF messages to it (https://nfcpy.readthedocs.io/en/latest/topics/get-started.html#emulate-a-card)
QUESTION
I am trying to use this plugin in my Ionic 5 app: https://www.npmjs.com/package/cordova-plugin-k-nfc-acr122u
I installed plugin using cordova plugin add cordova-plugin-k-nfc-acr122u and i i dont now like use it. Plugin declares :
and i try use connect function but it don't work. enter image description here
Please help, thx.
...ANSWER
Answered 2021-Oct-12 at 10:10You can import the plugin KNfcAcr122U
from cordova-plugin-k-nfc-acr122u
in your component after importing in app.module.ts.
Then in constructor you can declare a private variable
private kNfcAcr122U : KNfcAcr122U
and in you function:
this.kNfcAcr122U.connect()
and
this.kNfcAcr122U.disconnect()
QUESTION
I'm writing an application in c# .net that needs to communicate with nfc reader (ACR122U or in built windows WUDC). The reader will send/receive data to wristband that behaves like type 4 tag. I'm using pcsc sharp library for this: https://github.com/danm-de/pcsc-sharp. Communication is over NDEF protocol with single text record, which can be used to obtain data from wristband. Text record format is G:{nameOfParameter}. For example G:ID, G:MAC.
I'm struggling for few days with sending write message to the wristband. The command I was able to make work is APDU ReadBinary Command:
...ANSWER
Answered 2021-Aug-05 at 22:50The Type 4 NDef Spec might help at https://web.archive.org/web/20190827131645/http://apps4android.org/nfc-specifications/NFCForum-TS-Type-4-Tag_2.0.pdf
I assume you have done all the file select stuff correctly
but the update procedure in the spec says
The NDEF update procedure is:
- If the length of the NDEF message (to be written) is bigger than Maximum NDEF size-2 (see NFC File Control TLV in Section 5.1.2.1), the NDEF update procedure is aborted. Otherwise, go to item 2.
- Write the value 0000h in the NLEN field (see Table 9) using the NDEF Update command.
- Write the NDEF message in the NDEF message field (see Table 9) using one or more NDEF Update commands.
- Write the length of the NDEF message in the NLEN field (see Table 9) using the NDEF Update command.
It seems as the NLEN field has a size then your offset should never be zero but 2h
I've not tried this with Type 4 Tags but thought the spec might help you.
QUESTION
I'm writing C# application to emulate NFC tag via ACR122U, which uses PN532 internally. I want Android to read simple URI NDEF Tag.
I'm able to communicate with Android using NFC Forum Type 4 Tag protocol, Android detects the tag, but is not able to read the NDEF file - checked with NFC Tools app.
The communication looks like this:
...ANSWER
Answered 2021-Jun-24 at 19:42The problem is indeed in the last message. Just before that Android was asking for NDEF content from offset 02: < D5-87-00-00-B0-00-02-12-90-00
Last message included the whole NDEF content including the size on first 2 bytes: 00-10. This must be removed:
FF-00-00-00-14-D4-8E-D1-01-0C-55-01-67-6F-6F-67-6C-65-2E-63-6F-6D-2F-90-00
This worked and Android open google.com.
QUESTION
I have LibNFC working from the Linux terminal recognising my ACR122U Reader, and I wanted to know if there was a method for it to work through Chrome on a Linux Desktop as it is really similar to Android Support, with all the NFC device handling done by libnfc and the browser just has to know about this library instead of every type usb or other device than can do NFC.
I have tried using the WebNFC API to connect it :
...ANSWER
Answered 2021-Feb-10 at 06:54Web NFC is supported on Android only as of February 2021. See https://web.dev/nfc/
The WebUSB error suggests you're requesting an interface that implements a protected class (among those below):
QUESTION
I'm trying to implement the functionality for emulating a Mifare One (1K/S50, ISO14443A) chip to be able to use a phone with NFC capability instead of a physical Mifare card or, if possible sending only the data to the reader.
I have this type of reader/writer: https://www.evelta.com/er302-high-frequency-nfc-writer-usb/
After looking around on forums, stackoverflow questions I found this article to be the best example:
I implemented the HCE part, run the program, and the reader beleives my phone is a Mifare chip, so far so good.
My problems:
No matter what "standard" Authentication key I tried to use...it gives me Auth error. I read this question about Auth: Authentication failure for Mifare 1K NFC tag using ACR122U NFC reader, it works on a physical Mifare card...but I don't know how to set or get to know the keys for the emulated one.
I don't get why this example emulates that exact Mifare chip type...even breakpoints don't work in the APDUService, but the reader detecting a Mifare cheap somehow.
After reading about it, I get I can't 100% emulate a physical card, so I have to send all the data I want in my APDU response with the service somehow (I beleive it's the transreceive part).
However I can't even authenticate.
I tried to look for other possible solutions:
AndroidBeam: Android - Android p2p...sounds simple, relatively high-level API, but it's being deprecated, moreover it's not guaranted that the reader will even use Android...it might be a 'simple' USB reader hardware like the one I use.
SecureElement: Ironically...it seems to be the most recommended, I read that 'yes, it's possible for mifare' and things like that, yet I couldn't find a good example of it and the official Google docs don't have any good example. I read that it's for "ISO/IEC 7816-4", but Mifare 1K is ISO14443A, so I'm a bit sceptic about this API.
"Simply" sending the data to the reader: If I could just simply "push" the data out to the reader when it's reading the phone without complicating the matter or emulating anything...it would be great but I don't know if it's even possible. This whole NFC topic seems to be more and more complex.
So alltogether I only need to do one thing: taking the data and send it to the reader.
I realized it's a fairy tale like illusion to beleive it's as simple as it sounds, still, I hope there is a way to do it.
If I could send the data in it's own, without emulating Mifare or anything...after all what matters is that the data on the card, not the type of the chip, the more simple the solution will be, the better.
Sorry for possible English grammar mistakes.
...ANSWER
Answered 2021-Jan-21 at 20:08The problem is you cannot use HCE on Android to emulate a Mifare Classic 1K (https://www.nxp.com/docs/en/data-sheet/MF1S50YYX_V1.pdf) as this is a custom Type NFC card. As HCE is about emulating Type 4 cards. See https://developer.android.com/guide/topics/connectivity/nfc/hce#SupportedProtocols
And the below image helps understand the type.
You can see this from it's datasheet, nowhere does it talk about AID's and standard Type 4 NFC commands
Though Type 2 and Type 4 can share the Anti Collision mechanism and Reading the UID (which is part of the process) any other access methods are not shared.
Type 4 Spec for reference is at http://apps4android.org/nfc-specifications/NFCForum-TS-Type-4-Tag_2.0.pdf
I have seen some USB readers that offer on reader emulation of other card types but not HCE where the host does the emulation not the NFC hardware.
The Authentication on Type 4 Cards or emulated ones is handled differently.
You can emulate a MIFARE DESFire Card as that is a Type 4 card.
The specs of your card reader are not documented well and it looks very "lite" and that it does not support any of the higher level protocols needed to talk to non Mifare Classic cards. It could support them but as Mifare protocol was the original spec, it could be possible for it to be and old design and only support the Mifare protocol.
QUESTION
I am trying to use the smartcardio library in Java (JDK 8, NetBeans 7.4, Windows 10). I have tried many other libraries with no success.
The card reader (ACS ACR122U) came with an SDK CDROM but the necessary .DLL is not on the CD so I cannot use the ACS library.
Since my NFC device uses an EEPROM that is not supported by the nfctools library I cannot use nfctools.
My code is as follows:
...ANSWER
Answered 2020-Apr-23 at 21:38As in the comments 0xff class of APDU command is not valid for cards, this is used to get the reader to interpret the APDU instead of send it to the card.
Not the same reader but this diagram make it clear
So don't try and wrap an APDU inside another APDU by duplicating the INS, P1, P2 and Lc fields
QUESTION
I am building a Windows/Java program (using javax.smartcardio
) to communicate with Jewel/Topaz512 tags (from Innovision/Broadcom) using an ACR122U device (with a PN532 NFC Controller chip inside).
I implemented the Topaz512 protocol (from this data sheet) but only half of my commands are working.
- Some commands that work:
RID, RALL, READ, WRITE-NE, RSEG
- Some commands that don't work:
WRITE-E, READ8, WRITE-E8, WRITE-NE8
For instance, here is what I get when I send a WRITE-NO-ERASE command:
Command: FF:00:00:00:0C:D4:40:01:1A:7F:42:38:01:9A:00:17:E8
Where:
D4:40:01
is the InDataExchange command,1A:7F:42
is the WRITE-NO-ERASE command (value: 0x42, block 0x0F, byte 7),38:01:9A:00
is the 4-bytes tag UID,17:E8
is the CRC.
Response: D5:41:00:42:90:00
Here the response is correct: 0x42
. The status byte (0x00
) informs that everything went well.
And here is what I get when I send a WRITE-WITH-ERASE command:
Command: FF:00:00:00:0C:D4:40:01:53:7F:42:38:01:9A:00:28:6E
Where:
D4:40:01
is the InDataExchange command,53:7F:42
is the WRITE-WITH-ERASE command (value: 0x42, block 0x0F, byte 7),38:01:9A:00
is the 4-bytes tag UID,28:6E
is the CRC.
Response: D5:41:01:90:00
Here, the status byte (0x01
) informs of a timeout detected by the PN532. (From the PN532 documentation (p67): "Time Out, the target has not answered - 0x01")
Also when I remove the PN532 timeouts (with FF:00:00:00:06:D4:32:02:00:00:00
) non-working commands do not respond D5:41:01:90:00
, but wait longer, then I get no response.
I just tried to execute the commands using gscriptor (from the pcsc-tools suite) and I got the same behavior. Here are my results:
The script:
...ANSWER
Answered 2020-Apr-22 at 15:33Some time ago I looked into this in detail and concluded that the PN532 NFC controller chip from NXP has an issue with its firmware that prevents it from successfully transceiving some commands with NFC Forum Type 1 tags (Topaz/Jewel brands). The ACR122U is based on this chip as noted.
When I tried to write 8 byte blocks at a time using the WRITE-E8 (0x54)
command, the response received is 0x01
, a timeout waiting for the tag to respond.
Things I tried that don't work:
Including the UID echo in the InDataExchange
, I even played with the endianness of the UID echo and still the same result.
Using the inCommunicateThru
command rather than InDataExchange
and calculating the CRC1 and CRC2 values at the application level (same results)
The final conclusion I reached is:
The PN532 cannot write to pages 0x10
and greater on a Type 1 tag which makes it impossible to write to the full range of memory on popular models such as the Topaz 512.
Recommendation:
This issue was relevant in 2012 when the Topaz 512 was a great low cost yet high memory NFC tag. Now that there's the NAG215 and NTAG216 models, I recommend using those models that have high memory and universal compatibility with NFC readers.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ACR122U
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page