mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-30 12:04:48 +03:00
catch and ignore SwMatchError on probing for AID's
When probing applications on a card by running select_adf_by_aid() SwMatchError exceptions indicating the non exsistance of that application on the card should be ignored. Change-Id: I3aa7deaf46bdf352a201c3089b3714405a06f281
This commit is contained in:
@@ -1113,11 +1113,13 @@ class RuntimeState(object):
|
|||||||
# Some card applications may not be registered in EF.DIR, we will actively
|
# Some card applications may not be registered in EF.DIR, we will actively
|
||||||
# probe for those applications
|
# probe for those applications
|
||||||
for f in set(apps_profile) - set(apps_taken):
|
for f in set(apps_profile) - set(apps_taken):
|
||||||
data, sw = self.card.select_adf_by_aid(f.aid)
|
try:
|
||||||
if sw == "9000":
|
data, sw = self.card.select_adf_by_aid(f.aid)
|
||||||
print(" %s: %s" % (f.name, f.aid))
|
if sw == "9000":
|
||||||
apps_taken.append(f)
|
print(" %s: %s" % (f.name, f.aid))
|
||||||
|
apps_taken.append(f)
|
||||||
|
except SwMatchError:
|
||||||
|
pass
|
||||||
return apps_taken
|
return apps_taken
|
||||||
|
|
||||||
def reset(self, cmd_app=None) -> Hexstr:
|
def reset(self, cmd_app=None) -> Hexstr:
|
||||||
|
|||||||
Reference in New Issue
Block a user