Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Commit

Permalink
Add information about passcode setting
Browse files Browse the repository at this point in the history
  • Loading branch information
jkcoxson committed Apr 29, 2022
1 parent baf699e commit f6aa8f2
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions src/pair.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// jkcoxson

use rusty_libimobiledevice::{idevice::get_devices, services::userpref};
use rusty_libimobiledevice::{error::LockdowndError, idevice::get_devices, services::userpref};

const VERSION: &str = "0.1.2";

Expand Down Expand Up @@ -133,13 +133,23 @@ fn main() {
};

// Turn on WiFi sync so JitStreamer can pair
lockdown_client
.set_value(
"EnableWifiDebugging".to_string(),
"com.apple.mobile.wireless_lockdown".to_string(),
true.into(),
)
.unwrap();
match lockdown_client.set_value(
"EnableWifiDebugging".to_string(),
"com.apple.mobile.wireless_lockdown".to_string(),
true.into(),
) {
Ok(_) => {}
Err(e) => {
if e == LockdowndError::UnknownError {
println!("You need to set a passcode on your device for this to work.");
wait_for_enter();
return;
} else {
println!("Error setting value: {:?}", e);
continue;
}
}
}

loop {
match lockdown_client.pair(None, None) {
Expand Down

0 comments on commit f6aa8f2

Please sign in to comment.