kormax / android-universal-reader

Apple VAS and Google Smart Tap Android NFC Reader Demo App
Apache License 2.0
26 stars 4 forks source link

Possibility of an iOS version of this app #1

Closed arian81 closed 2 months ago

arian81 commented 3 months ago

I was curious if this app can be created for iOS as well or there's some hardware/software restriction. I'm not looking to get the app on AppStore but just curious if the reverse engineered vas reader works on an iPhone if it's implemented in swift or no.

kormax commented 3 months ago

Yeah, I think it would work as last time I checked Apple is not blacklisting VAS AID in CoreNFC.

But the same limitations & quirks will apply as described for Android version of the app (unless you get a special entitlement to implement VASReaderSession which does ECP).

arian81 commented 3 months ago

Yeah, I think it would work as last time I checked Apple is not blacklisting VAS AID in CoreNFC.

But the same limitations & quirks will apply as described for Android version of the app (unless you get a special entitlement to implement VASReaderSession which does ECP).

For my usecase not having the pass pull automatically is not an issue. I was planning on using this along side nfc passes for hackathon attendees so we can sign them in for events. Paying $150 per VAS enabled reader was out of question so I stumbled across your app and thought if I could port this to iPhone then we can have readers for free.

razvanphp commented 3 months ago

I wanted to ask the same thing, but rather for a commercial SaaS/app that we want to publish in App Store and Google Play.

Is it technically feasible to use the phones of our users (no matter if Android/iOS) to read NFC passes, no matter if the end-user has Android/iOS to present the passes?

Does signing the NDA with Google and Apple and implementing this the official way apply for native apps as well or just for hardware vendors?

arian81 commented 3 months ago

I wanted to ask the same thing, but rather for a commercial SaaS/app that we want to publish in App Store and Google Play.

Is it technically feasible to to use the phones of our users (no matter if Android/iOS) to read NFC passes, no matter if the end-user has Android/iOS to present the passes?

Does signing the NDA with Google and Apple and implementing this the official way apply for native apps as well or just for hardware vendors?

I doubt you can get something like this on App Store specially based on the code that's in this repo. Because it's reverse engineered version of apples protocol. I'm assuming if they wanted people to be able to do something like this they would allow it through the api.

razvanphp commented 3 months ago

Makes sense to do it the "legal" way, with signing the NDA, but can't even find information on how to do this and how much it would cost, if they would even accept startups. Very few information about those protocols online.

But reading here: https://support.apple.com/en-gb/guide/security/secbd55491ad/web

To transmit data from supported passes to compatible NFC terminals, Apple uses the Apple Value Added Services (Apple VAS) protocol. The VAS protocol can be implemented on contactless terminals or in iPhone apps and uses NFC to communicate with supported Apple devices. The VAS protocol works over a short distance and can be used to present contactless passes independently or as part of an Apple Pay transaction.

seems to be possible.

kormax commented 3 months ago

GST can definitely be done "legally" on both platforms.

As for VAS, it can only be "properly" implemented on iOS, as off-the-shelf Android devices lack an ability to perform ECP, and Apple mandates that only devices with ECP are allowed to read those passes. Otherwise you risk your NFC certificate being revoked for good. Apple partnership is, without an exaggeration, a hostage-type situation for all approved partners.

Moreover, ECP for VAS on iOS requires an entitlement to use VASReaderSession. The entitlement is only provided to partners who are licensed to develop protocol implementations.

Without VASReader session, you face an additional problem: other CoreNFC session types get interrupted if another device generates an NFC field, which makes Apple Wallet appear. So reading passes from another device becomes a much more cumbersome operation on iOS.

razvanphp commented 3 months ago

Thank you for your detailed answer.

you mentioned on the ECP repo:

Some Android-based handheld reader manufacturers have implemented this feature in their software.

So can it be implemented on software “alone” on Android devices as well?

not sure if we are better off with some Sunmi V2s devices…

kormax commented 3 months ago

It cannot be implemented in software on Android as NFC polling is performed by the NFCC, where the polling routine is implemented in chip's firmware and cannot be flexibly modified by the operating system.

There are some industrial NFC readers based on Android, where reader manufacturers have worked with NFC chip providers to create alternative chip firmwares with ECP support. Hence it's "possible", but only in those cases.

razvanphp commented 4 weeks ago

@kormax are you available for commercial development of our app? Can you please get in touch with us? Thank you in advance!