picklepete / pyicloud

A Python + iCloud wrapper to access iPhone and Calendar data.
MIT License
2.57k stars 452 forks source link

Advice adding support for the latest version of reminders #394

Open JonHolman opened 2 years ago

JonHolman commented 2 years ago

The problem

I'm trying to add support for the latest version of reminders and I've gotten stuck at trying to figure out how to decrypt the text I'm getting back from https://p53-ckdatabasews.icloud.com/database/1/com.apple.reminders/production/private/records/query .

I'm assuming the data I want is in the key TitleDocument, it's value is encrypted and the type is 'ENCRYPTED_BYTES'.

Anyone have experience with these encrypted values? Have you seen this in other iCloud services? Any advice would be much appreciated. Thank you.

Environment

Traceback/Error logs

Checklist

Additional information

ssennettau commented 2 years ago

The values returned with the type ENCRYPTED_BYTES appear to be using Base64, which can be decoded using Python's standard base64 module. Have not attempted to implement it in this codebase, but worth testing. The decoding returns a byte object by default, so it must be converted to a string.

import base64

base64.b64decode(<VALUE_VARIABLE>).decode("utf-8")
JonHolman commented 2 years ago

@ssennettau I agree, many of them are, especially in Notes, but in Reminders they appear to be more encrypted or another encoding.

bushaev-denis commented 1 year ago

My 5 cents here, we can try to inspect js code from https://icloud.com, i have tried, but without success. Here is TitleDocument decodes, 0.main.js, find by keywords.

Screenshot 2023-10-07 at 22 38 55