Start isideload-next

This commit is contained in:
nab138
2025-12-16 07:50:38 -05:00
parent cdedc84e8b
commit 8f44e8e3a1
16 changed files with 40 additions and 7798 deletions

View File

@@ -1,5 +0,0 @@
.zsign_cache
keys
*.ipa
state.plist
*.mobileprovision

View File

@@ -1,10 +0,0 @@
[package]
name = "minimal"
version = "0.1.0"
edition = "2024"
publish = false
[dependencies]
isideload = { path = "../../isideload" }
idevice = { version = "0.1.46", features = ["usbmuxd", "ring"], default-features = false}
tokio = { version = "1.43", features = ["macros", "rt-multi-thread"] }

View File

@@ -1,68 +0,0 @@
use std::{env, path::PathBuf, sync::Arc};
use idevice::usbmuxd::{UsbmuxdAddr, UsbmuxdConnection};
use isideload::{
AnisetteConfiguration, AppleAccount, SideloadConfiguration,
developer_session::DeveloperSession, sideload::sideload_app,
};
#[tokio::main]
async fn main() {
let args: Vec<String> = env::args().collect();
let app_path = PathBuf::from(
args.get(1)
.expect("Please provide the path to the app to install"),
);
let apple_id = args
.get(2)
.expect("Please provide the Apple ID to use for installation");
let apple_password = args.get(3).expect("Please provide the Apple ID password");
// You don't have to use usbmuxd, you can use any IdeviceProvider
let usbmuxd = UsbmuxdConnection::default().await;
if usbmuxd.is_err() {
panic!("Failed to connect to usbmuxd: {:?}", usbmuxd.err());
}
let mut usbmuxd = usbmuxd.unwrap();
let devs = usbmuxd.get_devices().await.unwrap();
if devs.is_empty() {
panic!("No devices found");
}
let provider = devs
.iter()
.next()
.unwrap()
.to_provider(UsbmuxdAddr::from_env_var().unwrap(), "isideload-demo");
// Change the anisette url and such here
// Note that right now only remote anisette servers are supported
let anisette_config = AnisetteConfiguration::default();
let get_2fa_code = || {
let mut code = String::new();
println!("Enter 2FA code:");
std::io::stdin().read_line(&mut code).unwrap();
Ok(code.trim().to_string())
};
let account = AppleAccount::login(
|| Ok((apple_id.to_string(), apple_password.to_string())),
get_2fa_code,
anisette_config,
)
.await
.unwrap();
let dev_session = DeveloperSession::new(Arc::new(account));
// You can change the machine name, store directory (for certs, anisette data, & provision files), and logger
let config = SideloadConfiguration::default()
.set_machine_name("isideload-demo".to_string())
.set_force_sidestore(true);
sideload_app(&provider, &dev_session, app_path, config)
.await
.unwrap()
}