RfidResearchGroup / ChameleonUltra

The new generation chameleon based on NRF52840 makes the performance of card emulation more stable. And gave the chameleon the ability to read, write, and decrypt cards.
https://chameleonultra.com
GNU General Public License v3.0
939 stars 155 forks source link

cli: Fix cmd_parameter generation for nested for python 3.9 #205

Closed PetePriority closed 8 months ago

PetePriority commented 8 months ago

I noticed that when running the CLI with python 3.9, the type_target enum would be converted to a string representation of the enum, instead to its numerical value, i.e., MfcKeyType.A instead of 96. This caused the execution of the nested binary to fail.

github-actions[bot] commented 8 months ago

You are welcome to add an entry to the CHANGELOG.md as well

github-actions[bot] commented 8 months ago

Built artifacts for commit acb353fd426db4a9fccb80a6d2304655e7af2279

Firmware

Client

xianglin1998 commented 8 months ago

How does this change work on non 3.9 versions of Python?

PetePriority commented 8 months ago

It still works on python 3.11.8. But this is expected: the nested binaries expect an integer as their argument. So int(type_target) makes sure the enum is converted to an int before the implicit conversion to a string in the format string f"...{int(type_target)}..."

xianglin1998 commented 8 months ago

Good!!!