From 1a13c44200aa1bcb94c6b0c1f4fc559b73b94557 Mon Sep 17 00:00:00 2001 From: herlesupreeth Date: Fri, 11 Sep 2020 21:16:51 +0200 Subject: Use the function select_adf_by_aid for selecting an AID Basically, the idea is to read all the AIDs on the UICC once rather than reading each time we want to select an ADF. The function select_adf_by_aid select the ADF by its AID which is already populated by read_aids() function Change-Id: I5e0e87e9cf238922d60fda7a7836e65f91f2c233 --- pySim/cards.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pySim/cards.py b/pySim/cards.py index 76d405b..d1b449a 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -1165,20 +1165,14 @@ class SysmoISIMSJA2(UsimCard): self._scc.update_binary('6f20', p['opc'], 17) # update EF-USIM_AUTH_KEY in ADF.ISIM - self._scc.select_file(['3f00']) - aid = self.read_aid(isim = True) - if (aid): - self._scc.select_adf(aid) + if '9000' == self.select_adf_by_aid(adf="isim"): if p.get('ki'): self._scc.update_binary('af20', p['ki'], 1) if p.get('opc'): self._scc.update_binary('af20', p['opc'], 17) - self._scc.select_file(['3f00']) - aid = self.read_aid() - if (aid): + if '9000' == self.select_adf_by_aid(): # update EF-USIM_AUTH_KEY in ADF.USIM - self._scc.select_adf(aid) if p.get('ki'): self._scc.update_binary('af20', p['ki'], 1) if p.get('opc'): -- cgit v1.2.3