diff --git a/idevice/src/services/mobile_image_mounter.rs b/idevice/src/services/mobile_image_mounter.rs index bb4c18b..1c2f1d1 100644 --- a/idevice/src/services/mobile_image_mounter.rs +++ b/idevice/src/services/mobile_image_mounter.rs @@ -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), } diff --git a/tools/src/mounter.rs b/tools/src/mounter.rs index 4674294..90e9ebc 100644 --- a/tools/src/mounter.rs +++ b/tools/src/mounter.rs @@ -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 { + 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