Skip to content

Export Wizard on BigSur (11.7.1) #24

Closed

Description

@ThinkMaize

Despite giving the application permission to run, I cannot get the Export Wizard to work. When I click on the application, it will indicate that the app requires access to my keystore, but as soon as I click OK, everything terminates and disappears. Is this application supported on BigSur?

Image

Activity

  1. wanderdev0 commented on Aug 2, 2025

    @wanderdev0
    Owner

    Okay so for super early versions I took the community conclusions from some threads for granted RE: that it would work.

    But it's entirely possible that the format of the cache files was just different in earlier versions. Or the key format.
    It's also pretty hard to test on all versions since generic CI VMs/runners don't work for this purpose (you need to be logged in to FindMy and to an apple account etc.), and setting up a full QEMU VM per version takes a good hour unfortunately.

    If you have time I'd suggest trying to run the app from your terminal like so and seeing what the error you get actually is. It's one of two things: either the key is in a different format in earlier versions of MacOS (easier to patch) or the cache file structure is different (more annoying to patch)

    Or, well, if you want an immediate solution other than waiting for the app to be fixed you can also try to go manual mode like here. But it's a bit annoying to do

  2. added
    bug
    on Aug 2, 2025
  3. ThinkMaize commented on Aug 2, 2025

    @ThinkMaize
    Author

    Thanks for the quick reply! The reason I went with this OS was because was very easy to run a VirtualBox VM and didn't require Windows 11. If we are able to get it to work, it might be an easier option for some of your users than getting it set up with Docker. Although I was able to whitelist the app (I believe) I could not find any way to provide permanent access to BeaconStore (each time it asks for permission), so I wonder if that is part of the problem? Let me know if there is any other information I can provide that would be helpful.

    Last login: Fri Aug 1 23:51:22 on ttys000
    /Users/user1/Downloads/OpenTagViewer-ExportWizardMacOS-v1-3/OpenTagViewer ; exit;
    user1@user1s-iMac ~ % /Users/user1/Downloads/OpenTagViewer-ExportWizardMacOS-v1-3/OpenTagViewer ; exit;
    Traceback (most recent call last):
     File "main/wizard.py", line 324, in <module>
     File "main/wizard.py", line 81, in __init__
     File "main/wizard.py", line 129, in _retrieve_beacon_data
     File "main/wizard.py", line 175, in _create_beacon_data_map
     File "main/wizard.py", line 161, in _read_all_plists
    UnboundLocalError: cannot access local variable 'owned_beacons' where it is not associated with a value
    [PYI-752:ERROR] Failed to execute script 'wizard' due to unhandled exception: cannot access local variable 'owned_beacons' where it is not associated with a value
    [PYI-752:ERROR] Traceback:
    Traceback (most recent call last):
     File "main/wizard.py", line 324, in <module>
     File "main/wizard.py", line 81, in __init__
     File "main/wizard.py", line 129, in _retrieve_beacon_data
     File "main/wizard.py", line 175, in _create_beacon_data_map
     File "main/wizard.py", line 161, in _read_all_plists
    UnboundLocalError: cannot access local variable 'owned_beacons' where it is not associated with a value
    
    Saving session...
    ...copying shared history...
    ...saving history...truncating history files...
    ...completed.
    
    [Process completed]
    
  4. ThinkMaize commented on Aug 4, 2025

    @ThinkMaize
    Author

    I tried to do the manual mode as you suggested, but ran into errors that way as well. It could be something simple that I couldn't figure out because I am just not very familiar with the Mac OS. I was never asked for permission to access my keystore like I was when I used the wizard. Here is a copy of the output in case that helps:

    bash-3.2$ python airtag_decryptor.py 
    Traceback (most recent call last):
      File "/Users/user1/my_projects/OpenTagViewer/python/main/airtag_decryptor.py", line 60, in get_key
        return extract_key(key_in_hex_format)
      File "/Users/user1/my_projects/OpenTagViewer/python/main/airtag_decryptor.py", line 70, in extract_key
        raise KeyStoreKeyNotFoundException("Key was empty!")
    KeyStoreKeyNotFoundException: Key was empty!
    
    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "/Users/user1/my_projects/OpenTagViewer/python/main/airtag_decryptor.py", line 275, in <module>
        main()
      File "/Users/user1/my_projects/OpenTagViewer/python/main/airtag_decryptor.py", line 258, in main
        key: bytearray = get_key(KEYCHAIN_LABEL)
      File "/Users/user1/my_projects/OpenTagViewer/python/main/airtag_decryptor.py", line 63, in get_key
        raise KeyStoreKeyNotFoundException("Failed to retrieve keystore value") from e
    KeyStoreKeyNotFoundException: Failed to retrieve keystore value
    
  5. wanderdev0 commented on Aug 5, 2025

    @wanderdev0
    Owner

    @ThinkMaize first one I'll have to sit down and properly investigate when I have some time, but thanks for it!

    2nd one would happen probably because somehow it's not prompting your password and just returning an empty response for the command line command I'm running from python. You can actually check it yourself directly:

    https://github.com/parawanderer/OpenTagViewer/blob/46dcf1e654095d28eda3e6023444a426c50908a3/python/main/airtag_decryptor.py#L42

    Just run this command in the terminal:

    security find-generic-password -l 'BeaconStore' -w
    

    It might return empty, or some error, or it might prompt your password. Usually this is what triggers the password prompt before it nicely gives you the password value.

    Sidenote, there's also this one which is used as a fallback to the top one:

    https://github.com/parawanderer/OpenTagViewer/blob/46dcf1e654095d28eda3e6023444a426c50908a3/python/main/airtag_decryptor.py#L77

    It's just the same thing without the -w. It will then try to read the key out of the gena value if it exists. But only if the first one fails.

  6. ThinkMaize commented on Aug 5, 2025

    @ThinkMaize
    Author

    I did get a blank response for the first one. For the second one, I got a response formatted the same as the example in the code (though I hid some of the characters of the key before pasting it here) without it prompting me for a password. I'm not sure why the wizard doesn't work if the formatting is the same. Are there instructions on how to use this key to manually obtain the .plist files? The manual extraction instructions still rely on using airtag_decryptor.py.

    username@User1s-iMac ~ % security find-generic-password -l 'BeaconStore' -w  
    
    username@User1s-iMac ~ % security find-generic-password -l 'BeaconStore'   
    keychain: "/Users/username/Library/Keychains/login.keychain-db"
    version: 512
    class: "genp"
    attributes:
        0x00000007 <blob>="BeaconStore"
        0x00000008 <blob>=<NULL>
        "acct"<blob>="BeaconStoreKey"
        "cdat"<timedate>=0x32303235303830323034343133385A00  "20250802044138Z\000"
        "crtr"<uint32>=<NULL>
        "cusi"<sint32>=<NULL>
        "desc"<blob>=<NULL>
        "gena"<blob>=0x77D......3  "w\331\2...30@\024YY|\302\322c"
        "icmt"<blob>=<NULL>
        "invi"<sint32>=<NULL>
        "mdat"<timedate>=0x32303235303830323034343133385A00  "20250802044138Z\000"
        "nega"<sint32>=<NULL>
        "prot"<blob>=<NULL>
        "scrp"<sint32>=<NULL>
        "svce"<blob>="BeaconStore"
        "type"<uint32>=<NULL>
    username@User1s-iMac ~ % 
    username@User1s-iMac ~ % 
    
  7. added a commit that references this issue on Aug 6, 2025
  8. wanderdev0 commented on Aug 6, 2025

    @wanderdev0
    Owner

    Okay @ThinkMaize I see. This should be easy to solve then actually. It's probably a bug with how I implemented my extraction logic because you do in fact have a key that should work in the "fallback to trying to parse the gena value" case, from what I can tell.

    Added some proper tests with mocks for that whole setup now so the behaviour being correct is less of a guess now. I think it should work unless your key is somehow not 64 characters long now? At least I would be radically surprised it it doesn't work, because I am now testing everything except maybe the exact whitespace-level output from an actual Mac.

    But yeah looking to see if you can test that on your side by rerunning the airtag_decryptor.py script from the main branch.

    Though, if people do end up finding another case where my entire fallback logic doesn't work, I am open to extending the base script to just allow you to dump your own key in, in case the automatic "get key from CLI" stuff fails. This might actually enable the MacOS 15 case too. But for now I want to see if I can patch it for MacOS <= 14 fully at least in the full hands-off UI flow (because getting the key is annoying)

    (BTW I updated the string to the right of your gena value because that is actually some kind of printout of the key from what I know, so if you want to hide your key in public (probably good thing to do, even though I am not sure if it has any uses outside of the local machine) you should strip that one too).

  9. self-assigned this
    on Aug 6, 2025
  10. ThinkMaize commented on Aug 6, 2025

    @ThinkMaize
    Author

    It does now specify that the command with the -w flag returned empty, but I'm not sure that the updated version of the code is switching to the backup method because it is still stopping with that error. I am on Python 3.13.0 rather than 3.13.2, but I doubt that would make a difference. I can confirm the key from the previous post is 64 characters, excluding the leading 0x. If it would be helpful for troubleshooting, I can send it to you as a DM. Thanks for hiding the latter part.

    bash-3.2$ python --version
    Python 3.13.0
    bash-3.2$ python airtag_decryptor.py 
    Traceback (most recent call last):
      File "/Users/user/my_projects/ManualTag2/airtag_decryptor.py", line 76, in get_key
        raise KeyStoreKeyNotFoundException("security command output with flag -w returned empty")
    KeyStoreKeyNotFoundException: security command output with flag -w returned empty
    
    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "/Users/user/my_projects/ManualTag2/airtag_decryptor.py", line 300, in <module>
        main()
        ~~~~^^
      File "/Users/user/my_projects/ManualTag2/airtag_decryptor.py", line 283, in main
        key: bytearray = get_key(KEYCHAIN_LABEL)
                         ~~~~~~~^^^^^^^^^^^^^^^^
      File "/Users/user/my_projects/ManualTag2/airtag_decryptor.py", line 81, in get_key
        raise KeyStoreKeyNotFoundException("Failed to retrieve keystore value") from e
    KeyStoreKeyNotFoundException: Failed to retrieve keystore value
    bash-3.2$ 
    
  11. added a commit that references this issue on Aug 6, 2025
  12. wanderdev0 commented on Aug 6, 2025

    @wanderdev0
    Owner

    @ThinkMaize oh... I see what happened 🤦‍♂️

    ... I didn't update the actual thing which the standalone script invokes, only the part in the wizard/UI where it gets the key:

    https://github.com/parawanderer/OpenTagViewer/blob/7566e283e89a0c12de2fc4acc44f6baf8ea74e28/python/main/airtag_decryptor.py#L279-L296

    Apologies. Well that's fixed now. Setting up a unit test for this is a bit convoluted because of having to mock os/disk stuff, but I'll try to look into it at some point.

    But yeah, feel free to check again. It should use the fallback logic now. So we want to see if it can get and use the key from there.

  13. added
    @exporter-tool
    on Aug 6, 2025
  14. ThinkMaize commented on Aug 7, 2025

    @ThinkMaize
    Author

    This updated script executes without error. However, it seems to only generate half the filetree, with no OwnedBeacons folder. I created a zip with just these files and the yml I created, but the app wasn't able to import it. Maybe this will fix itself, though, once your wizard gets the latest code update?

    Generated File Tree:

    /
    ├── BeaconNamingRecord/
    │ ├── <UUID 1>/
    │ │ └── <UUID 2>.plist
    │ └── ...
    └──

    bash-3.2$ python airtag_decryptor.py
    Trying to decrypt plist file at: /Users/user/Library/com.apple.icloud.searchpartyd/BeaconNamingRecord/003.......EAF.record...
    Now trying to dump decrypted plist file to: /Users/user/plist_decrypt_output/BeaconNamingRecord/003......EAF.plist
    Success!
    Trying to decrypt plist file at: /Users/user/Library/com.apple.icloud.searchpartyd/BeaconNamingRecord/26B...664.record...
    Now trying to dump decrypted plist file to: /Users/user/plist_decrypt_output/BeaconNamingRecord/26B...664.plist
    Success!
    Trying to decrypt plist file at: /Users/user/Library/com.apple.icloud.searchpartyd/BeaconNamingRecord/7E7...7AF.record...
    Now trying to dump decrypted plist file to: /Users/user/plist_decrypt_output/BeaconNamingRecord/7E7...7AF.plist
    Success!
    Trying to decrypt plist file at: /Users/user/Library/com.apple.icloud.searchpartyd/BeaconNamingRecord/F77...0D2.record...
    Now trying to dump decrypted plist file to: /Users/user/plist_decrypt_output/BeaconNamingRecord/F77...0D2.plist
    Success!
    Trying to decrypt plist file at: /Users/user/Library/com.apple.icloud.searchpartyd/BeaconNamingRecord/B81...BFB.record...
    Now trying to dump decrypted plist file to: /Users/user/plist_decrypt_output/BeaconNamingRecord/B81...BFB.plist
    Success!
    Trying to decrypt plist file at: /Users/user/Library/com.apple.icloud.searchpartyd/BeaconNamingRecord/F24...6A2.record...
    Now trying to dump decrypted plist file to: /Users/user/plist_decrypt_output/BeaconNamingRecord/F24...6A2.plist
    Success!
    
  15. wanderdev0 commented on Aug 7, 2025

    @wanderdev0
    Owner

    @ThinkMaize interesting, okay. The wizard and the standalone script are actually the same in terms of which folders they will try to extract (and in the case of that wizard: dump into a zip).

    Let me clarify what these files are maybe. BeaconNamingRecord is the least critical file. It contains the name of the AirTag basically, and some metadata about which device set the name last and when. OwnedBeacon is the key file, this one contains the actual key to use for querying the apple network for information about your AirTag.

    I'm curious about two things now:

    1. Are you the "Owner" of your AirTags or did somebody share them with you? (By "owner" I mean "are you logged in to the apple account that was used while registering the AirTags via iOS?"). If they are shared tags they unfortunately we haven't figured out yet how to derive the key for shared devices from the shared records.
    2. Could you edit the python script locally and remove this line and see what folders it decrypts in the result?

    https://github.com/parawanderer/OpenTagViewer/blob/94f3419d4ae6c1ffe645f90e1631aa1578dd0169/python/main/airtag_decryptor.py#L288

  16. ThinkMaize commented on Aug 7, 2025

    @ThinkMaize
    Author

    I can confirm that I am the owner of the tags. I did try removing one from my account and re-adding it under a different name (same account) just now, but that made no difference. When I tried removing the if statement and the continue on the next like, the script now generates a number of additional folders, but no "OwnedBeacons" folder

    Image

    The MasterBeacons and KeySyncRecord folders matched the structure that OwnedBeacons should have been, so I tried renaming MasterBeacons > OwnBeacons and zipping it up in case this older version of the OS used a different name for the same folder, but when I attempted to import the .zip into the android app, it just made it crash.

  17. wanderdev0 commented on Aug 7, 2025

    @wanderdev0
    Owner

    Let me dump you the structure of what an OwnedBeacon file looks like, @ThinkMaize . Maybe it changed between MacOS releases:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    	<key>batteryLevel</key>
    	<integer>1</integer>
    	<key>cloudKitMetadata</key>
    	<data>
    		<!-- 
    			Some LONG Base64 String.
    			Think: ~2500 characters
    		 -->
    	</data>
    	<key>identifier</key>
    	<string>11111111-1111-1111-1111-111111111111</string>
    	<key>isZeus</key>
    	<false/>
    	<key>model</key>
    	<string></string>
    	<key>pairingDate</key>
    	<date>2025-02-27T20:03:32Z</date>
    	<key>privateKey</key> <!-- IMPORTANT! -->
    	<dict>
    		<key>key</key>
    		<dict>
    			<key>data</key>
    			<data>
    			<!--
    				Base64 String. ~100 ish characters
    			-->
    			</data>
    		</dict>
    	</dict>
    	<key>productId</key>
    	<integer>21760</integer>
    	<key>publicKey</key> <!-- IMPORTANT -->
    	<dict>
    		<key>key</key>
    		<dict>
    			<key>data</key>
    			<data>
    			<!--
    				Base64 String. ~80 ish characters
    			-->
    			</data>
    		</dict>
    	</dict>
    	<key>secondarySharedSecret</key>
    	<dict>
    		<key>key</key>
    		<dict>
    			<key>data</key>
    			<data>
    			<!--
    				Base64 String. ~40 ish characters
    			-->
    			</data>
    		</dict>
    	</dict>
    	<key>sharedSecret</key>
    	<dict>
    		<key>key</key>
    		<dict>
    			<key>data</key>
    			<data>
    			<!--
    				Base64 String. ~40 ish characters
    			-->
    			</data>
    		</dict>
    	</dict>
    	<key>stableIdentifier</key>
    	<array>
    		<string>1111~#111111a11111aaaa~#ABCDEFGHIJKL</string>
    	</array>
    	<key>systemVersion</key>
    	<string>2.0.73</string>
    	<key>vendorId</key>
    	<integer>76</integer>
    </dict>
    </plist>
    

    Does yours match this? Because there is data validation in place to assert parts of this format.

    We're most interested in the public and private keys for your tags (by their IDs).

    EDIT: the crashing is rather unfortunate otherwise I would be very interested to see what it errors about. Well regardless, the validation of this zip import happens here:

    https://github.com/parawanderer/OpenTagViewer/blob/94f3419d4ae6c1ffe645f90e1631aa1578dd0169/app/src/main/java/dev/wander/android/opentagviewer/util/parse/AppleZipImporterUtil.java#L78

    EDIT 2: I checked and the setup of my code for this is definitely not meant to have the app crash as a whole, but just give you an error message. So I would definitely be looking to fix that too if possible. But I might need your actual files (or stripped version of them) to fix that. But... let's figure out if your files have the exact expected format first

  18. ThinkMaize commented on Aug 7, 2025

    @ThinkMaize
    Author

    The files within the MasterBeacons folder do match that exact format, so I repeated the process:

    • Rename MasterBeacons > Owned Beacons
    • Generate YML file using script provided
    • Delete folders other than BeaconNamingRecord and OwnedBeacons
    • Zip
    • Import on Android phone (after clearing app storage and re-logging in)

    And this time it imported all 5 of my items (4 Airtags, 1 phone). Interestingly, only 1 of the devices, an Airtag, was able to display a recent location, and the others just say "No last location known" with a little exclamation point in a triangle next to the name, but hopefully this will update once I give it more time.

    I will follow up to let you know if the one device continues to update location and if the others start to show a location. I can certainly send you the zip if that would be helpful for updating the script.

  19. wanderdev0 commented on Aug 8, 2025

    @wanderdev0
    Owner

    I think for the location update thing you do basically just have to wait for it to update. There are some issues with updates in general (see: #19 ) but @malmeloo is already working on a fix upstream from me malmeloo/FindMy.py#160

    One trick you can use to get some old locations to show up is to go to the list of tags > settings drop-down > history and then go back in history for max 7 days for every tag. This will force it to load and save that history locally (no data exists on apple servers past 7 days back). Do that for every tag separately. Then you will unfortunately have to close and reopen the app (dumb issue on my side that I need to fix) but afterwards it will show you the latest location from history until it manages to fetch new data.

    I'll probably be looking to automate that backwards history lookup loop better and fix the sync to the home page. Moved that to #25

    But yeah regarding the import: if you could I would appreciate a zip of whatever crashed the app last time, because ideally that shouldn't happen outright!

    I also have an idea now of how I can automate both the wizard and the script to deal with older MacOS generically with the rename, so I'll implement that fix in the exporters too.

  20. added a commit that references this issue on Aug 15, 2025
  21. wanderdev0 commented on Aug 15, 2025

    @wanderdev0
    Owner

    This release should deal with the exporter app part properly now.

    TL;DR both the standalone python script and the wizard will now try to extract MasterBeacons too and they will perform the OwnedBeacons rename step to make the zip format compatible with the app

  22. wanderdev0 commented on Sep 23, 2025

    @wanderdev0
    Owner

    I'll close this ticket for now as the core issue here was resolved.

    See this regarding an update to the export tooling being in the works that gets us away from the specific-OS-version-linked dependencies: #30 (comment)

  23. added 3 commits that reference this issue on Oct 22, 2026
  24. added theissue type on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

@exporter-toolbug

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions