You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
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
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]
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
@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:
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:
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.
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).
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$
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.
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?
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!
@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:
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.
Could you edit the python script locally and remove this line and see what folders it decrypts in the result?
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
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.
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:
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
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.
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.
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
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)
Activity
wanderdev0 commentedon Aug 2, 2025
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
ThinkMaize commentedon Aug 2, 2025
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.
ThinkMaize commentedon Aug 4, 2025
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:
wanderdev0 commentedon Aug 5, 2025
@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:
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 thegenavalue if it exists. But only if the first one fails.ThinkMaize commentedon Aug 5, 2025
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.
issue #24: implement better testing for establishing the fallback str…
wanderdev0 commentedon Aug 6, 2025
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
genavalue" 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
64characters 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.pyscript from themainbranch.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 15case too. But for now I want to see if I can patch it forMacOS <= 14fully 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
genavalue 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).ThinkMaize commentedon Aug 6, 2025
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.
issue #24: I forgot to update the actual airtag_decryptor.py standalo…
wanderdev0 commentedon Aug 6, 2025
@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.
ThinkMaize commentedon Aug 7, 2025
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
│ └── ...
└──
wanderdev0 commentedon Aug 7, 2025
@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.
BeaconNamingRecordis the least critical file. It contains the name of the AirTag basically, and some metadata about which device set the name last and when.OwnedBeaconis 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:
https://github.com/parawanderer/OpenTagViewer/blob/94f3419d4ae6c1ffe645f90e1631aa1578dd0169/python/main/airtag_decryptor.py#L288
ThinkMaize commentedon Aug 7, 2025
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
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.
wanderdev0 commentedon Aug 7, 2025
Let me dump you the structure of what an
OwnedBeaconfile looks like, @ThinkMaize . Maybe it changed between MacOS releases: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
ThinkMaize commentedon Aug 7, 2025
The files within the MasterBeacons folder do match that exact format, so I repeated the process:
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.
wanderdev0 commentedon Aug 8, 2025
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 > historyand 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.
Issue #24: add legacy support and proper argument configurations uppo…
wanderdev0 commentedon Aug 15, 2025
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
MasterBeaconstoo and they will perform theOwnedBeaconsrename step to make the zip format compatible with the appwanderdev0 commentedon Sep 23, 2025
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)
issue wanderdev0#24: implement better testing for establishing the fa…
issue wanderdev0#24: I forgot to update the actual airtag_decryptor.p…
Issue wanderdev0#24: add legacy support and proper argument configura…