diff --git a/examples/real_airtag_sequoia.py b/examples/real_airtag_sequoia.py new file mode 100644 index 0000000..02493f2 --- /dev/null +++ b/examples/real_airtag_sequoia.py @@ -0,0 +1,185 @@ +import logging +import os +import plistlib +import re +import sys + +from _login import get_account_sync +from Crypto.Cipher import AES + +from findmy import FindMyAccessory +from findmy.reports import RemoteAnisetteProvider + +KEYCHAIN_LABEL = "BeaconStore" +BASE_FOLDER = "com.apple.icloud.searchpartyd" +INPUT_PATH = os.path.join(os.getenv("HOME"), "Library", BASE_FOLDER) +WHITELISTED_DIRS = {"OwnedBeacons", "BeaconNamingRecord"} +OUTPUT_PATH = os.path.join(os.getenv("HOME"), "plist_decrypt_output") +# start in your own docker +ANISETTE_SERVER = "http://localhost:6969" + + +def decrypt_plist(in_file_path: str, key: bytearray) -> dict: + """ + Given an encrypted plist file at path in_file_path, decrypt it using key and AES-GCM + and return the decrypted plist dict + :param in_file_path: Source path of the encrypted plist file. + Generally something like + /Users//Library/com.apple.icloud.searchpartyd/OwnedBeacons/.record + :param key: Raw key to decrypt plist file with. + Get it from the system shell command: + security find-generic-password -l '