Skip to content

Commit 7b3dac3

Browse files
committed
Schema fixes
1 parent 0cd1f0f commit 7b3dac3

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/findmy.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,8 @@ impl<P: AnisetteProvider> FindMyClient<P> {
566566
let data: FetchPositionsResponse = REQWEST.post("https://gateway.icloud.com/findmyservice/v2/fetch")
567567
.basic_auth(&format!("{}", state.dsid), Some(token))
568568
.headers(anisette_headers)
569-
.header("X-MMe-Client-Info", self.config.get_mme_clientinfo("com.apple.icloud.searchpartyuseragent/1.0"))
569+
// must match ADI, skip for mobile
570+
// .header("X-MMe-Client-Info", self.config.get_mme_clientinfo("com.apple.icloud.searchpartyuseragent/1.0"))
570571
.header("x-apple-setup-proxy-request", "true")
571572
.header("accept-version", "4")
572573
.header("user-agent", "searchpartyuseragent/1 iMac13,1/13.6.4")

src/imessage/cloud_messages.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,11 +331,13 @@ impl CloudKitEncryptedValue for MessageFlags {
331331
}
332332
}
333333

334+
// a generic "apple has no schema" type. They really don't.
334335
#[derive(Serialize, Deserialize, Debug, Clone)]
335336
#[serde(untagged)]
336337
pub enum NumOrString {
337338
Num(u32),
338339
String(String),
340+
Bool(bool),
339341
}
340342
impl Default for NumOrString {
341343
fn default() -> Self {
@@ -401,7 +403,7 @@ impl Into<Option<MMCSAttachmentMeta>> for &Attachment {
401403
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
402404
pub struct AttachmentMetaExtra {
403405
#[serde(rename = "pgens")]
404-
pub preview_generation_state: Option<i32>, // set to 1
406+
pub preview_generation_state: Option<NumOrString>, // set to 1
405407
}
406408

407409
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
@@ -411,8 +413,9 @@ pub struct AttachmentMeta {
411413
// yes, these dates can be negative
412414
#[serde(rename = "sdt")]
413415
pub start_date: i64,
416+
// yes, this can be negative, i think apple is trolling...
414417
#[serde(rename = "tb")]
415-
pub total_bytes: u64,
418+
pub total_bytes: i64,
416419
#[serde(rename = "st")]
417420
pub transfer_state: i32,
418421
#[serde(rename = "is")]
@@ -430,7 +433,7 @@ pub struct AttachmentMeta {
430433
#[serde(rename = "ig")]
431434
pub is_outgoing: bool,
432435
#[serde(rename = "tn")]
433-
pub transfer_name: String,
436+
pub transfer_name: Option<String>,
434437
#[serde(rename = "vers")]
435438
pub version: i32, // set to 1
436439
#[serde(rename = "t")]

0 commit comments

Comments
 (0)