Question

I've started on a project where I have to send commands with APDU interface or OTA interface, from my android project to a JavaCard applet that's on the phone's SIM. I have the AID and a few commandos to start testing the Android app, but i don't know how to select the applet on the card nor how to send the commands on android.

From searching I found this Seek for Android. But I've read that i need to get the Android OS and build it with this api and push it to a device. Doesn't this make my app not able to run on devices without this "custom" Android OS?

Is there any Android or java lib that allows me to communicate with the applet, allowing my app to be available without building a "hacked" Android OS? Or am I wrong on how Seek for Android works?

Thanks for any possible help. I've been cracking my head with this over the last 3 days.

Was it helpful?

Solution

AFAIK regular apps on Android can not communicate with a SIM card. This is a fact and can not be circumvented on a non-custom Android build.

Only system apps like the SIM-Toolkit-App can communicate with the SIM card using the Radio Interface Layer (RIL). But this interface might be tightened down to SIM-Toolkit usage (have not checked it).

The only alternative is using "non-standard Smartcards" like those integrated in an SD-Card or external NFC cards.

OTHER TIPS

With the new API in Android 5.0 you can do it. Of course your app needs a special privilege. Either install your app as system app to gain MODIFY_PHONE_STATE permission or install an ARA-M applet in your UICC as defined in GlobalPlatform to get carrier privileges

It is possible with kind of a hack. In the SMS Manager Class there are private methods to update SMS records, those methods are accessible via Java Reflections. If you update EF SMS OTA encoded, the SIM will be interpret this just like an OTA update. If the Applet on the SIM is accessible via its TAR via OTA, it is also accessible via Android-SMS updates.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top