From 38a3a558b5f7420475e55ba077ef0977a2de6c3b Mon Sep 17 00:00:00 2001 From: Jackson Coxson Date: Fri, 6 Feb 2026 16:45:27 -0700 Subject: [PATCH] (BREAKING) implement host name parameter for lockdown pair --- idevice/src/services/lockdown.rs | 2 ++ tools/src/pair.rs | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/idevice/src/services/lockdown.rs b/idevice/src/services/lockdown.rs index 34d88b9..df147e4 100644 --- a/idevice/src/services/lockdown.rs +++ b/idevice/src/services/lockdown.rs @@ -260,6 +260,7 @@ impl LockdownClient { &mut self, host_id: impl Into, system_buid: impl Into, + host_name: Option<&str>, ) -> Result { let host_id = host_id.into(); let system_buid = system_buid.into(); @@ -297,6 +298,7 @@ impl LockdownClient { let req = crate::plist!({ "Label": self.idevice.label.clone(), "Request": "Pair", + "HostName":? host_name, "PairRecord": pair_record.clone(), "ProtocolVersion": "2", "PairingOptions": { diff --git a/tools/src/pair.rs b/tools/src/pair.rs index 1cfc23d..fd5ec29 100644 --- a/tools/src/pair.rs +++ b/tools/src/pair.rs @@ -6,12 +6,18 @@ use idevice::{ provider::IdeviceProvider, usbmuxd::{Connection, UsbmuxdAddr, UsbmuxdConnection}, }; -use jkcli::{CollectedArguments, JkArgument, JkCommand}; +use jkcli::{CollectedArguments, JkArgument, JkCommand, JkFlag}; pub fn register() -> JkCommand { JkCommand::new() .help("Manage files in the AFC jail of a device") .with_argument(JkArgument::new().with_help("A UDID to override and pair with")) + .with_flag( + JkFlag::new("name") + .with_help("The host name to report to the device") + .with_argument(JkArgument::new().required(true)) + .with_short("n"), + ) } pub async fn main(arguments: &CollectedArguments, _provider: Box) { @@ -45,8 +51,11 @@ pub async fn main(arguments: &CollectedArguments, _provider: Box("name"); + let name = name.as_deref(); + let mut pairing_file = lockdown_client - .pair(id, u.get_buid().await.unwrap()) + .pair(id, u.get_buid().await.unwrap(), name) .await .expect("Failed to pair");