From 5666cd681825e15028a63c5cf2554cbc4a011b6b Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 16 Aug 2017 16:23:12 +0200 Subject: [PATCH] Unconditionally print ICCID and IMSI This can help a lot in identifying the cards and in giving context in case a user copy+pastes the output. Let's always read those values. --- sysmo-usim-tool.sjs1.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/sysmo-usim-tool.sjs1.py b/sysmo-usim-tool.sjs1.py index 8fd7ecf..dd2af92 100755 --- a/sysmo-usim-tool.sjs1.py +++ b/sysmo-usim-tool.sjs1.py @@ -51,7 +51,6 @@ def helptext(): print " -C, --set-opc HEXSTRING ........ Set OPc value" print " -k, --ki ....................... Show KI value" print " -K, --set-ki ................... Set KI value" - print " -i, --iccid .................... Show ICCID value" print "" @@ -72,7 +71,6 @@ def main(argv): getopt_show_ki = None getopt_write_ki = None getopt_force = False - getopt_show_iccid = False getopt_write_iccid = None # Analyze commandline options @@ -121,8 +119,6 @@ def main(argv): getopt_write_ki = asciihex_to_list(arg) elif opt in ("-f", "--force"): getopt_force = True - elif opt in ("-i", "--iccid"): - getopt_show_iccid = True elif opt in ("-I", "--set-iccid"): getopt_write_iccid = asciihex_to_list(pad_asciihex(arg)) @@ -139,6 +135,9 @@ def main(argv): sim = Simcard(c) print("") + print "Detected Card ICCID: ", sim.card.get_ICCID() + print "" + # Authenticate print "Authenticating..." if sysmo_usim_admin_auth(sim, getopt_adm1, getopt_force) == False: @@ -149,6 +148,10 @@ def main(argv): exit(1) print("") + sim.card.SELECT_ADF_USIM() + print "Detected Card IMSI: ", sim.card.get_imsi() + print "" + # Execute tasks if getopt_write_sim_mode != None: print "Programming SIM-Mode..." @@ -208,11 +211,6 @@ def main(argv): sysmo_usim_show_ki_params(sim) print("") - if getopt_show_iccid: - print "Reading ICCID value..." - sysmo_usim_show_iccid(sim) - print("") - if getopt_write_iccid: print "Writing ICCID value..." sysmo_usim_write_iccid(sim, getopt_write_iccid)