mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-03-02 14:36:16 +01:00
Cargo fmt check during CI
This commit is contained in:
@@ -4,19 +4,19 @@
|
||||
use std::str::FromStr;
|
||||
|
||||
use rsa::{
|
||||
RsaPrivateKey, RsaPublicKey,
|
||||
pkcs1::DecodeRsaPublicKey,
|
||||
pkcs1v15::SigningKey,
|
||||
pkcs8::{EncodePrivateKey, LineEnding, SubjectPublicKeyInfo},
|
||||
RsaPrivateKey, RsaPublicKey,
|
||||
};
|
||||
use sha2::Sha256;
|
||||
use x509_cert::{
|
||||
Certificate,
|
||||
builder::{Builder, CertificateBuilder, Profile},
|
||||
der::EncodePem,
|
||||
name::Name,
|
||||
serial_number::SerialNumber,
|
||||
time::Validity,
|
||||
Certificate,
|
||||
};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
|
||||
@@ -7,7 +7,7 @@ use std::path::Path;
|
||||
|
||||
use log::warn;
|
||||
use plist::Data;
|
||||
use rustls::pki_types::{pem::PemObject, CertificateDer};
|
||||
use rustls::pki_types::{CertificateDer, pem::PemObject};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Represents a complete iOS device pairing record
|
||||
|
||||
@@ -8,7 +8,7 @@ use std::{future::Future, pin::Pin};
|
||||
#[cfg(feature = "tcp")]
|
||||
use tokio::net::TcpStream;
|
||||
|
||||
use crate::{pairing_file::PairingFile, Idevice, IdeviceError, ReadWrite};
|
||||
use crate::{Idevice, IdeviceError, ReadWrite, pairing_file::PairingFile};
|
||||
|
||||
#[cfg(feature = "usbmuxd")]
|
||||
use crate::usbmuxd::UsbmuxdAddr;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
use plist::Dictionary;
|
||||
|
||||
use crate::{obf, Idevice, IdeviceError, IdeviceService};
|
||||
use crate::{Idevice, IdeviceError, IdeviceService, obf};
|
||||
|
||||
/// Client for interacting with the AMFI service on the device
|
||||
pub struct AmfiClient {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
//! # Features
|
||||
//! - `tunnel_tcp_stack`: Enables software TCP/IP tunnel creation using a virtual adapter. See the tcp moduel.
|
||||
|
||||
use crate::{obf, Idevice, IdeviceError, IdeviceService};
|
||||
use crate::{Idevice, IdeviceError, IdeviceService, obf};
|
||||
|
||||
use byteorder::{BigEndian, WriteBytesExt};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
use log::{debug, warn};
|
||||
|
||||
use crate::{afc::AfcClient, lockdown::LockdownClient, obf, Idevice, IdeviceError, IdeviceService};
|
||||
use crate::{Idevice, IdeviceError, IdeviceService, afc::AfcClient, lockdown::LockdownClient, obf};
|
||||
|
||||
/// Client for managing crash logs on an iOS device.
|
||||
///
|
||||
|
||||
@@ -8,7 +8,7 @@ use log::debug;
|
||||
use std::fmt::Write;
|
||||
use tokio::io::{AsyncReadExt, AsyncWriteExt};
|
||||
|
||||
use crate::{obf, IdeviceError, ReadWrite, RsdService};
|
||||
use crate::{IdeviceError, ReadWrite, RsdService, obf};
|
||||
|
||||
impl RsdService for DebugProxyClient<Box<dyn ReadWrite>> {
|
||||
fn rsd_service_name() -> std::borrow::Cow<'static, str> {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//! Diagnostics Relay
|
||||
|
||||
use crate::{obf, Idevice, IdeviceError, IdeviceService};
|
||||
use crate::{Idevice, IdeviceError, IdeviceService, obf};
|
||||
|
||||
/// Client for interacting with the Diagnostics Relay
|
||||
pub struct DiagnosticsRelayClient {
|
||||
@@ -74,7 +74,6 @@ impl DiagnosticsRelayClient {
|
||||
.and_then(|x| x.into_dictionary())
|
||||
.and_then(|mut x| x.remove("IORegistry"))
|
||||
.and_then(|x| x.into_dictionary());
|
||||
|
||||
|
||||
Ok(res)
|
||||
}
|
||||
@@ -92,7 +91,7 @@ impl DiagnosticsRelayClient {
|
||||
) -> Result<Option<plist::Dictionary>, IdeviceError> {
|
||||
let mut req = plist::Dictionary::new();
|
||||
req.insert("Request".into(), "MobileGestalt".into());
|
||||
|
||||
|
||||
if let Some(keys) = keys {
|
||||
let keys_array: Vec<plist::Value> = keys.into_iter().map(|k| k.into()).collect();
|
||||
req.insert("MobileGestaltKeys".into(), plist::Value::Array(keys_array));
|
||||
@@ -110,9 +109,7 @@ impl DiagnosticsRelayClient {
|
||||
}
|
||||
}
|
||||
|
||||
let res = res
|
||||
.remove("Diagnostics")
|
||||
.and_then(|x| x.into_dictionary());
|
||||
let res = res.remove("Diagnostics").and_then(|x| x.into_dictionary());
|
||||
|
||||
Ok(res)
|
||||
}
|
||||
@@ -137,9 +134,7 @@ impl DiagnosticsRelayClient {
|
||||
}
|
||||
}
|
||||
|
||||
let res = res
|
||||
.remove("Diagnostics")
|
||||
.and_then(|x| x.into_dictionary());
|
||||
let res = res.remove("Diagnostics").and_then(|x| x.into_dictionary());
|
||||
|
||||
Ok(res)
|
||||
}
|
||||
@@ -164,9 +159,7 @@ impl DiagnosticsRelayClient {
|
||||
}
|
||||
}
|
||||
|
||||
let res = res
|
||||
.remove("Diagnostics")
|
||||
.and_then(|x| x.into_dictionary());
|
||||
let res = res.remove("Diagnostics").and_then(|x| x.into_dictionary());
|
||||
|
||||
Ok(res)
|
||||
}
|
||||
@@ -191,9 +184,7 @@ impl DiagnosticsRelayClient {
|
||||
}
|
||||
}
|
||||
|
||||
let res = res
|
||||
.remove("Diagnostics")
|
||||
.and_then(|x| x.into_dictionary());
|
||||
let res = res.remove("Diagnostics").and_then(|x| x.into_dictionary());
|
||||
|
||||
Ok(res)
|
||||
}
|
||||
@@ -272,9 +263,7 @@ impl DiagnosticsRelayClient {
|
||||
}
|
||||
}
|
||||
|
||||
let res = res
|
||||
.remove("Diagnostics")
|
||||
.and_then(|x| x.into_dictionary());
|
||||
let res = res.remove("Diagnostics").and_then(|x| x.into_dictionary());
|
||||
|
||||
Ok(res)
|
||||
}
|
||||
@@ -293,4 +282,4 @@ impl DiagnosticsRelayClient {
|
||||
_ => Err(IdeviceError::UnexpectedResponse),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,11 +37,12 @@
|
||||
use plist::Value;
|
||||
|
||||
use crate::{
|
||||
IdeviceError, ReadWrite,
|
||||
dvt::{
|
||||
message::AuxValue,
|
||||
remote_server::{Channel, RemoteServerClient},
|
||||
},
|
||||
obf, IdeviceError, ReadWrite,
|
||||
obf,
|
||||
};
|
||||
|
||||
/// A client for the location simulation service
|
||||
|
||||
@@ -278,9 +278,9 @@ impl Aux {
|
||||
let mut res = Vec::new();
|
||||
let buffer_size = 496_u32;
|
||||
res.extend_from_slice(&buffer_size.to_le_bytes()); // TODO: find what
|
||||
// this means and how to actually serialize it
|
||||
// go-ios just uses 496
|
||||
// pymobiledevice3 doesn't seem to parse the header at all
|
||||
// this means and how to actually serialize it
|
||||
// go-ios just uses 496
|
||||
// pymobiledevice3 doesn't seem to parse the header at all
|
||||
res.extend_from_slice(&0_u32.to_le_bytes());
|
||||
res.extend_from_slice(&(values_payload.len() as u32).to_le_bytes());
|
||||
res.extend_from_slice(&0_u32.to_le_bytes());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Jackson Coxson
|
||||
|
||||
use crate::{obf, IdeviceError, ReadWrite, RsdService};
|
||||
use crate::{IdeviceError, ReadWrite, RsdService, obf};
|
||||
|
||||
#[cfg(feature = "location_simulation")]
|
||||
pub mod location_simulation;
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
use log::warn;
|
||||
use plist::{Dictionary, Value};
|
||||
|
||||
use crate::{dvt::message::AuxValue, obf, IdeviceError, ReadWrite};
|
||||
use crate::{IdeviceError, ReadWrite, dvt::message::AuxValue, obf};
|
||||
|
||||
use super::remote_server::{Channel, RemoteServerClient};
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//! iOS automatically closes service connections if there is no heartbeat client connected and
|
||||
//! responding.
|
||||
|
||||
use crate::{obf, Idevice, IdeviceError, IdeviceService};
|
||||
use crate::{Idevice, IdeviceError, IdeviceService, obf};
|
||||
|
||||
/// Client for interacting with the iOS device heartbeat service
|
||||
///
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
use plist::{Dictionary, Value};
|
||||
|
||||
use crate::{obf, Idevice, IdeviceError, IdeviceService};
|
||||
use crate::{Idevice, IdeviceError, IdeviceService, obf};
|
||||
|
||||
use super::afc::AfcClient;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ use log::error;
|
||||
use plist::Value;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{obf, pairing_file, Idevice, IdeviceError, IdeviceService};
|
||||
use crate::{Idevice, IdeviceError, IdeviceService, obf, pairing_file};
|
||||
|
||||
/// Client for interacting with the iOS lockdown service
|
||||
///
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
use log::warn;
|
||||
use plist::Dictionary;
|
||||
|
||||
use crate::{obf, Idevice, IdeviceError, IdeviceService, RsdService};
|
||||
use crate::{Idevice, IdeviceError, IdeviceService, RsdService, obf};
|
||||
|
||||
/// Client for interacting with the iOS misagent service
|
||||
///
|
||||
|
||||
@@ -1300,4 +1300,3 @@ impl MobileBackup2Client {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ use chrono::{DateTime, NaiveDateTime};
|
||||
use plist::Dictionary;
|
||||
use tokio::io::AsyncWriteExt;
|
||||
|
||||
use crate::{obf, Idevice, IdeviceError, IdeviceService};
|
||||
use crate::{Idevice, IdeviceError, IdeviceService, obf};
|
||||
|
||||
/// Client for interacting with the iOS device OsTraceRelay service
|
||||
pub struct OsTraceRelayClient {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
use log::warn;
|
||||
use plist::Dictionary;
|
||||
|
||||
use crate::{obf, IdeviceError, ReadWrite, RemoteXpcClient, RsdService};
|
||||
use crate::{IdeviceError, ReadWrite, RemoteXpcClient, RsdService, obf};
|
||||
|
||||
/// Client for interacting with the Restore Service
|
||||
pub struct RestoreServiceClient {
|
||||
|
||||
@@ -6,7 +6,7 @@ use std::collections::HashMap;
|
||||
use log::warn;
|
||||
use serde::Deserialize;
|
||||
|
||||
use crate::{provider::RsdProvider, IdeviceError, ReadWrite, RemoteXpcClient};
|
||||
use crate::{IdeviceError, ReadWrite, RemoteXpcClient, provider::RsdProvider};
|
||||
|
||||
/// Describes an available XPC service
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//! Provides functionality for interacting with the SpringBoard services on iOS devices,
|
||||
//! which manages home screen and app icon related operations.
|
||||
|
||||
use crate::{obf, Idevice, IdeviceError, IdeviceService};
|
||||
use crate::{Idevice, IdeviceError, IdeviceService, obf};
|
||||
|
||||
/// Client for interacting with the iOS SpringBoard services
|
||||
///
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//! iOS Device SyslogRelay Service Abstraction
|
||||
|
||||
use crate::{obf, Idevice, IdeviceError, IdeviceService};
|
||||
use crate::{Idevice, IdeviceError, IdeviceService, obf};
|
||||
|
||||
/// Client for interacting with the iOS device SyslogRelay service
|
||||
pub struct SyslogRelayClient {
|
||||
|
||||
@@ -7,16 +7,16 @@
|
||||
// Assuming that there's no use for unchecked certs is naive.
|
||||
|
||||
use rustls::{
|
||||
client::{
|
||||
danger::{HandshakeSignatureValid, ServerCertVerified, ServerCertVerifier},
|
||||
WebPkiServerVerifier,
|
||||
},
|
||||
pki_types::{pem::PemObject, CertificateDer, PrivateKeyDer, ServerName, UnixTime},
|
||||
ClientConfig, DigitallySignedStruct,
|
||||
client::{
|
||||
WebPkiServerVerifier,
|
||||
danger::{HandshakeSignatureValid, ServerCertVerified, ServerCertVerifier},
|
||||
},
|
||||
pki_types::{CertificateDer, PrivateKeyDer, ServerName, UnixTime, pem::PemObject},
|
||||
};
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::{pairing_file::PairingFile, IdeviceError};
|
||||
use crate::{IdeviceError, pairing_file::PairingFile};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct NoServerNameVerification {
|
||||
|
||||
@@ -206,7 +206,7 @@ impl Adapter {
|
||||
break;
|
||||
}
|
||||
ConnectionStatus::Error(e) => {
|
||||
return Err(std::io::Error::new(e, "failed to connect"))
|
||||
return Err(std::io::Error::new(e, "failed to connect"));
|
||||
}
|
||||
ConnectionStatus::WaitingForSyn => {
|
||||
continue;
|
||||
@@ -236,7 +236,7 @@ impl Adapter {
|
||||
file.write_all(&0_i32.to_le_bytes()).await?; // timezone
|
||||
file.write_all(&0_u32.to_le_bytes()).await?; // accuracy
|
||||
file.write_all(&(u16::MAX as u32).to_le_bytes()).await?; // snaplen
|
||||
// https://www.tcpdump.org/linktypes.html
|
||||
// https://www.tcpdump.org/linktypes.html
|
||||
file.write_all(&101_u32.to_le_bytes()).await?; // link type
|
||||
|
||||
self.pcap = Some(Arc::new(Mutex::new(file)));
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
use std::{collections::HashMap, path::PathBuf, sync::Mutex, task::Poll};
|
||||
|
||||
use crossfire::{mpsc, spsc, stream::AsyncStream, AsyncRx, MTx, Tx};
|
||||
use futures::{stream::FuturesUnordered, StreamExt};
|
||||
use crossfire::{AsyncRx, MTx, Tx, mpsc, spsc, stream::AsyncStream};
|
||||
use futures::{StreamExt, stream::FuturesUnordered};
|
||||
use log::trace;
|
||||
use tokio::{
|
||||
io::{AsyncRead, AsyncWrite},
|
||||
@@ -309,7 +309,7 @@ impl AsyncWrite for StreamHandle {
|
||||
return Poll::Ready(Err(std::io::Error::new(
|
||||
std::io::ErrorKind::BrokenPipe,
|
||||
"channel closed",
|
||||
)))
|
||||
)));
|
||||
}
|
||||
None => break, // nothing pending
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ use std::{
|
||||
use log::debug;
|
||||
use tokio::io::AsyncWriteExt;
|
||||
|
||||
use crate::{provider::RsdProvider, ReadWrite};
|
||||
use crate::{ReadWrite, provider::RsdProvider};
|
||||
|
||||
pub mod adapter;
|
||||
pub mod handle;
|
||||
|
||||
@@ -106,4 +106,3 @@ mod tests {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ use log::{debug, warn};
|
||||
use tokio::io::{AsyncReadExt, AsyncWriteExt};
|
||||
|
||||
use crate::{
|
||||
pairing_file::PairingFile, provider::UsbmuxdProvider, Idevice, IdeviceError, ReadWrite,
|
||||
Idevice, IdeviceError, ReadWrite, pairing_file::PairingFile, provider::UsbmuxdProvider,
|
||||
};
|
||||
|
||||
mod des;
|
||||
|
||||
Reference in New Issue
Block a user