Skip to content

Commit

Permalink
change naming scheme and print save directory
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewKuKanich authored Mar 10, 2024
1 parent 0316260 commit ef586a7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions applications/system/findmy/generate_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,7 @@ def main():
s256_b64 = base64.b64encode(public_key_hash.finalize()).decode("ascii")

if "/" not in s256_b64[:7]:
fname = (
f"{prefix}_{s256_b64[:7]}.keys"
if prefix
else f"{s256_b64[:7]}.keys"
)
fname = f"{prefix}_{mac}.keys" if prefix else f"{mac}.keys"

print(f"{i + 1})")
print("Private key (Base64):", private_key_b64)
Expand All @@ -95,8 +91,9 @@ def main():
print("Payload:", payload)
print()
print(
"Place the .keys file onto your Flipper or input the MAC and Payload manually."
"Place the .keys file onto your Flipper in the Apps_Data->FindMyFlipper folder or input the MAC and Payload manually."
)
print()

with open(f"keys/{fname}", "w") as f:
f.write(f"Private key: {private_key_b64}\n")
Expand All @@ -106,6 +103,8 @@ def main():
f.write(f"Public key (Hex): {public_key_hex}\n")
f.write(f"MAC: {mac}\n")
f.write(f"Payload: {payload}\n")
print("Keys file saved to:", os.path.abspath(f"keys/{fname}"))
print()
break


Expand Down

0 comments on commit ef586a7

Please sign in to comment.