From 3dc04969135132015b77904b997c0d7a71b6511f Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Fri, 13 Sep 2024 17:55:16 +0200 Subject: [PATCH] pySim-prog: treat --imsi and --iccid equally When using a CSV file, we can either read the IMSI or ICCID from the CSV file before programming. However, should also be possible to supply both manually to identify the CSV file entry using the --imsi or --iccid option. This currently only works for the IMSI, but not for the ICCID. Related: SYS#4120 Change-Id: Id3083c7794a7bd59501997f22afdc23bad3069e6 --- pySim-prog.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pySim-prog.py b/pySim-prog.py index e238b663..cd7ac742 100755 --- a/pySim-prog.py +++ b/pySim-prog.py @@ -732,12 +732,12 @@ def process_card(scc, opts, first, ch): if opts.source == 'cmdline': cp = gen_parameters(opts) elif opts.source == 'csv': - imsi = None - iccid = None if opts.read_iccid: (res, _) = scc.read_binary(['3f00', '2fe2'], length=10) iccid = dec_iccid(res) - elif opts.read_imsi: + else: + iccid = opts.iccid + if opts.read_imsi: (res, _) = scc.read_binary(EF['IMSI']) imsi = swap_nibbles(res)[3:] else: