Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change naming scheme and print save directory #21

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading