From be7a8539f6e01a3cb4b7d7474c9797708b0d74a7 Mon Sep 17 00:00:00 2001 From: GameTec_live Date: Sun, 6 Apr 2025 13:48:30 +0200 Subject: [PATCH] chore: lets not break niels code --- software/script/chameleon_cli_unit.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/software/script/chameleon_cli_unit.py b/software/script/chameleon_cli_unit.py index 2d11d5da..fc581443 100644 --- a/software/script/chameleon_cli_unit.py +++ b/software/script/chameleon_cli_unit.py @@ -954,16 +954,8 @@ class HFMFFCHK(ReaderRequiredUnit): return if args.import_dic is not None: - for key in args.import_dic.readlines(): - if key.startswith("#"): # ignore comments - pass - elif key.isspace(): # ignore empty lines - pass - elif re.match(r'^[a-fA-F0-9]{12}$', key): # take only this key format - keys.add(bytes.fromhex(key)) - else: # in case of another format, a conversion is needed - print(f' - {CR}Key should in hex[12] format, invalid key is ignored{C0}, key = "{key}"') - continue + if not load_dic_file(args.import_dic, keys): + return if len(keys) == 0: print(f' - {CR}No keys{C0}') @@ -2503,7 +2495,7 @@ class HWSlotList(DeviceRequiredUnit): print(f"{CY if enabled[fwslot]['hf'] else C0}{hf_tag_type}{C0}") else: print("undef") - if (not args.short) and enabled[fwslot]['hf'] and hf_tag_type != TagSpecificType.UNDEFINED: + if (not args.short) and enabled[fwslot]['hf']: if current != slot: self.cmd.set_active_slot(slot) current = slot @@ -2554,7 +2546,7 @@ class HWSlotList(DeviceRequiredUnit): print(f"{CY if enabled[fwslot]['lf'] else C0}{lf_tag_type}{C0}") else: print("undef") - if (not args.short) and enabled[fwslot]['lf'] and lf_tag_type != TagSpecificType.UNDEFINED: + if (not args.short) and enabled[fwslot]['lf']: if current != slot: self.cmd.set_active_slot(slot) current = slot