justinribeiro / hce-to-chromenfc-app

Chrome App that talks to Android host-based card emulation application.
Apache License 2.0
10 stars 2 forks source link

[Resolved] How to check weather its a NFC card or Emulated Device? #1

Open shahbazali opened 8 years ago

shahbazali commented 8 years ago

Hi,

Would you please help, how to get Card Type & UID ? in my business logic i wants to check either its a card or emulated phone? if its a card i need its UID, if its a phone i need NDEF for the Emulated Phone.

Looking Forward.

justinribeiro commented 8 years ago

My presumption is that you're talking about a Type 2 card (which can contain NDEF, but you're just looking for the UID). The existing chrome-nfc lib (including my fork) can read those cards via chrome.nfc.read() or chrome.nfc.read_logic(), but it's not going to explicitly tell you if it's a HCE or physical card. You'd have to do some of your own logic around that either depending on your data structure or some other means.

shahbazali commented 8 years ago

Hi @justinribeiro

Thank your for your help, i will try it now & will let you know.

where did you used aid-filter in chrome App? I wants to do the same functionality so iOS & Android Devices can also read this Emulated device (I'm using External ACS Bluetooth Reader) to do so.

Any Help?

justinribeiro commented 8 years ago

To my knowledge, iOS doesn't allow HCE so you're not going to be able to do the same sort of thing as Android (which does support HCE).

The sample code I have in this repo defines the APDU_SELECT target (which must match the aid-filter on Android) here: https://github.com/justinribeiro/hce-to-chromenfc-app/blob/master/chrome-nfc.js#L634

shahbazali commented 8 years ago

@justinribeiro Thank you so much for your help, its saves my lots of time & efforts, i was struck since 1 months to read HCE phone from ACR External Readers, by reading & understanding your Chrome APP code, i was able to did it on iOS & Andorid as well.

Appreciated. Thank you

shahbazali commented 8 years ago

Its very Simple process to check either its a Emulated Phone or a Card by ATR because allt he phones will have same ATR.

Resolved