pySim-shell: do not display 'AIDs:' when there are none

The command cardinfo also displays the AIDs of the card applications.
However, on classic GSM sim cards there are no applications. In this
case cardinfo will still display the string 'AIDs:', but it will of
course not list any AIDs under this string.

Related: OS#6531
Change-Id: Ifb111ce43fdebe85d30857dfc61ab570380b68d1
This commit is contained in:
Philipp Maier
2024-09-02 13:52:58 +02:00
committed by Harald Welte
parent 471162dc76
commit 639806cc5a

View File

@@ -826,8 +826,9 @@ class PySimCommands(CommandSet):
self._cmd.poutput(" ICCID: %s" % self._cmd.rs.identity['ICCID']) self._cmd.poutput(" ICCID: %s" % self._cmd.rs.identity['ICCID'])
self._cmd.poutput(" Class-Byte: %s" % self._cmd.lchan.scc.cla_byte) self._cmd.poutput(" Class-Byte: %s" % self._cmd.lchan.scc.cla_byte)
self._cmd.poutput(" Select-Ctrl: %s" % self._cmd.lchan.scc.sel_ctrl) self._cmd.poutput(" Select-Ctrl: %s" % self._cmd.lchan.scc.sel_ctrl)
self._cmd.poutput(" AIDs:") if len(self._cmd.rs.mf.applications) > 0:
for a in self._cmd.rs.mf.applications: self._cmd.poutput(" AIDs:")
for a in self._cmd.rs.mf.applications:
self._cmd.poutput(" %s" % a) self._cmd.poutput(" %s" % a)
@with_default_category('ISO7816 Commands') @with_default_category('ISO7816 Commands')