Skip to content

Question RE: cloudkit.rs #18

Open
Open

Description

@wanderdev0

Hi, I'm here from malmeloo/FindMy.py#173

I'm admittedly completely unfamiliar with Rust. I'm curious if the code @ https://github.com/OpenBubbles/rustpush/blob/master/src/cloudkit.rs#L828 actually fully implements the whole "retrieve all data for the iDevices in your account" logic? And if it does, is there any easy entry point for this or some test code that covers that use-case?

A bunch of people from the "FindMy space" (me included with this app: https://github.com/parawanderer/OpenTagViewer) are very interested in allowing users to fetch data for their AirTags without requiring a MacOS device to extract the information from (see: malmeloo/FindMy.py#173 and malmeloo/FindMy.py#177)

Thx in advance!

Activity

  1. TaeHagen commented on Sep 19, 2025

    @TaeHagen
    Collaborator

    Hi, That code you linked implements CloudKit. It's open to third party developers, but Apple uses it for many things, including storing FindMy item keys. The code to retrieve the keys is here FindMy.

    This code is currently distributed in OpenBubbles (an Android App). If you install OpenBubbles, you can log into your Apple account and see your FindMy items with no Apple device involved (however it cannot setup airtags, only track at this time).

  2. wanderdev0 commented on Sep 19, 2025

    @wanderdev0
    Author

    Oh interesting @TaeHagen , thanks for the info! I think we have a slightly overlapping use-case then with my app and yours.

    From the website for OpenBubbles I see that you don't actively advertise the whole "AirTag on Android" use-case and require setting up a server, though. I guess the main difference with my app is that you don't necessarily require a server or all that much further setup, past just logging in to an apple account.

    I probably need to think about this a bit, but for the FindMy.py library (which aims at providing an interface to the apple FindMy world for anybody, which my app then just uses basically) I think people would probably really like it if they could fetch the tags for their devices the way you do in your app/code here, without any "we need to steal files from the cache of a Mac" hacks as we have now. Though, I also don't want to steal your use-case 😅 and I'm not all that attached to my app either -- I just made it because I googled if there was a simple solution for displaying the data on android and there seemingly wasn't, so I wrote one up really quickly.

    Nonetheless, would you be open in looking into how your existing work could be combined into that FindMy.py library? Whether via a bridge or by just copying over the relevant parts for "retrieving the airtags for a user account dynamically"?

  3. TaeHagen commented on Sep 19, 2025

    @TaeHagen
    Collaborator

    We don't require setting up a server. You just need hardware data to authenticate with Apple. We don't advertise the Airtag on Android use case because it is brand new, just came out last version.

    The problem with just "copying over the parts" is, there are a lot of parts. You need to implement GSA circle for 2fa, Cuttlefish/Octagon for trust, PCS for cloudkit encryption, cloudkit for cloudkit, and then you can finally pull + decrypt the keys. I did all that work for Messages in iCloud, FindMy was just a nice bonus.

  4. wanderdev0 commented on Sep 19, 2025

    @wanderdev0
    Author

    Oh interesting, alright, I see. I think in that case your app might just cover what I wanted to achieve with my app directly now, from the sounds of it. I'll have to look into that and maybe just point people to your app for this use-case moving forward.

    Got it regarding how much there is to copy here for the more wider FindMy.py setup. Though, I am wondering if there'd still be some avenue of integrating anything at all via a bridge for the FindMy.py library? I imagine there are still many people who'd love to write up their own logic around retrieving their tags' data outside of the "I want to just see them on android" case that is now covered.

  5. TaeHagen commented on Sep 19, 2025

    @TaeHagen
    Collaborator

    You could always use rustpush just to extract keys and move them over to FindMy.py or your app.

    If it's helpful, I could add a function to OpenBubbles that exports keys to disk in a community-defined format. Right now I already have them all stored in a plist file on device, it's just a matter of copying them.

  6. wanderdev0 commented on Sep 19, 2025

    @wanderdev0
    Author

    I think that if you could have a function that does the export to disk that would be very helpful to a bunch of people involved! 🙏

    I think from the FindMy side the "canonical format" the community has been using for the plist files is this XML format:

    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

    People already wrote a bunch of convertors to work with this format, so that's probably the one to use.

  7. wanderdev0 commented on Sep 19, 2025

    @wanderdev0
    Author

    Here you go, this should get you the right thing format. This is "OwnedBeacon":

    wanderdev0/OpenTagViewer#24 (comment)

    Bonus points if you could include "BeaconNamingRecord":

    <?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>associatedBeacon</key>
    	<string>11111111-1111-1111-1111-111111111111 <!-- UUID, relates to a beacon in OwnedBeacons --></string>
    	<key>cloudKitMetadata</key>
    	<data>
    	<!-- Base64 blob, multi-line -->
    	</data>
    	<key>emoji</key>
    	<string>👵<!-- emoji, selectable in UI --></string>
    	<key>identifier</key>
    	<string>11111111-1111-1111-1111-111111111111<!-- UUID --></string>
    	<key>name</key>
    	<string>My Tag Name<!-- Name, as defined in the apple UI --></string>
    	<key>roleId</key>
    	<integer>999 <!-- no idea --></integer>
    </dict>
    </plist>
    

    The canonical output format that all the existing tools use for the XML is this:

    <generated output folder>/
    ├── BeaconNamingRecord/
    │   ├── <UUID 1>/
    │   │   └── <UUID 2>.plist
    │   └── ...
    ├── OwnedBeacons/
    │   ├── <UUID 1>.plist
    │   └── ...
    └── ...
    
  8. malmeloo commented on Sep 19, 2025

    @malmeloo

    Ha, I was already thinking of looking into how feasible it'd be to wrap rustpush in a simple CLI utility. Is the Apple hardware requirement only for iMessage or is it also required to access the keychain? If it still requires a mac or iPhone like OpenBubbles does now, that kind of defeats the idea of having a cross-platform utility.

    As for the format: simply outputting the plist would totally work, but one downside is that the initial alignment data would not be included. FindMy.py currently uses a rather simple JSON format for accessories, so that would be ideal. But honestly, having support for macless accessory dumping in the first place would be a blessing already.

  9. TaeHagen commented on Sep 19, 2025

    @TaeHagen
    Collaborator

    Apple hardware requirement is techincally required to access keychain, but i don't think apple cares if the hardware is valid, should just be able to randomize most of the data and it should let you in fine.

    I have access to alignment data, I can put anything in the plist I want to, including that if that's what you need.

  10. malmeloo commented on Sep 19, 2025

    @malmeloo

    If you think it could work without access to actual apple hardware that'd be perfect. As for the format, whatever is convenient would work really. I can add support to FindMy.py to import from any arbitrary format. But access to alignment data would be nice just so that the first fetch isn't a complete shot in the dark.

  11. malmeloo commented on Oct 21, 2025

    @malmeloo

    I have a few questions regarding what this solution would look like. It seems I was a bit misinformed about the nature of rustpush as an open source project.

    From what I understand:

    • Rustpush uses a closed-source dependency that prevents us from using it as a dependency in another Rust project
    • No binaries are provided that can be linked against or would allow us to use a CLI built into rustpush
    • OpenBubbles still requires a mac or iPhone to set up

    Correct? If so that'd be quite a bummer, because it would mean we'd still require access to Apple hardware to export airtag keys. Is there a way around this?

  12. TaeHagen commented on Oct 21, 2025

    @TaeHagen
    Collaborator

    There are two closed source dependencies.

    • OpenAbsinthe, used for registration with iMessage. This does not affect you, because you do not seek to register with iMessage
    • ClearADI, for generation of Anisette Data. You do need anisette data, however, you likely already have your own code to get that (using sidestore's server probably).

    So while yes, parts are closed, they shouldn't affect you.

  13. TaeHagen commented on Oct 21, 2025

    @TaeHagen
    Collaborator

    You still need apple hw IDs to send to Apple's server (X-MME-Client-Info or whatever) but you should be able to make something up, i don't think that stuff is strictly validated

  14. malmeloo commented on Oct 21, 2025

    @malmeloo

    Ahh got it, thanks :)

    I'll look into this stuff properly soon, that should clarify some of my questions.

  15. malmeloo commented on Nov 24, 2025

    @malmeloo

    Would you maybe be able to provide a quick proof of concept? I got rustpush to compile with the api stubs and I think I have a general idea of how it's supposed to work, but it's not clear to me for example how to load an AppleAccount from disk - it has no serializable 'state' like most other structs it seems? And all methods to contruct an account appear to do interactive authentication which I think shouldn't be necessary. I also don't really understand what some of the fields of KeychainClient are supposed to be, like 'update_state' and both 'container's.

    test.rs feels like it gets me 70% of the way there, but there appear to have been quite some API changes and it no longer compiles anymore :-)

  16. malmeloo commented on Jan 21, 2026

    @malmeloo

    So I looked into this again. Got a bit further this time (at least I feel like I did). Your updates to test.rs helped a lot, thanks for that :)

    I'm currently getting stuck on Albert activation. The activation response appears to be empty, and rustpush (understandably) panics with "Failed to parse Albert Cert!". My response looks as follows:

    <Document disableHistory="true">
            <Protocol><plist version="1.0">
      <dict/>
    </plist></Protocol>
            <ScrollView> <!-- some type of markup language --> </ScrollView></Document>

    My best guess is that my hardware config is wrong; I'm definitely missing a bunch of fields that appear to be involved in Albert activation. I tried using your 'Mac-Hardware-Info' tool to obtain the values, but that only spits out binary activation data which I assume needs to be loaded with HardwareConfig::from_validation_data, which appears to be closed source. I then tried to use Beeper's mac-registration-provider, but it's missing values and once again exports the validation data.

    HardwareConfig {
            product_name: "iMacPro1,1".to_string(),
            io_mac_address: [0, 0, 0, 0, 0, 0],  // en0 mac address (hidden)
            platform_serial_number: "abcd".to_string(), // serial number (hidden)
            platform_uuid: String::new(), // ???
            root_disk_uuid: String::new(),  // ???
            board_id: "aaaaa-bbb-ccc-dddddd".to_string(),  // 'unique device id' ??? (hidden)
            os_build_num: "23H626".to_string(),  // 'software build id'
            // all of these are a complete mystery to me
            platform_serial_number_enc: vec![],
            platform_uuid_enc: vec![],
            root_disk_uuid_enc: vec![],
            rom: vec![],
            rom_enc: vec![],
            mlb: "".to_string(),
            mlb_enc: vec![],
        }

    Where could I obtain the missing fields? I have a hackintosh that Apple appears to like well enough, but I'm not sure how to extract this data from it.

    It could also be an issue with the fairplay certs I'm using; I tried both the 'legacy' cert you recently added and the cert in PyPush's repository. Did Apple revoke these certs? If I need the 'real' certs, how could I obtain those? As far as I can see Albert activation is necessary to join a circle, or am I mistaken?

  17. TaeHagen commented on Jan 21, 2026

    @TaeHagen
    Collaborator

    Hi, you actually don't need APS activation for what you need. That is mainly used for iMessage. Look at test.rs, what you need is a KeychainClient object. Now actually, you do need an anisette client, which does take in a GSA config. You can pass in a default APSState for your purposes (Default::default())

  18. TaeHagen commented on Jan 21, 2026

    @TaeHagen
    Collaborator

    Okay techincally findmy does use APS activation, but that is used for findmy sharing over iMessage. You should be able to just comment any code that uses it, that isn't nesseary for item sharing.

  19. TaeHagen commented on Jan 21, 2026

    @TaeHagen
    Collaborator

    Also, contact me on discord for faster assistance, my username is copperboy100

  20. malmeloo commented on Jun 11, 2026

    @malmeloo

    Hey @TaeHagen, any chance you could take a look at the PRs I've made? We got a PoC working but it would be nice to upstream the changes we had to make.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions