NFC Spy

NFC Spy


NFC Spy make it easy to watch APDUs transceived between reader and contactless smart card. This is useful for NFC/HCE developer to learn about the underlying communication protocol, debug quential error, etc.

To use this app, You need two android phones both has NFC hardware, and at least one is runing 4.4 or greater version for HCE suport.

One phone act as a emulated card using NFC card emulation mode (HCE, starting from android 4.4 kitKat).

Another phone act as a card reader using NFC reader mode.

This two phones connected to each other using WLAN direct (WiFi-P2P).

When first phone close to a REAL card reader (POS, ATM, etc.), it will send all APDUs it received to the second phone by WiFi-P2P socket. The second phone gets APDUs, and then send these to a REAL card which attached close to it, similarly, the second phone send respones APDUs from REAL card to first phone, then the REAL card reader.

Eventually the REAL reader will act as read a REAL card directly, and this app will record all APDUs sent and received, that is how this app works, and why call it 'NFC Spy'.

This is an open source app, You can get source code from http://code.google.com/p/nfc-spy/

NOTE:

You should NOT use it for illegal acts, or you will be solely responsible for any consequences thereof. In addition, this app may be need to root/modify your system to work better, please be careful when doing this, and again, Developer of this app do NOT accept any responsibility.

If you also installed other HCE apps, you may see multiple items in the 'Tap & Pay' page of system settings, And you need select NFC Spy's card before use it.

Android's HCE architecture use HCE service to implement card emulation, every service need to declare AIDs it will respone when card reader select application by aid.
This leads to three problems, first, only ISO14443-A/ISO7816 compatible smart card can be emulated, second is NFC Spy can only handle limited card type, the last is HCE only works with card reader which send a stardard ISO7816 SELECT NAME/AID command as the first APDU.

The first problem can NOT be resolved for the time being, unless you switch to other implemention of card emulation such as some versions of CyanogenMod, but what will be another story.
To solve the second, you can use a rooted phone with Xposed framework, add NFC Spy or 'NFC Card-Emulation Catch-All Routing' mod.
To solve the last one, you may need a custom ROM which has modified system libaray.

Recent changes:
1, error fixed (crush when stop).
Add to list
Free
61
3.1
User ratings
47
Installs
5,000+
Concerns
0
File size
211 kb
Screenshots
Screenshot of NFC Spy Screenshot of NFC Spy Screenshot of NFC Spy Screenshot of NFC Spy Screenshot of NFC Spy Screenshot of NFC Spy
About NFC Spy
NFC Spy make it easy to watch APDUs transceived between reader and contactless smart card. This is useful for NFC/HCE developer to learn about the underlying communication protocol, debug quential error, etc.

To use this app, You need two android phones both has NFC hardware, and at least one is runing 4.4 or greater version for HCE suport.

One phone act as a emulated card using NFC card emulation mode (HCE, starting from android 4.4 kitKat).

Another phone act as a card reader using NFC reader mode.

This two phones connected to each other using WLAN direct (WiFi-P2P).

When first phone close to a REAL card reader (POS, ATM, etc.), it will send all APDUs it received to the second phone by WiFi-P2P socket. The second phone gets APDUs, and then send these to a REAL card which attached close to it, similarly, the second phone send respones APDUs from REAL card to first phone, then the REAL card reader.

Eventually the REAL reader will act as read a REAL card directly, and this app will record all APDUs sent and received, that is how this app works, and why call it 'NFC Spy'.

This is an open source app, You can get source code from http://code.google.com/p/nfc-spy/

NOTE:

You should NOT use it for illegal acts, or you will be solely responsible for any consequences thereof. In addition, this app may be need to root/modify your system to work better, please be careful when doing this, and again, Developer of this app do NOT accept any responsibility.

If you also installed other HCE apps, you may see multiple items in the 'Tap & Pay' page of system settings, And you need select NFC Spy's card before use it.

Android's HCE architecture use HCE service to implement card emulation, every service need to declare AIDs it will respone when card reader select application by aid.
This leads to three problems, first, only ISO14443-A/ISO7816 compatible smart card can be emulated, second is NFC Spy can only handle limited card type, the last is HCE only works with card reader which send a stardard ISO7816 SELECT NAME/AID command as the first APDU.

The first problem can NOT be resolved for the time being, unless you switch to other implemention of card emulation such as some versions of CyanogenMod, but what will be another story.
To solve the second, you can use a rooted phone with Xposed framework, add NFC Spy or 'NFC Card-Emulation Catch-All Routing' mod.
To solve the last one, you may need a custom ROM which has modified system libaray.

Recent changes:
1, error fixed (crush when stop).

User reviews of NFC Spy
Write the first review for this app!
Android Market Comments
A Google User
Apr 7, 2014
Works fine with Nexus 5 & Nexus 7 Could you just make this app record all data stream between card and reader?
A Google User
Apr 4, 2014
Didn't work I tried this app with two nexus 5, they connected fine, but no APDU was caught when I scanned the card with one phone and the other one held up against the reader. Any idea what might be wrong? The card was a MF Desfire btw.
A Google User
Feb 25, 2014
Confused Confused... does it *require* two phones with NFC to work? I was hoping to scan NFC tokens or HID cards to see what was on them.