Correctly parse DDI image lookup result

This commit is contained in:
Jackson Coxson
2026-01-05 06:42:56 -07:00
parent 189dd5caf2
commit 96b380ebc9
2 changed files with 20 additions and 1 deletions

View File

@@ -90,7 +90,11 @@ impl ImageMounter {
self.idevice.send_plist(req).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()),
_ => Err(IdeviceError::NotFound),
}

View File

@@ -17,6 +17,10 @@ pub fn register() -> JkCommand {
"list",
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(
"unmount",
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));
}
}
"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" => {
if product_version < 17 {
mounter_client