Search code examples
androidnfcapducontactless-smartcardhce

Emulate a smart card on Android when the NFC Reader does not send a "SELECT AID" APDU


I have read the Android documentation about NFC and found that it could emulate an NFC tag. However it requires that you register which AID you serve.

Is it possible to create an application that handles communication if the NFC reader does not send a "SELECT AID" APDU? Either by creating an application where the AID in the manifest file is empty, or create some sort of default application.

I don't mind if the application has to be in the foreground, if that helps in any way.

Thank you in advance.


Solution

  • No, the Android API currently does not support this. Commands are only routed to applications upon reception of a SELECT (by AID/DF name) command that matches an AID registered to the system. As of Android 4.4.4 there is no mechanism to define a catch-all/default app.

    It seems that Android devices currently only use the AID-based routing mechanism defined in the NFC Forum NCI specification. However, the NCI specification also defines protocol-based and technology-based routing. These routing mechanisms could instruct the NFC controller to forward all communication regardless of a SELECT (by AID/DF name) command to the application processor/Android system. Consequently, it might be possible to implement a modified Andoid system that permits default routing of all communication to an app, but it's unclear if the NFC controllers used in Android devices support protocol-based or technology-based routing mechanisms (support for them seems to be optional).