diff --git a/Cargo.lock b/Cargo.lock index b700466..1bf6410 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -106,6 +106,12 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + [[package]] name = "bitflags" version = "2.10.0" @@ -1355,8 +1361,7 @@ dependencies = [ [[package]] name = "rustls-platform-verifier" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d99feebc72bae7ab76ba994bb5e121b8d83d910ca40b36e0921f53becc41784" +source = "git+https://github.com/cstkingkey/rustls-platform-verifier?branch=extra#1efde30e9080351dc1afd74151ea5b849f1e69f9" dependencies = [ "core-foundation 0.10.1", "core-foundation-sys", @@ -1370,14 +1375,13 @@ dependencies = [ "security-framework", "security-framework-sys", "webpki-root-certs", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] name = "rustls-platform-verifier-android" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" +source = "git+https://github.com/cstkingkey/rustls-platform-verifier?branch=extra#1efde30e9080351dc1afd74151ea5b849f1e69f9" [[package]] name = "rustls-webpki" @@ -1421,7 +1425,7 @@ version = "3.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef" dependencies = [ - "bitflags", + "bitflags 2.10.0", "core-foundation 0.10.1", "core-foundation-sys", "libc", @@ -1591,20 +1595,20 @@ dependencies = [ [[package]] name = "system-configuration" -version = "0.6.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation 0.9.4", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.6.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" dependencies = [ "core-foundation-sys", "libc", @@ -1802,7 +1806,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" dependencies = [ "async-compression", - "bitflags", + "bitflags 2.10.0", "bytes", "futures-core", "futures-util", diff --git a/Cargo.toml b/Cargo.toml index b546fb1..9dc06e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,3 +2,6 @@ resolver = "2" members = ["examples/minimal","isideload"] default-members = ["isideload"] + +[patch.crates-io] +rustls-platform-verifier = { git = "https://github.com/cstkingkey/rustls-platform-verifier", branch = "extra" } \ No newline at end of file diff --git a/examples/minimal/src/main.rs b/examples/minimal/src/main.rs index aec33c1..9a3a305 100644 --- a/examples/minimal/src/main.rs +++ b/examples/minimal/src/main.rs @@ -55,5 +55,5 @@ async fn main() { .await .expect("Failed to list teams"); - println!("{}", pretty_print_dictionary(&res)); + println!("{:#?}", res); } diff --git a/isideload/Cargo.toml b/isideload/Cargo.toml index 657d926..7ed3adb 100644 --- a/isideload/Cargo.toml +++ b/isideload/Cargo.toml @@ -37,4 +37,4 @@ pbkdf2 = "0.12.2" hmac = "0.12.1" cbc = { version = "0.1.2", features = ["std"] } aes = "0.8.4" -aes-gcm = "0.10.3" +aes-gcm = "0.10.3" \ No newline at end of file diff --git a/isideload/src/dev/developer_session.rs b/isideload/src/dev/developer_session.rs index 18e351b..7966817 100644 --- a/isideload/src/dev/developer_session.rs +++ b/isideload/src/dev/developer_session.rs @@ -1,6 +1,7 @@ use plist::Dictionary; use plist_macro::plist; use rootcause::prelude::*; +use tracing::debug; use uuid::Uuid; use crate::{ @@ -9,7 +10,10 @@ use crate::{ apple_account::{AppToken, AppleAccount}, grandslam::GrandSlam, }, - dev::device_type::DeveloperDeviceType, + dev::{ + device_type::DeveloperDeviceType, + structures::{DeveloperTeam, ListTeamResponse}, + }, util::plist::{PlistDataExtract, plist_to_xml_string}, }; @@ -58,7 +62,7 @@ impl<'a> DeveloperSession<'a> { &self, url: &str, body: Option, - ) -> Result { + ) -> Result { let body = body.unwrap_or_else(|| Dictionary::new()); let base = plist!(dict { @@ -85,14 +89,22 @@ impl<'a> DeveloperSession<'a> { .await .context("Failed to read developer request response text")?; - let dict: Dictionary = plist::from_bytes(text.as_bytes()) - .context("Failed to parse developer request plist")?; + // let dict: Dictionary = plist::from_bytes(text.as_bytes()) + // .context("Failed to parse developer request plist")?; - Ok(dict) + Ok(text) } - pub async fn list_teams(&self) -> Result { - self.send_developer_request(&DeveloperDeviceType::Any.dev_url("listTeams"), None) - .await + pub async fn list_teams(&self) -> Result, Report> { + let res = self + .send_developer_request(&DeveloperDeviceType::Any.dev_url("listTeams"), None) + .await?; + + let response: ListTeamResponse = plist::from_bytes(res.as_bytes()) + .context("Failed to parse list teams response plist")?; + + debug!("List Teams Response Code: {:?}", response.result_code); + + Ok(response.teams) } } diff --git a/isideload/src/dev/mod.rs b/isideload/src/dev/mod.rs index dd3c3fb..11420e3 100644 --- a/isideload/src/dev/mod.rs +++ b/isideload/src/dev/mod.rs @@ -1,2 +1,3 @@ pub mod developer_session; pub mod device_type; +pub mod structures; \ No newline at end of file diff --git a/isideload/src/dev/structures.rs b/isideload/src/dev/structures.rs new file mode 100644 index 0000000..1516cd5 --- /dev/null +++ b/isideload/src/dev/structures.rs @@ -0,0 +1,17 @@ +use serde::Deserialize; + +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct DeveloperTeam { + name: String, + team_id: String, + r#type: String, + status: String, +} + +#[derive(Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ListTeamResponse { + pub teams: Vec, + pub result_code: i64, +}