mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-03-02 06:26:15 +01:00
Correctly parse DDI image lookup result
This commit is contained in:
@@ -90,7 +90,11 @@ impl ImageMounter {
|
|||||||
self.idevice.send_plist(req).await?;
|
self.idevice.send_plist(req).await?;
|
||||||
|
|
||||||
let res = self.idevice.read_plist().await?;
|
let res = self.idevice.read_plist().await?;
|
||||||
match res.get("ImageSignature") {
|
match res
|
||||||
|
.get("ImageSignature")
|
||||||
|
.and_then(|x| x.as_array())
|
||||||
|
.and_then(|x| x.first())
|
||||||
|
{
|
||||||
Some(plist::Value::Data(signature)) => Ok(signature.clone()),
|
Some(plist::Value::Data(signature)) => Ok(signature.clone()),
|
||||||
_ => Err(IdeviceError::NotFound),
|
_ => Err(IdeviceError::NotFound),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,10 @@ pub fn register() -> JkCommand {
|
|||||||
"list",
|
"list",
|
||||||
JkCommand::new().help("Lists the images mounted on the device"),
|
JkCommand::new().help("Lists the images mounted on the device"),
|
||||||
)
|
)
|
||||||
|
.with_subcommand(
|
||||||
|
"lookup",
|
||||||
|
JkCommand::new().help("Lookup the image signature on the device"),
|
||||||
|
)
|
||||||
.with_subcommand(
|
.with_subcommand(
|
||||||
"unmount",
|
"unmount",
|
||||||
JkCommand::new().help("Unmounts the developer disk image"),
|
JkCommand::new().help("Unmounts the developer disk image"),
|
||||||
@@ -101,6 +105,17 @@ pub async fn main(arguments: &CollectedArguments, provider: Box<dyn IdeviceProvi
|
|||||||
println!("{}", pretty_print_plist(&i));
|
println!("{}", pretty_print_plist(&i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
"lookup" => {
|
||||||
|
let sig = mounter_client
|
||||||
|
.lookup_image(if product_version < 17 {
|
||||||
|
"Developer"
|
||||||
|
} else {
|
||||||
|
"Personalized"
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
.expect("Failed to lookup images");
|
||||||
|
println!("Image signature: {sig:02X?}");
|
||||||
|
}
|
||||||
"unmount" => {
|
"unmount" => {
|
||||||
if product_version < 17 {
|
if product_version < 17 {
|
||||||
mounter_client
|
mounter_client
|
||||||
|
|||||||
Reference in New Issue
Block a user