Make sure to select MF before probing for files/Addons

Change-Id: I685367c282f57a8856668a3172a9391a5bbcf2e2
This commit is contained in:
Bjoern Riemer
2025-08-22 14:28:28 +02:00
committed by laforge
parent 10fe0e3aae
commit 4dddcf932a
2 changed files with 5 additions and 0 deletions

View File

@@ -112,6 +112,8 @@ class UiccCardBase(SimCardBase):
def probe(self) -> bool: 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 is a mandatory EF on all ICCIDs; however it *may* also exist on a TS 51.011 SIM
ef_dir = EF_DIR() ef_dir = EF_DIR()
# select MF first
self.file_exists("3f00")
return self.file_exists(ef_dir.fid) return self.file_exists(ef_dir.fid)
def read_aids(self) -> List[Hexstr]: def read_aids(self) -> List[Hexstr]:

View File

@@ -60,6 +60,9 @@ class RuntimeState:
self.card.set_apdu_parameter( self.card.set_apdu_parameter(
cla=self.profile.cla, sel_ctrl=self.profile.sel_ctrl) 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: for addon_cls in self.profile.addons:
addon = addon_cls() addon = addon_cls()
if addon.probe(self.card): if addon.probe(self.card):