biemster / FindMy

Query Apple's Find My network
225 stars 39 forks source link

Simplify usage when a tag cycles through many keys #9

Closed olivluca closed 1 year ago

olivluca commented 1 year ago

I modified generate_keys.py so that you can specify a prefix to use as a filename and a yaml file where to store the generated keys. I the same way I modified request_reports to only use key files with a specific prefix. In that case, the part after the prefix is considered as a subkey, included in the json. I also made some more modification to request_reports to filter the reports based on the timestamp (apple's servers send all the reports), to sort them by timestamp (even if there are several keys it's the same tag, so it's more useful this way). I added an isotimestamp in the json as well as a google maps url. And the status byte :wink:

biemster commented 1 year ago

Nice! thanks for this. I was also considering to add a bit of organisation to the key generator, and the status byte and google maps link are a very nice addition. I'll merge this soon. Keep in mind though that my intention with this code is that is should be the simplest, leanest proof of concept of how to work with the FindMy network, so I don't want to add any bells and whistles further. I'm actually planning to cut out code and turn the script into just a proxy server so other programs can handle the query and response.

olivluca commented 1 year ago

That's a good plan, but to work as a proxy you'll have to find a way to get the current icloud decryption key without a prompt :cry: Right now I just wrapped the script as a tcp server (there's an simple way to do it but I don't remember how), so I can telnet to the virtual machine an get back the reports, but, as I said, from time to time I have to either answer to the prompt on the virtual machine (with the old method using /bin/security) or to change the script with the new iCloud decryption key.

biemster commented 1 year ago

I wrapped the script once using script -t 1 for 2 weeks, and it did not ask for any password confirmation. But since then it is asking me almost daily (Also on Catalina VM here).