mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-03-02 06:26:15 +01:00
Clean up cargo clippy warnings
This commit is contained in:
@@ -81,11 +81,11 @@ dvt = ["dep:byteorder", "dep:ns-keyed-archive"]
|
|||||||
heartbeat = ["tokio/macros", "tokio/time"]
|
heartbeat = ["tokio/macros", "tokio/time"]
|
||||||
house_arrest = ["afc"]
|
house_arrest = ["afc"]
|
||||||
installation_proxy = [
|
installation_proxy = [
|
||||||
"dep:async_zip",
|
"dep:async_zip",
|
||||||
"dep:futures",
|
"dep:futures",
|
||||||
"async_zip/tokio",
|
"async_zip/tokio",
|
||||||
"async_zip/deflate",
|
"async_zip/deflate",
|
||||||
"tokio/fs"
|
"tokio/fs",
|
||||||
]
|
]
|
||||||
springboardservices = []
|
springboardservices = []
|
||||||
misagent = []
|
misagent = []
|
||||||
@@ -135,6 +135,7 @@ full = [
|
|||||||
"preboard_service",
|
"preboard_service",
|
||||||
"restore_service",
|
"restore_service",
|
||||||
"rsd",
|
"rsd",
|
||||||
|
"screenshotr",
|
||||||
"springboardservices",
|
"springboardservices",
|
||||||
"syslog_relay",
|
"syslog_relay",
|
||||||
"tcp",
|
"tcp",
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ use idevice::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
mod common;
|
mod common;
|
||||||
mod pcap;
|
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ async fn main() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let mut res: Vec<u8> = 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 rsd_port = proxy.handshake.server_rsd_port;
|
||||||
|
|
||||||
let adapter = proxy.create_software_tunnel().expect("no software tunnel");
|
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)
|
let mut ts_client = idevice::dvt::screenshot::ScreenshotClient::new(&mut ts_client)
|
||||||
.await
|
.await
|
||||||
.expect("Unable to get channel for take screenshot");
|
.expect("Unable to get channel for take screenshot");
|
||||||
res = ts_client
|
ts_client
|
||||||
.take_screenshot()
|
.take_screenshot()
|
||||||
.await
|
.await
|
||||||
.expect("Failed to take screenshot");
|
.expect("Failed to take screenshot")
|
||||||
} else {
|
} else {
|
||||||
let mut screenshot_client = match ScreenshotService::connect(&*provider).await {
|
let mut screenshot_client = match ScreenshotService::connect(&*provider).await {
|
||||||
Ok(client) => client,
|
Ok(client) => client,
|
||||||
@@ -99,9 +99,10 @@ async fn main() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
res = screenshot_client.take_screenshot().await.unwrap();
|
screenshot_client.take_screenshot().await.unwrap()
|
||||||
}
|
};
|
||||||
match fs::write(output_path, &res) {
|
|
||||||
|
match fs::write(output_path, res) {
|
||||||
Ok(_) => println!("Screenshot saved to: {}", output_path),
|
Ok(_) => println!("Screenshot saved to: {}", output_path),
|
||||||
Err(e) => eprintln!("Failed to write screenshot to file: {}", e),
|
Err(e) => eprintln!("Failed to write screenshot to file: {}", e),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user