Cargo fmt check during CI

This commit is contained in:
Jackson Coxson
2025-08-13 08:06:58 -06:00
parent 876e88d6fb
commit 4fca58a2f3
29 changed files with 46 additions and 57 deletions

View File

@@ -4,19 +4,19 @@
use std::str::FromStr; use std::str::FromStr;
use rsa::{ use rsa::{
RsaPrivateKey, RsaPublicKey,
pkcs1::DecodeRsaPublicKey, pkcs1::DecodeRsaPublicKey,
pkcs1v15::SigningKey, pkcs1v15::SigningKey,
pkcs8::{EncodePrivateKey, LineEnding, SubjectPublicKeyInfo}, pkcs8::{EncodePrivateKey, LineEnding, SubjectPublicKeyInfo},
RsaPrivateKey, RsaPublicKey,
}; };
use sha2::Sha256; use sha2::Sha256;
use x509_cert::{ use x509_cert::{
Certificate,
builder::{Builder, CertificateBuilder, Profile}, builder::{Builder, CertificateBuilder, Profile},
der::EncodePem, der::EncodePem,
name::Name, name::Name,
serial_number::SerialNumber, serial_number::SerialNumber,
time::Validity, time::Validity,
Certificate,
}; };
#[derive(Clone, Debug)] #[derive(Clone, Debug)]

View File

@@ -7,7 +7,7 @@ use std::path::Path;
use log::warn; use log::warn;
use plist::Data; use plist::Data;
use rustls::pki_types::{pem::PemObject, CertificateDer}; use rustls::pki_types::{CertificateDer, pem::PemObject};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
/// Represents a complete iOS device pairing record /// Represents a complete iOS device pairing record

View File

@@ -8,7 +8,7 @@ use std::{future::Future, pin::Pin};
#[cfg(feature = "tcp")] #[cfg(feature = "tcp")]
use tokio::net::TcpStream; use tokio::net::TcpStream;
use crate::{pairing_file::PairingFile, Idevice, IdeviceError, ReadWrite}; use crate::{Idevice, IdeviceError, ReadWrite, pairing_file::PairingFile};
#[cfg(feature = "usbmuxd")] #[cfg(feature = "usbmuxd")]
use crate::usbmuxd::UsbmuxdAddr; use crate::usbmuxd::UsbmuxdAddr;

View File

@@ -2,7 +2,7 @@
use plist::Dictionary; 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 /// Client for interacting with the AMFI service on the device
pub struct AmfiClient { pub struct AmfiClient {

View File

@@ -13,7 +13,7 @@
//! # Features //! # Features
//! - `tunnel_tcp_stack`: Enables software TCP/IP tunnel creation using a virtual adapter. See the tcp moduel. //! - `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 byteorder::{BigEndian, WriteBytesExt};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};

View File

@@ -9,7 +9,7 @@
use log::{debug, warn}; 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. /// Client for managing crash logs on an iOS device.
/// ///

View File

@@ -8,7 +8,7 @@ use log::debug;
use std::fmt::Write; use std::fmt::Write;
use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio::io::{AsyncReadExt, AsyncWriteExt};
use crate::{obf, IdeviceError, ReadWrite, RsdService}; use crate::{IdeviceError, ReadWrite, RsdService, obf};
impl RsdService for DebugProxyClient<Box<dyn ReadWrite>> { impl RsdService for DebugProxyClient<Box<dyn ReadWrite>> {
fn rsd_service_name() -> std::borrow::Cow<'static, str> { fn rsd_service_name() -> std::borrow::Cow<'static, str> {

View File

@@ -1,6 +1,6 @@
//! Diagnostics Relay //! Diagnostics Relay
use crate::{obf, Idevice, IdeviceError, IdeviceService}; use crate::{Idevice, IdeviceError, IdeviceService, obf};
/// Client for interacting with the Diagnostics Relay /// Client for interacting with the Diagnostics Relay
pub struct DiagnosticsRelayClient { pub struct DiagnosticsRelayClient {
@@ -75,7 +75,6 @@ impl DiagnosticsRelayClient {
.and_then(|mut x| x.remove("IORegistry")) .and_then(|mut x| x.remove("IORegistry"))
.and_then(|x| x.into_dictionary()); .and_then(|x| x.into_dictionary());
Ok(res) Ok(res)
} }
@@ -110,9 +109,7 @@ impl DiagnosticsRelayClient {
} }
} }
let res = res let res = res.remove("Diagnostics").and_then(|x| x.into_dictionary());
.remove("Diagnostics")
.and_then(|x| x.into_dictionary());
Ok(res) Ok(res)
} }
@@ -137,9 +134,7 @@ impl DiagnosticsRelayClient {
} }
} }
let res = res let res = res.remove("Diagnostics").and_then(|x| x.into_dictionary());
.remove("Diagnostics")
.and_then(|x| x.into_dictionary());
Ok(res) Ok(res)
} }
@@ -164,9 +159,7 @@ impl DiagnosticsRelayClient {
} }
} }
let res = res let res = res.remove("Diagnostics").and_then(|x| x.into_dictionary());
.remove("Diagnostics")
.and_then(|x| x.into_dictionary());
Ok(res) Ok(res)
} }
@@ -191,9 +184,7 @@ impl DiagnosticsRelayClient {
} }
} }
let res = res let res = res.remove("Diagnostics").and_then(|x| x.into_dictionary());
.remove("Diagnostics")
.and_then(|x| x.into_dictionary());
Ok(res) Ok(res)
} }
@@ -272,9 +263,7 @@ impl DiagnosticsRelayClient {
} }
} }
let res = res let res = res.remove("Diagnostics").and_then(|x| x.into_dictionary());
.remove("Diagnostics")
.and_then(|x| x.into_dictionary());
Ok(res) Ok(res)
} }

View File

@@ -37,11 +37,12 @@
use plist::Value; use plist::Value;
use crate::{ use crate::{
IdeviceError, ReadWrite,
dvt::{ dvt::{
message::AuxValue, message::AuxValue,
remote_server::{Channel, RemoteServerClient}, remote_server::{Channel, RemoteServerClient},
}, },
obf, IdeviceError, ReadWrite, obf,
}; };
/// A client for the location simulation service /// A client for the location simulation service

View File

@@ -1,6 +1,6 @@
// Jackson Coxson // Jackson Coxson
use crate::{obf, IdeviceError, ReadWrite, RsdService}; use crate::{IdeviceError, ReadWrite, RsdService, obf};
#[cfg(feature = "location_simulation")] #[cfg(feature = "location_simulation")]
pub mod location_simulation; pub mod location_simulation;

View File

@@ -37,7 +37,7 @@
use log::warn; use log::warn;
use plist::{Dictionary, Value}; 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}; use super::remote_server::{Channel, RemoteServerClient};

View File

@@ -3,7 +3,7 @@
//! iOS automatically closes service connections if there is no heartbeat client connected and //! iOS automatically closes service connections if there is no heartbeat client connected and
//! responding. //! responding.
use crate::{obf, Idevice, IdeviceError, IdeviceService}; use crate::{Idevice, IdeviceError, IdeviceService, obf};
/// Client for interacting with the iOS device heartbeat service /// Client for interacting with the iOS device heartbeat service
/// ///

View File

@@ -6,7 +6,7 @@
use plist::{Dictionary, Value}; use plist::{Dictionary, Value};
use crate::{obf, Idevice, IdeviceError, IdeviceService}; use crate::{Idevice, IdeviceError, IdeviceService, obf};
use super::afc::AfcClient; use super::afc::AfcClient;

View File

@@ -7,7 +7,7 @@ use log::error;
use plist::Value; use plist::Value;
use serde::{Deserialize, Serialize}; 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 /// Client for interacting with the iOS lockdown service
/// ///

View File

@@ -6,7 +6,7 @@
use log::warn; use log::warn;
use plist::Dictionary; 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 /// Client for interacting with the iOS misagent service
/// ///

View File

@@ -1300,4 +1300,3 @@ impl MobileBackup2Client {
Ok(()) Ok(())
} }
} }

View File

@@ -7,7 +7,7 @@ use chrono::{DateTime, NaiveDateTime};
use plist::Dictionary; use plist::Dictionary;
use tokio::io::AsyncWriteExt; 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 /// Client for interacting with the iOS device OsTraceRelay service
pub struct OsTraceRelayClient { pub struct OsTraceRelayClient {

View File

@@ -3,7 +3,7 @@
use log::warn; use log::warn;
use plist::Dictionary; use plist::Dictionary;
use crate::{obf, IdeviceError, ReadWrite, RemoteXpcClient, RsdService}; use crate::{IdeviceError, ReadWrite, RemoteXpcClient, RsdService, obf};
/// Client for interacting with the Restore Service /// Client for interacting with the Restore Service
pub struct RestoreServiceClient { pub struct RestoreServiceClient {

View File

@@ -6,7 +6,7 @@ use std::collections::HashMap;
use log::warn; use log::warn;
use serde::Deserialize; use serde::Deserialize;
use crate::{provider::RsdProvider, IdeviceError, ReadWrite, RemoteXpcClient}; use crate::{IdeviceError, ReadWrite, RemoteXpcClient, provider::RsdProvider};
/// Describes an available XPC service /// Describes an available XPC service
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Deserialize)]

View File

@@ -3,7 +3,7 @@
//! Provides functionality for interacting with the SpringBoard services on iOS devices, //! Provides functionality for interacting with the SpringBoard services on iOS devices,
//! which manages home screen and app icon related operations. //! 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 /// Client for interacting with the iOS SpringBoard services
/// ///

View File

@@ -1,6 +1,6 @@
//! iOS Device SyslogRelay Service Abstraction //! 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 /// Client for interacting with the iOS device SyslogRelay service
pub struct SyslogRelayClient { pub struct SyslogRelayClient {

View File

@@ -7,16 +7,16 @@
// Assuming that there's no use for unchecked certs is naive. // Assuming that there's no use for unchecked certs is naive.
use rustls::{ use rustls::{
client::{
danger::{HandshakeSignatureValid, ServerCertVerified, ServerCertVerifier},
WebPkiServerVerifier,
},
pki_types::{pem::PemObject, CertificateDer, PrivateKeyDer, ServerName, UnixTime},
ClientConfig, DigitallySignedStruct, ClientConfig, DigitallySignedStruct,
client::{
WebPkiServerVerifier,
danger::{HandshakeSignatureValid, ServerCertVerified, ServerCertVerifier},
},
pki_types::{CertificateDer, PrivateKeyDer, ServerName, UnixTime, pem::PemObject},
}; };
use std::sync::Arc; use std::sync::Arc;
use crate::{pairing_file::PairingFile, IdeviceError}; use crate::{IdeviceError, pairing_file::PairingFile};
#[derive(Debug)] #[derive(Debug)]
pub struct NoServerNameVerification { pub struct NoServerNameVerification {

View File

@@ -206,7 +206,7 @@ impl Adapter {
break; break;
} }
ConnectionStatus::Error(e) => { 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 => { ConnectionStatus::WaitingForSyn => {
continue; continue;

View File

@@ -6,8 +6,8 @@
use std::{collections::HashMap, path::PathBuf, sync::Mutex, task::Poll}; use std::{collections::HashMap, path::PathBuf, sync::Mutex, task::Poll};
use crossfire::{mpsc, spsc, stream::AsyncStream, AsyncRx, MTx, Tx}; use crossfire::{AsyncRx, MTx, Tx, mpsc, spsc, stream::AsyncStream};
use futures::{stream::FuturesUnordered, StreamExt}; use futures::{StreamExt, stream::FuturesUnordered};
use log::trace; use log::trace;
use tokio::{ use tokio::{
io::{AsyncRead, AsyncWrite}, io::{AsyncRead, AsyncWrite},
@@ -309,7 +309,7 @@ impl AsyncWrite for StreamHandle {
return Poll::Ready(Err(std::io::Error::new( return Poll::Ready(Err(std::io::Error::new(
std::io::ErrorKind::BrokenPipe, std::io::ErrorKind::BrokenPipe,
"channel closed", "channel closed",
))) )));
} }
None => break, // nothing pending None => break, // nothing pending
} }

View File

@@ -8,7 +8,7 @@ use std::{
use log::debug; use log::debug;
use tokio::io::AsyncWriteExt; use tokio::io::AsyncWriteExt;
use crate::{provider::RsdProvider, ReadWrite}; use crate::{ReadWrite, provider::RsdProvider};
pub mod adapter; pub mod adapter;
pub mod handle; pub mod handle;

View File

@@ -106,4 +106,3 @@ mod tests {
} }
} }
} }

View File

@@ -15,7 +15,7 @@ use log::{debug, warn};
use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio::io::{AsyncReadExt, AsyncWriteExt};
use crate::{ use crate::{
pairing_file::PairingFile, provider::UsbmuxdProvider, Idevice, IdeviceError, ReadWrite, Idevice, IdeviceError, ReadWrite, pairing_file::PairingFile, provider::UsbmuxdProvider,
}; };
mod des; mod des;

View File

@@ -5,6 +5,7 @@ check-features:
ci-check: build-ffi-native build-tools-native build-cpp build-c ci-check: build-ffi-native build-tools-native build-cpp build-c
cargo clippy --all-targets --all-features -- -D warnings cargo clippy --all-targets --all-features -- -D warnings
cargo fmt -- --check
macos-ci-check: ci-check xcframework macos-ci-check: ci-check xcframework
cd tools && cargo build --release --target x86_64-apple-darwin cd tools && cargo build --release --target x86_64-apple-darwin
windows-ci-check: build-ffi-native build-tools-native build-cpp windows-ci-check: build-ffi-native build-tools-native build-cpp