Start scaffolding apple account

This commit is contained in:
nab138
2026-01-06 09:32:26 -05:00
parent 4f2fd8c8c2
commit d88c8a19fd
7 changed files with 1460 additions and 24 deletions

View File

@@ -11,8 +11,11 @@ keywords = ["ios", "sideload"]
readme = "../README.md"
[features]
default = []
default = ["install"]
install = ["dep:idevice"]
[dependencies]
idevice = "0.1.50"
idevice = { version = "0.1.50", optional = true }
plist = "1.8.0"
plist-macro = "0.1.0"
reqwest = { version = "0.13.1", features = ["json", "gzip"] }

View File

View File

@@ -0,0 +1,27 @@
use reqwest::{Certificate, ClientBuilder};
const APPLE_ROOT: &[u8] = include_bytes!("./apple_root.der");
pub struct AppleAccount {
pub email: String,
pub spd: Option<plist::Dictionary>,
pub client: reqwest::Client,
}
impl AppleAccount {
pub fn new(email: &str) -> reqwest::Result<Self> {
let client = ClientBuilder::new()
.add_root_certificate(Certificate::from_der(APPLE_ROOT)?)
// uncomment when debugging w/ charles proxy
// .danger_accept_invalid_certs(true)
.http1_title_case_headers()
.connection_verbose(true)
.build()?;
Ok(AppleAccount {
email: email.to_string(),
spd: None,
client,
})
}
}

Binary file not shown.

View File

@@ -0,0 +1 @@
pub mod apple_account;

View File

@@ -1,12 +1,4 @@
pub mod anisette;
pub mod auth;
use idevice::{plist, pretty_print_plist};
pub fn test() -> () {
println!(
"{}",
pretty_print_plist(&plist!({
"code": "hello"
}))
);
}
pub fn test() -> () {}