pySim-shell: add ADF.ISIM / ADF.USIM dynamically

currently ADF.ISIM and ADF.USIM are always added regardless if there is
a matching application on the card or not. Lets check what applications
are actually installed and add ADF.ISIM and ADF.USIM dynamically.

Change-Id: I42ee23375f98e6322708c1c4db6d65e1425feecd
Related: OS#4963
This commit is contained in:
Philipp Maier
2021-03-10 17:02:53 +01:00
parent eb72fa461d
commit 1e896f3d8c
3 changed files with 29 additions and 5 deletions

View File

@@ -58,8 +58,6 @@ class PysimApp(cmd2.Cmd):
self.card = card
self.rs = rs
self.py_locals = { 'card': self.card, 'rs' : self.rs }
self.card.read_aids()
self.poutput('AIDs on card: %s' % (self.card._aids))
self.numeric_path = False
self.add_settable(cmd2.Settable('numeric_path', bool, 'Print File IDs instead of names',
onchange_cb=self._onchange_numeric_path))
@@ -254,13 +252,14 @@ if __name__ == '__main__':
sys.exit(2)
profile = CardProfileUICC()
profile.add_application(ADF_USIM())
profile.add_application(ADF_ISIM())
rs = RuntimeState(card, profile)
# FIXME: do this dynamically
rs.mf.add_file(DF_TELECOM())
rs.mf.add_file(DF_GSM())
rs.mf.add_application(ADF_USIM())
rs.mf.add_application(ADF_ISIM())
app = PysimApp(card, rs)
rs.select('MF', app)