Project

General

Profile

Actions

Feature #6367

open

PC/SC <-> Android OMAPI bridge for pySim and others

Added by laforge 2 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
02/17/2024
Due date:
% Done:

0%

Spec Reference:

Description

It's a frequent usage pattern that somebody
  • inserts a (sysmocom) USIM/ISIM or even EUICC in their PC/SC card reader, performs some actions with it from the PC (such as changing a file via pySim) and then
  • inserts it into a phone to test it with the modification, then
  • restarts the cycle again by removing the card and placing it in the PC/SC reader

While working with EasyEUICC it occurred to me that it has raw APDU-level access via Androids FEATURE_SE_OMAPI_UICC. So it should be possible to write an Android app that acts as a proxy/brige for passing APDUs transparently to between an UICC/eUICC present in the phone and a remote PC running pySim (or any other software that expects a local PC/SC card reader)

In fact, given that the vpcd project alreay has a "APDU over TCP" protocol and has an ifd_handler exposing virtual card readers to pcscd, only the android side would have to be developed.

So in the end, using the approach above, it shoul be possible to have pySim-shell or other tools talk to the UICC/eUICC while it remains inserted into the phone. After changes were made, we have to see if we can somehow trigger the REFRESH proactive command to tell the baseband to discard its cache and re-read the card contents. Likely a manual "Airplane mode on / off" toggle will also do the trick. But no more inserting/removing the card in between iterations.

Of course the same should in theory be possible also via 03.48 OTA / SCP80 without any Android app. However, OTA works with "APDU scripts" and that's not 1:1 the same as a live connection to the card, where the card doesn't loose state like which file was SELECTed between different OTA commands.

Any ideas/comments on this? I'm not an Android developer, but the task looks reasonably simple to me:
  • access the UICC/eUICC the same way as EasyEUICC
  • create a TCP connection to a user-configured IP/Port (the ifd-vpcd)
  • implement the super simple VPCD protocol over TCP to transceive APDUs

No data to display

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)