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
This commit is contained in:
Philipp Maier
2024-09-13 17:55:16 +02:00
committed by laforge
parent 39e4a4b7c5
commit 3dc0496913

View File

@@ -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: