Skip to content

Snappy1

  • Home
  • Android
  • What
  • How
  • Is
  • Can
  • Does
  • Do
  • Why
  • Are
  • Who
  • Toggle search form

[FIXED] nfc – Android Card Emulation with HostApduService gives different tag ID each time, can’t ignore it

Posted on November 11, 2022 By

Solution 1 :

Add your own ID to data response of the HostApduService and then your reader can read it silently and then ignore it by using the enableReaderMode API with the FLAG_READER_NO_PLATFORM_SOUNDS flag.

You can then choose yourself to make the notification sound/vibration (so it looks like the HostApduService Tag has been ignored).

As background in NFC by design the UID of Tags only needs to be Unique when multiple Tags are in range at the same time, thus Emulated Tags use a random ID for security purposes as this meets this requirement while making the phone untrackable via it’s UID (plus also there is probably not enough UID’s available to make it actually Unique)

Problem :

So in my case one phone works as a reader and the other works as an emulated card using HostApduService. My problem right now is that if I touch these phones the reader will start reading the other phone that emulates the card multiple times a second. I fixed this issue when reading plastic emv cards simply by using nfcAdapter.ignore(tag, ...). But when I read a phone it always has a different tag ID, which is why I guess the nfcAdapter.ignore does nothing and it rapidly reads the phone that emulates the card.

Is there any way to ignore other phone after reader reads it? Most optimal would be to somehow have static tag ID on other phone.

Of course easiest way would be to disabling reading for some time after I read the phone once but I would like to make nfcAdapter.ignore work or other nicer solution.

READ  [FIXED] android - Update profile photo after images resized with Firebase extension
Powered by Inline Related Posts

Comments

Comment posted by Andrew

Are you in control of the HostApduService? if yes, just add your own ID to data response and then your reader can read it silently and then ignore it.

Comment posted by BeginnerSirius

Yes I am in control of it. Problem is that the system will still keep reading it and keep vibrating and playing a sound on the reader phone.

Comment posted by Andrew

I guess you are using

Comment posted by BeginnerSirius

Yeah this could work. And if I still need some indication I guess I could vibrate it manually after it reads the phone a single time. Thanks.

Comment posted by Andrew

Yes I ignore all Tags at various times using

Android Tags:android, emv, nfc

Post navigation

Previous Post: [FIXED] android – LottieAnimationView doesn’t show in my_layout.xml
Next Post: [FIXED] android – Firestore conditional array query

Related Posts

[FIXED] SSLHandshakeException: Certificate Unknown (Java Spring Boot & Android) Android
[FIXED] kotlin – Bluetooth pemissions in Android Studio Android
[FIXED] Flutter – FutureBuilder works well on Android but not well on iOS Android
[FIXED] android – Adding multiple LayerList to API 19 Device causing inflating error Android
[FIXED] Android / Java, Observer update parameter standardisation : how to override an Enum Android
[FIXED] java – Fatal exception AsyncTask #1 android Watson translator Android

Archives

  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuándo
  • ¿Cuántas
  • ¿Cuánto
  • ¿Qué
  • Android
  • Are
  • At
  • C'est
  • Can
  • Comment
  • Did
  • Do
  • Does
  • Est-ce
  • Est-il
  • For
  • Has
  • Hat
  • How
  • In
  • Is
  • Ist
  • Kann
  • Où
  • Pourquoi
  • Quand
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welchen
  • Welcher
  • Welches
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Who's
  • Why
  • Wie
  • Will
  • Wird
  • Wo
  • Woher
  • you can create a selvedge edge: You can make the edges of garter stitch more smooth by slipping the first stitch of every row.2022-02-04
  • you really only need to know two patterns: garter stitch

Recent Posts

  • Which is stronger 19 gauge or 23 gauge?
  • Does BMW still use GM transmissions?
  • Is primary or secondary market research better?
  • What does it mean when ADT says low battery?
  • Can a baby sleep on a regular mattress?

Recent Comments

No comments to show.

Copyright © 2023 Snappy1.

Powered by PressBook Grid Dark theme