0

I'm looking for a way to use my phone instead of a nfc card. To do that I would create an Android App.
I live in Switzerland and the national rail company uses a nfc card called "Swisspass" to load annual tickets, ... on it for conductors to read it and look if the ticket is valid. A year ago they issued a new function called "Swisspass Mobile" where in your app you can display a QR code for the conductors to scan. You can also add your pass to Google Pay as a loyalty program card. If you do so it shows you a url which looks like that:

HTTP://1SP.CH?S=SXXXXXXXXXXX

Where the SXXXXXXXXXXX is your member id. The problem with the QR code is that it takes way longer for the conductor to check and it is in general difficult to do so, as the train is constantly moving. If you take this url and generate a QR code form it in any other app it works as well.

So my thought was to use my phone to send this URL to the smartphone the conductor uses to make their and my life easier. I had a look at this
https://developer.android.com/guide/topics/connectivity/nfc/hce
but I can't really figure out what AID I would have to use or if I even need to use HCE in that case as it's not a NFC tag reader but a smartphone. Do you know any more information? Could I use peer to peer or just send the url by nfc to the conductors smartphone? How would I do that? Thanks a lot in advance

lela2011
  • 45
  • 5
  • Unless you know exactly what the App the conductor is running expects then you are unlikely to be able to reverse engineer it easily. Usually with Google Pay with NFC it is doing HCE with the right AID at a system level in a secure NFC element (not in an area accessible to general Apps). Again unless the App the conductor uses is setup for peer to peer it is unlikely to work and Android Peer to Peer is deprecated in Android 10. Generally I would expect adding the Pass to Google Pay should be enough without trying to write your own app for it. – Andrew Jul 08 '20 at 21:26
  • These articles may be helpful. [Setting up host card emulation](https://stackoverflow.com/q/20173181/9014308), [How to get AID for reader Host based card emulation](https://stackoverflow.com/q/27877373/9014308), [Android HCE: are there rules for AID?](https://stackoverflow.com/q/27533193/9014308), [Emulating a public transit card with HCE](https://stackoverflow.com/q/48477725/9014308), [Do I have to know what the AID of a card is for card emulation with Android HCE?](https://stackoverflow.com/q/34196900/9014308) – kunif Jul 09 '20 at 23:12

0 Answers0