diff --git a/idevice/Cargo.toml b/idevice/Cargo.toml index 4a255e5..86a1808 100644 --- a/idevice/Cargo.toml +++ b/idevice/Cargo.toml @@ -81,11 +81,11 @@ dvt = ["dep:byteorder", "dep:ns-keyed-archive"] heartbeat = ["tokio/macros", "tokio/time"] house_arrest = ["afc"] installation_proxy = [ - "dep:async_zip", + "dep:async_zip", "dep:futures", - "async_zip/tokio", + "async_zip/tokio", "async_zip/deflate", - "tokio/fs" + "tokio/fs", ] springboardservices = [] misagent = [] @@ -135,6 +135,7 @@ full = [ "preboard_service", "restore_service", "rsd", + "screenshotr", "springboardservices", "syslog_relay", "tcp", diff --git a/tools/src/pcapd.rs b/tools/src/pcapd.rs index 167a4aa..9cef909 100644 --- a/tools/src/pcapd.rs +++ b/tools/src/pcapd.rs @@ -7,7 +7,6 @@ use idevice::{ }; mod common; -mod pcap; #[tokio::main] async fn main() { diff --git a/tools/src/screenshot.rs b/tools/src/screenshot.rs index ead4a01..9978ef4 100644 --- a/tools/src/screenshot.rs +++ b/tools/src/screenshot.rs @@ -64,8 +64,8 @@ async fn main() { return; } }; - let mut res: Vec = Vec::new(); - if let Ok(proxy) = CoreDeviceProxy::connect(&*provider).await { + + let res = if let Ok(proxy) = CoreDeviceProxy::connect(&*provider).await { let rsd_port = proxy.handshake.server_rsd_port; let adapter = proxy.create_software_tunnel().expect("no software tunnel"); @@ -85,10 +85,10 @@ async fn main() { let mut ts_client = idevice::dvt::screenshot::ScreenshotClient::new(&mut ts_client) .await .expect("Unable to get channel for take screenshot"); - res = ts_client + ts_client .take_screenshot() .await - .expect("Failed to take screenshot"); + .expect("Failed to take screenshot") } else { let mut screenshot_client = match ScreenshotService::connect(&*provider).await { Ok(client) => client, @@ -99,9 +99,10 @@ async fn main() { return; } }; - res = screenshot_client.take_screenshot().await.unwrap(); - } - match fs::write(output_path, &res) { + screenshot_client.take_screenshot().await.unwrap() + }; + + match fs::write(output_path, res) { Ok(_) => println!("Screenshot saved to: {}", output_path), Err(e) => eprintln!("Failed to write screenshot to file: {}", e), }