From 53bf156fd0803e81aff791a0c30e5ed5d0514acd Mon Sep 17 00:00:00 2001 From: Tobias Mueller Date: Tue, 17 Oct 2023 09:01:31 +0200 Subject: [PATCH] python: only get the IMSI when in deterministic mode We don't need the IMSI otherwise so let's not spend the time obtaining it. --- files/lib/blue-merle/imei_generate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/lib/blue-merle/imei_generate.py b/files/lib/blue-merle/imei_generate.py index 5b44c47..8363c36 100644 --- a/files/lib/blue-merle/imei_generate.py +++ b/files/lib/blue-merle/imei_generate.py @@ -180,10 +180,12 @@ def validate_imei(imei): if __name__ == '__main__': args = ap.parse_args() + imsi_d = None if args.verbose: verbose = args.verbose if args.deterministic: mode = Modes.DETERMINISTIC + imsi_d = get_imsi() if args.random: mode = Modes.RANDOM if args.static is not None: @@ -196,7 +198,6 @@ if __name__ == '__main__': else: exit(-1) else: - imsi_d = get_imsi() imei = generate_imei(imei_prefix, imsi_d) if (verbose): print(f"Generated new IMEI: {imei}")