mirror of
https://github.com/nab138/isideload.git
synced 2026-03-02 06:26:16 +01:00
Start scaffolding apple account
This commit is contained in:
1437
Cargo.lock
generated
1437
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -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"] }
|
||||
|
||||
0
isideload/src/anisette/mod.rs
Normal file
0
isideload/src/anisette/mod.rs
Normal file
27
isideload/src/auth/apple_account.rs
Normal file
27
isideload/src/auth/apple_account.rs
Normal 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,
|
||||
})
|
||||
}
|
||||
}
|
||||
BIN
isideload/src/auth/apple_root.der
Normal file
BIN
isideload/src/auth/apple_root.der
Normal file
Binary file not shown.
@@ -0,0 +1 @@
|
||||
pub mod apple_account;
|
||||
|
||||
@@ -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() -> () {}
|
||||
|
||||
Reference in New Issue
Block a user