Add example

This commit is contained in:
nab138
2025-08-09 22:35:27 -04:00
parent a638a64f61
commit 3510f87f91
14 changed files with 3370 additions and 24 deletions

20
Cargo.lock generated
View File

@@ -1362,6 +1362,14 @@ version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
[[package]]
name = "minimal"
version = "0.1.0"
dependencies = [
"isideload",
"tokio",
]
[[package]]
name = "minimal-lexical"
version = "0.2.1"
@@ -2381,9 +2389,21 @@ dependencies = [
"pin-project-lite",
"slab",
"socket2 0.6.0",
"tokio-macros",
"windows-sys 0.59.0",
]
[[package]]
name = "tokio-macros"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.104",
]
[[package]]
name = "tokio-native-tls"
version = "0.3.1"

View File

@@ -1,23 +1,4 @@
[package]
name = "isideload"
version = "0.1.0"
edition = "2024"
[features]
default = []
vendored-openssl = ["openssl/vendored"]
vendored-botan = ["icloud_auth/vendored-botan"]
[dependencies]
serde = { version = "1", features = ["derive"] }
plist = { version = "1.7" }
icloud_auth = { version = "0.1.1", package = "nab138_icloud_auth"}
uuid = { version = "1.17.0", features = ["v4"] }
zip = "4.3"
hex = "0.4"
sha1 = "0.10"
idevice = { version = "0.1.37", features = ["afc", "usbmuxd", "installation_proxy"] }
openssl = "0.10"
futures = "0.3"
zsign-rust = "0.1"
thiserror = "2"
[workspace]
resolver = "2"
members = ["isideload", "examples/minimal"]
default-members = ["isideload"]

View File

@@ -15,7 +15,7 @@ To use isideload, add the following to your `Cargo.toml`:
isideload = { version = "0.1.0", features = ["vendored-openssl", "vendored-botan" ] } # Optionally, both vendored features can be enabled to avoid needing OpenSSL and Botan installed on your system.
```
Then, in your Rust code, you can use it as follows:
See [examples/minimal/src/main.rs](examples/minimal/src/main.rs) for usage examples.
## Licensing

View File

@@ -0,0 +1,9 @@
[package]
name = "minimal"
version = "0.1.0"
edition = "2024"
publish = false
[dependencies]
isideload = { path = "../../isideload", features = ["vendored-openssl", "vendored-botan"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }

View File

@@ -0,0 +1,53 @@
use std::{env, path::PathBuf, sync::Arc};
use isideload::{
AnisetteConfiguration, AppleAccount, DefaultLogger, DeveloperSession, device::list_devices,
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 the builtin list_devices method if you don't want to use usbmuxd
// You can use idevice to get the device info however you want
// This is just easier
let device = list_devices().await.unwrap().into_iter().next().unwrap();
println!("Target device: {}", device.name);
// 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));
// This is where certificates, mobileprovision, and anisette data will be stored
let store_dir = std::env::current_dir().unwrap();
sideload_app(DefaultLogger {}, &dev_session, &device, app_path, store_dir)
.await
.unwrap()
}

3260
isideload/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

23
isideload/Cargo.toml Normal file
View File

@@ -0,0 +1,23 @@
[package]
name = "isideload"
version = "0.1.0"
edition = "2024"
[features]
default = []
vendored-openssl = ["openssl/vendored"]
vendored-botan = ["icloud_auth/vendored-botan"]
[dependencies]
serde = { version = "1", features = ["derive"] }
plist = { version = "1.7" }
icloud_auth = { version = "0.1.1", package = "nab138_icloud_auth"}
uuid = { version = "1.17.0", features = ["v4"] }
zip = "4.3"
hex = "0.4"
sha1 = "0.10"
idevice = { version = "0.1.37", features = ["afc", "usbmuxd", "installation_proxy"] }
openssl = "0.10"
futures = "0.3"
zsign-rust = "0.1"
thiserror = "2"