mirror of
https://github.com/nab138/isideload.git
synced 2026-03-02 14:36:16 +01:00
Anisette provisioning works
This commit is contained in:
@@ -5,5 +5,6 @@ edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
isideload = { path = "../../isideload" }
|
||||
env_logger = "0.11.8"
|
||||
tokio = { version = "1.49.0", features = ["rt-multi-thread", "macros"] }
|
||||
tracing = "0.1.44"
|
||||
tracing-subscriber = "0.3.22"
|
||||
|
||||
@@ -3,10 +3,15 @@ use std::{env, path::PathBuf};
|
||||
use isideload::{
|
||||
anisette::remote_v3::RemoteV3AnisetteProvider, auth::apple_account::AppleAccountBuilder,
|
||||
};
|
||||
use tracing::Level;
|
||||
use tracing_subscriber::FmtSubscriber;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
env_logger::init();
|
||||
let subscriber = FmtSubscriber::builder()
|
||||
.with_max_level(Level::DEBUG)
|
||||
.finish();
|
||||
tracing::subscriber::set_global_default(subscriber).expect("setting default subscriber failed");
|
||||
|
||||
let args: Vec<String> = env::args().collect();
|
||||
let _app_path = PathBuf::from(
|
||||
@@ -22,13 +27,17 @@ async fn main() {
|
||||
let mut code = String::new();
|
||||
println!("Enter 2FA code:");
|
||||
std::io::stdin().read_line(&mut code).unwrap();
|
||||
Ok(code.trim().to_string())
|
||||
Some(code.trim().to_string())
|
||||
};
|
||||
|
||||
let _account = AppleAccountBuilder::new(apple_id)
|
||||
let account = AppleAccountBuilder::new(apple_id)
|
||||
.danger_debug(true)
|
||||
.anisette(RemoteV3AnisetteProvider::default().set_serial_number("2".to_string()))
|
||||
.login(apple_password, get_2fa_code)
|
||||
.await
|
||||
.unwrap();
|
||||
.await;
|
||||
|
||||
match account {
|
||||
Ok(_account) => println!("Successfully logged in to Apple ID"),
|
||||
Err(e) => eprintln!("Failed to log in to Apple ID: {}", e),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user