Change in pysim[master]: filesystem: actively probe applications

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

dexter gerrit-no-reply at lists.osmocom.org
Wed Dec 1 11:32:52 UTC 2021


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/26431 )


Change subject: filesystem: actively probe applications
......................................................................

filesystem: actively probe applications

A profile can cover lots of different applications. Those applications
may not exist on all card models. To exclude applications that are not
installed on the particular card EF.DIR is evaluated. However, there may
be applications that are not registered in EF.DIR but supported by the
profile. To cover those as well, lets try to select the applications we
do not see in EF.DIR. If selecting works we know that the application
exists on the card and we can include them in the RuntimeState.

Change-Id: I3fa77a68664fe50d690a18adfb1ae1a88a189827
---
M pySim/filesystem.py
1 file changed, 12 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/31/26431/1

diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index 4c3308c..c706131 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -1101,14 +1101,23 @@
             for a in aids_card:
                 for f in apps_profile:
                     if f.aid in a:
-                        print(" %s: %s" % (f.name, a))
+                        print(" %s: %s (EF.DIR)" % (f.name, a))
                         aids_taken.append(a)
                         apps_taken.append(f)
             aids_unknown = set(aids_card) - set(aids_taken)
             for a in aids_unknown:
-                print(" unknown: %s" % a)
+                print(" unknown: %s (EF.DIR)" % a)
         else:
-            print("error: could not determine card applications")
+            print("warning: EF.DIR seems to be empty!")
+
+        # Some card applications may not be registered in EF.DIR, we will actively
+        # probe for those applications
+        for f in set(apps_profile) - set(apps_taken):
+            data, sw = self.card.select_adf_by_aid(f.aid)
+            if sw == "9000":
+                print(" %s: %s" % (f.name, a))
+                apps_taken.append(f)
+
         return apps_taken
 
     def reset(self, cmd_app=None) -> Hexstr:

-- 
To view, visit https://gerrit.osmocom.org/c/pysim/+/26431
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I3fa77a68664fe50d690a18adfb1ae1a88a189827
Gerrit-Change-Number: 26431
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211201/993d4055/attachment.htm>


More information about the gerrit-log mailing list