mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-03-02 14:36:16 +01:00
Replace static str with borrowed cow for service names
This commit is contained in:
@@ -54,7 +54,7 @@ impl<T: AsyncRead + AsyncWrite + Unpin + Send + Sync + std::fmt::Debug> ReadWrit
|
||||
/// device connection protocol.
|
||||
pub trait IdeviceService: Sized {
|
||||
/// Returns the service name as advertised by the device
|
||||
fn service_name() -> &'static str;
|
||||
fn service_name() -> std::borrow::Cow<'static, str>;
|
||||
|
||||
/// Establishes a connection to this service
|
||||
///
|
||||
|
||||
@@ -61,7 +61,7 @@ pub struct DeviceInfo {
|
||||
}
|
||||
|
||||
impl IdeviceService for AfcClient {
|
||||
fn service_name() -> &'static str {
|
||||
fn service_name() -> std::borrow::Cow<'static, str> {
|
||||
obf!("com.apple.afc")
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ pub struct AmfiClient {
|
||||
|
||||
impl IdeviceService for AmfiClient {
|
||||
/// Returns the amfi service name as registered with lockdownd
|
||||
fn service_name() -> &'static str {
|
||||
fn service_name() -> std::borrow::Cow<'static, str> {
|
||||
obf!("com.apple.amfi.lockdown")
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ pub struct CoreDeviceProxy {
|
||||
|
||||
impl IdeviceService for CoreDeviceProxy {
|
||||
/// Returns the name of the service used for launching the CoreDeviceProxy.
|
||||
fn service_name() -> &'static str {
|
||||
fn service_name() -> std::borrow::Cow<'static, str> {
|
||||
obf!("com.apple.internal.devicecompute.CoreDeviceProxy")
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ pub struct CrashReportCopyMobileClient {
|
||||
|
||||
impl IdeviceService for CrashReportCopyMobileClient {
|
||||
/// Returns the name of the CrashReportCopyMobile service.
|
||||
fn service_name() -> &'static str {
|
||||
fn service_name() -> std::borrow::Cow<'static, str> {
|
||||
obf!("com.apple.crashreportcopymobile")
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ pub struct HeartbeatClient {
|
||||
|
||||
impl IdeviceService for HeartbeatClient {
|
||||
/// Returns the heartbeat service name as registered with lockdownd
|
||||
fn service_name() -> &'static str {
|
||||
fn service_name() -> std::borrow::Cow<'static, str> {
|
||||
obf!("com.apple.mobile.heartbeat")
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ pub struct HouseArrestClient {
|
||||
|
||||
impl IdeviceService for HouseArrestClient {
|
||||
/// Returns the name of the HouseArrest service as registered with lockdownd
|
||||
fn service_name() -> &'static str {
|
||||
fn service_name() -> std::borrow::Cow<'static, str> {
|
||||
obf!("com.apple.mobile.house_arrest")
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ pub struct InstallationProxyClient {
|
||||
|
||||
impl IdeviceService for InstallationProxyClient {
|
||||
/// Returns the installation proxy service name as registered with lockdownd
|
||||
fn service_name() -> &'static str {
|
||||
fn service_name() -> std::borrow::Cow<'static, str> {
|
||||
obf!("com.apple.mobile.installation_proxy")
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ pub struct LockdownClient {
|
||||
|
||||
impl IdeviceService for LockdownClient {
|
||||
/// Returns the lockdown service name as registered with the device
|
||||
fn service_name() -> &'static str {
|
||||
fn service_name() -> std::borrow::Cow<'static, str> {
|
||||
obf!("com.apple.mobile.lockdown")
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ pub struct MisagentClient {
|
||||
|
||||
impl IdeviceService for MisagentClient {
|
||||
/// Returns the misagent service name as registered with lockdownd
|
||||
fn service_name() -> &'static str {
|
||||
fn service_name() -> std::borrow::Cow<'static, str> {
|
||||
obf!("com.apple.misagent")
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ pub struct ImageMounter {
|
||||
|
||||
impl IdeviceService for ImageMounter {
|
||||
/// Returns the image mounter service name as registered with lockdownd
|
||||
fn service_name() -> &'static str {
|
||||
fn service_name() -> std::borrow::Cow<'static, str> {
|
||||
obf!("com.apple.mobile.mobile_image_mounter")
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ pub struct OsTraceRelayClient {
|
||||
|
||||
impl IdeviceService for OsTraceRelayClient {
|
||||
/// Returns the OsTraceRelay service name as registered with lockdownd
|
||||
fn service_name() -> &'static str {
|
||||
fn service_name() -> std::borrow::Cow<'static, str> {
|
||||
obf!("com.apple.os_trace_relay")
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ pub struct SpringBoardServicesClient {
|
||||
|
||||
impl IdeviceService for SpringBoardServicesClient {
|
||||
/// Returns the SpringBoard services name as registered with lockdownd
|
||||
fn service_name() -> &'static str {
|
||||
fn service_name() -> std::borrow::Cow<'static, str> {
|
||||
obf!("com.apple.springboardservices")
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ pub struct SyslogRelayClient {
|
||||
|
||||
impl IdeviceService for SyslogRelayClient {
|
||||
/// Returns the SyslogRelay service name as registered with lockdownd
|
||||
fn service_name() -> &'static str {
|
||||
fn service_name() -> std::borrow::Cow<'static, str> {
|
||||
obf!("com.apple.syslog_relay")
|
||||
}
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ macro_rules! obf {
|
||||
($lit:literal) => {{
|
||||
#[cfg(feature = "obfuscate")]
|
||||
{
|
||||
obfstr::xref!($lit)
|
||||
std::borrow::Cow::Owned(obfstr::obfstr!($lit).to_string())
|
||||
}
|
||||
#[cfg(not(feature = "obfuscate"))]
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user