mirror of
https://github.com/nab138/isideload.git
synced 2026-03-02 06:26:16 +01:00
Properly impliment list teams and fix cert on windows
This commit is contained in:
28
Cargo.lock
generated
28
Cargo.lock
generated
@@ -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",
|
||||
|
||||
@@ -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" }
|
||||
@@ -55,5 +55,5 @@ async fn main() {
|
||||
.await
|
||||
.expect("Failed to list teams");
|
||||
|
||||
println!("{}", pretty_print_dictionary(&res));
|
||||
println!("{:#?}", res);
|
||||
}
|
||||
|
||||
@@ -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<Dictionary>,
|
||||
) -> Result<Dictionary, Report> {
|
||||
) -> Result<String, Report> {
|
||||
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<Dictionary, Report> {
|
||||
self.send_developer_request(&DeveloperDeviceType::Any.dev_url("listTeams"), None)
|
||||
.await
|
||||
pub async fn list_teams(&self) -> Result<Vec<DeveloperTeam>, 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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
pub mod developer_session;
|
||||
pub mod device_type;
|
||||
pub mod structures;
|
||||
17
isideload/src/dev/structures.rs
Normal file
17
isideload/src/dev/structures.rs
Normal file
@@ -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<DeveloperTeam>,
|
||||
pub result_code: i64,
|
||||
}
|
||||
Reference in New Issue
Block a user