Refactor idevice tools into single binary

This commit is contained in:
Jackson Coxson
2026-01-03 16:58:33 -07:00
parent 2eebbff172
commit 189dd5caf2
34 changed files with 1983 additions and 2777 deletions

View File

@@ -1,71 +1,18 @@
// Jackson Coxson
use clap::{Arg, Command};
use futures_util::StreamExt;
use idevice::{
IdeviceService, RsdService, core_device::DiagnostisServiceClient,
core_device_proxy::CoreDeviceProxy, rsd::RsdHandshake,
core_device_proxy::CoreDeviceProxy, provider::IdeviceProvider, rsd::RsdHandshake,
};
use jkcli::{CollectedArguments, JkCommand};
use tokio::io::AsyncWriteExt;
mod common;
pub fn register() -> JkCommand {
JkCommand::new().help("Retrieve a sysdiagnose")
}
#[tokio::main]
async fn main() {
tracing_subscriber::fmt::init();
let matches = Command::new("remotexpc")
.about("Gets a sysdiagnose")
.arg(
Arg::new("host")
.long("host")
.value_name("HOST")
.help("IP address of the device"),
)
.arg(
Arg::new("pairing_file")
.long("pairing-file")
.value_name("PATH")
.help("Path to the pairing file"),
)
.arg(
Arg::new("udid")
.value_name("UDID")
.help("UDID of the device (overrides host/pairing file)")
.index(1),
)
.arg(
Arg::new("tunneld")
.long("tunneld")
.help("Use tunneld")
.action(clap::ArgAction::SetTrue),
)
.arg(
Arg::new("about")
.long("about")
.help("Show about information")
.action(clap::ArgAction::SetTrue),
)
.get_matches();
if matches.get_flag("about") {
println!("debug_proxy - connect to the debug proxy and run commands");
println!("Copyright (c) 2025 Jackson Coxson");
return;
}
let udid = matches.get_one::<String>("udid");
let pairing_file = matches.get_one::<String>("pairing_file");
let host = matches.get_one::<String>("host");
let provider =
match common::get_provider(udid, host, pairing_file, "diagnosticsservice-jkcoxson").await {
Ok(p) => p,
Err(e) => {
eprintln!("{e}");
return;
}
};
pub async fn main(_arguments: &CollectedArguments, provider: Box<dyn IdeviceProvider>) {
let proxy = CoreDeviceProxy::connect(&*provider)
.await
.expect("no core proxy");