Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android interact with SIM javacard 2.x applet

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.

like image 876
Hugo Alves Avatar asked Feb 15 '23 22:02

Hugo Alves


2 Answers

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.

like image 107
Robert Avatar answered Feb 27 '23 15:02

Robert


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

like image 25
kimikanen Avatar answered Feb 27 '23 15:02

kimikanen