laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/40913?usp=email )
Change subject: Make sure to select MF before probing for files/Addons ......................................................................
Make sure to select MF before probing for files/Addons
Change-Id: I685367c282f57a8856668a3172a9391a5bbcf2e2 --- M pySim/cards.py M pySim/runtime.py 2 files changed, 5 insertions(+), 0 deletions(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved
diff --git a/pySim/cards.py b/pySim/cards.py index dedb2d6..58e8503 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -112,6 +112,8 @@ def probe(self) -> bool: # EF.DIR is a mandatory EF on all ICCIDs; however it *may* also exist on a TS 51.011 SIM ef_dir = EF_DIR() + # select MF first + self.file_exists("3f00") return self.file_exists(ef_dir.fid)
def read_aids(self) -> List[Hexstr]: diff --git a/pySim/runtime.py b/pySim/runtime.py index ec19cb4..2205957 100644 --- a/pySim/runtime.py +++ b/pySim/runtime.py @@ -60,6 +60,9 @@ self.card.set_apdu_parameter( cla=self.profile.cla, sel_ctrl=self.profile.sel_ctrl)
+ # make sure MF is selected before probing for Addons + self.lchan[0].select('MF') + for addon_cls in self.profile.addons: addon = addon_cls() if addon.probe(self.card):