mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-03-02 06:26:15 +01:00
Initial scafolding for RPPairing
This commit is contained in:
@@ -93,6 +93,10 @@ path = "src/lockdown.rs"
|
||||
name = "restore_service"
|
||||
path = "src/restore_service.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "remote_pairing"
|
||||
path = "src/remote_pairing.rs"
|
||||
|
||||
[dependencies]
|
||||
idevice = { path = "../idevice", features = ["full"] }
|
||||
tokio = { version = "1.43", features = ["io-util", "macros", "time", "full"] }
|
||||
|
||||
25
tools/src/remote_pairing.rs
Normal file
25
tools/src/remote_pairing.rs
Normal file
@@ -0,0 +1,25 @@
|
||||
// Jackson Coxson
|
||||
|
||||
use idevice::{
|
||||
remote_pairing::{rp_pairing_file::RpPairingFile, RPPairingClient},
|
||||
IdeviceError,
|
||||
};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), IdeviceError> {
|
||||
env_logger::init();
|
||||
let conn = tokio::net::TcpStream::connect("192.168.50.247:49152")
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let mut client = RPPairingClient::new(conn);
|
||||
client.handshake().await?;
|
||||
let pairing = RpPairingFile::generate();
|
||||
client
|
||||
.validate_pairing(pairing)
|
||||
.await
|
||||
.expect("No validate?");
|
||||
client.pair().await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user