From f0c93e321e5beae207671f5ba29f82cbe1110ea7 Mon Sep 17 00:00:00 2001 From: Jackson Coxson Date: Mon, 14 Jul 2025 15:29:18 -0600 Subject: [PATCH] Obfuscate more Apple strings --- idevice/src/lib.rs | 2 +- idevice/src/services/crashreportcopymobile.rs | 4 +++- idevice/src/services/debug_proxy.rs | 6 +++--- idevice/src/services/dvt/location_simulation.rs | 10 ++++++---- idevice/src/services/dvt/mod.rs | 6 +++--- idevice/src/services/dvt/process_control.rs | 8 ++++---- idevice/src/services/rsd.rs | 2 +- 7 files changed, 21 insertions(+), 17 deletions(-) diff --git a/idevice/src/lib.rs b/idevice/src/lib.rs index 57110cf..d63e8e5 100644 --- a/idevice/src/lib.rs +++ b/idevice/src/lib.rs @@ -67,7 +67,7 @@ pub trait IdeviceService: Sized { #[cfg(feature = "rsd")] pub trait RsdService: Sized { - fn rsd_service_name() -> &'static str; + fn rsd_service_name() -> std::borrow::Cow<'static, str>; fn from_stream( stream: Self::Stream, ) -> impl std::future::Future> + Send; diff --git a/idevice/src/services/crashreportcopymobile.rs b/idevice/src/services/crashreportcopymobile.rs index 79b7192..afc2b1f 100644 --- a/idevice/src/services/crashreportcopymobile.rs +++ b/idevice/src/services/crashreportcopymobile.rs @@ -162,7 +162,9 @@ pub async fn flush_reports( .start_session(&provider.get_pairing_file().await?) .await?; - let (port, ssl) = lockdown.start_service("com.apple.crashreportmover").await?; + let (port, ssl) = lockdown + .start_service(obf!("com.apple.crashreportmover")) + .await?; let mut idevice = provider.connect(port).await?; if ssl { diff --git a/idevice/src/services/debug_proxy.rs b/idevice/src/services/debug_proxy.rs index ee9c7a7..97f230b 100644 --- a/idevice/src/services/debug_proxy.rs +++ b/idevice/src/services/debug_proxy.rs @@ -8,11 +8,11 @@ use log::debug; use std::fmt::Write; use tokio::io::{AsyncReadExt, AsyncWriteExt}; -use crate::{IdeviceError, ReadWrite, RsdService}; +use crate::{obf, IdeviceError, ReadWrite, RsdService}; impl RsdService for DebugProxyClient { - fn rsd_service_name() -> &'static str { - "com.apple.internal.dt.remote.debugproxy" + fn rsd_service_name() -> std::borrow::Cow<'static, str> { + obf!("com.apple.internal.dt.remote.debugproxy") } async fn from_stream(stream: R) -> Result { diff --git a/idevice/src/services/dvt/location_simulation.rs b/idevice/src/services/dvt/location_simulation.rs index 7099c44..ecea710 100644 --- a/idevice/src/services/dvt/location_simulation.rs +++ b/idevice/src/services/dvt/location_simulation.rs @@ -41,11 +41,9 @@ use crate::{ message::AuxValue, remote_server::{Channel, RemoteServerClient}, }, - IdeviceError, ReadWrite, + obf, IdeviceError, ReadWrite, }; -const IDENTIFIER: &str = "com.apple.instruments.server.services.LocationSimulation"; - /// A client for the location simulation service pub struct LocationSimulationClient<'a, R: ReadWrite> { /// The underlying channel used for communication @@ -61,7 +59,11 @@ impl<'a, R: ReadWrite> LocationSimulationClient<'a, R> { /// # Returns /// The client on success, IdeviceError on failure pub async fn new(client: &'a mut RemoteServerClient) -> Result { - let channel = client.make_channel(IDENTIFIER).await?; // Drop `&mut client` before continuing + let channel = client + .make_channel(obf!( + "com.apple.instruments.server.services.LocationSimulation" + )) + .await?; // Drop `&mut client` before continuing Ok(Self { channel }) } diff --git a/idevice/src/services/dvt/mod.rs b/idevice/src/services/dvt/mod.rs index 5764ded..fced62f 100644 --- a/idevice/src/services/dvt/mod.rs +++ b/idevice/src/services/dvt/mod.rs @@ -1,6 +1,6 @@ // Jackson Coxson -use crate::{IdeviceError, ReadWrite, RsdService}; +use crate::{obf, IdeviceError, ReadWrite, RsdService}; #[cfg(feature = "location_simulation")] pub mod location_simulation; @@ -9,8 +9,8 @@ pub mod process_control; pub mod remote_server; impl RsdService for remote_server::RemoteServerClient { - fn rsd_service_name() -> &'static str { - "com.apple.instruments.dtservicehub" + fn rsd_service_name() -> std::borrow::Cow<'static, str> { + obf!("com.apple.instruments.dtservicehub") } async fn from_stream(stream: R) -> Result { diff --git a/idevice/src/services/dvt/process_control.rs b/idevice/src/services/dvt/process_control.rs index 0d36823..8ae7e15 100644 --- a/idevice/src/services/dvt/process_control.rs +++ b/idevice/src/services/dvt/process_control.rs @@ -37,12 +37,10 @@ use log::warn; use plist::{Dictionary, Value}; -use crate::{dvt::message::AuxValue, IdeviceError, ReadWrite}; +use crate::{dvt::message::AuxValue, obf, IdeviceError, ReadWrite}; use super::remote_server::{Channel, RemoteServerClient}; -const IDENTIFIER: &str = "com.apple.instruments.server.services.processcontrol"; - /// Client for process control operations on iOS devices /// /// Provides methods for launching, killing, and managing processes through the @@ -65,7 +63,9 @@ impl<'a, R: ReadWrite> ProcessControlClient<'a, R> { /// # Errors /// * Propagates errors from channel creation pub async fn new(client: &'a mut RemoteServerClient) -> Result { - let channel = client.make_channel(IDENTIFIER).await?; // Drop `&mut client` before continuing + let channel = client + .make_channel(obf!("com.apple.instruments.server.services.processcontrol")) + .await?; // Drop `&mut client` before continuing Ok(Self { channel }) } diff --git a/idevice/src/services/rsd.rs b/idevice/src/services/rsd.rs index 7073b44..3827d14 100644 --- a/idevice/src/services/rsd.rs +++ b/idevice/src/services/rsd.rs @@ -164,7 +164,7 @@ impl RsdHandshake { S: ReadWrite, { let service_name = T::rsd_service_name(); - let service = match self.services.get(service_name) { + let service = match self.services.get(&service_name.to_string()) { Some(s) => s, None => { return Err(IdeviceError::ServiceNotFound);