From d454fe78439591ffad298f8c0524bcd4dc4a3635 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Mon, 8 Nov 2021 15:32:23 +0100 Subject: [PATCH] filesystem: do not read AIDs when no apps are defined When the profile does not define any ADFs, then do not try to read any AIDs. This is the case for old non UICC SIMs for example. Change-Id: I8cfbee1d23e9f99461fa5f4fbf92c1a0929c50bf Related: OS#5274 --- pySim/filesystem.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pySim/filesystem.py b/pySim/filesystem.py index 3caa470d..3d2687f9 100644 --- a/pySim/filesystem.py +++ b/pySim/filesystem.py @@ -1077,6 +1077,13 @@ class RuntimeState(object): def _match_applications(self): """match the applications from the profile with applications on the card""" apps_profile = self.profile.applications + + # When the profile does not feature any applications, then we are done already + if not apps_profile: + return [] + + # Read AIDs from card and match them against the applications defined by the + # card profile aids_card = self.card.read_aids() apps_taken = [] if aids_card: