summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2019-08-29 08:29:14 +0200
committerGravatar Nikias Bassen2019-08-29 08:29:14 +0200
commit6d5a3d6a35a8610f83d6a69156cfe1b64da4f2bd (patch)
treec3c8cd3fc549819f9e7ace604505a14c539ede7c
parent5086a9751f5c1298ac423a52b63ca299130aa1c2 (diff)
downloadlibimobiledevice-6d5a3d6a35a8610f83d6a69156cfe1b64da4f2bd.tar.gz
libimobiledevice-6d5a3d6a35a8610f83d6a69156cfe1b64da4f2bd.tar.bz2
preboard: Remove development notes from preboard.c and add info to public header
-rw-r--r--include/libimobiledevice/preboard.h17
-rw-r--r--src/preboard.c63
2 files changed, 17 insertions, 63 deletions
diff --git a/include/libimobiledevice/preboard.h b/include/libimobiledevice/preboard.h
index dc4e5f3..60b8e26 100644
--- a/include/libimobiledevice/preboard.h
+++ b/include/libimobiledevice/preboard.h
@@ -140,6 +140,17 @@ preboard_error_t preboard_receive_with_timeout(preboard_client_t client, plist_t
* Can be NULL if you want to handle receiving messages in your own code.
* @param user_data User data for callback function or NULL.
*
+ * The callback or following preboard_receive* invocations will usually
+ * receive a dictionary with:
+ * { ShowDialog: true }
+ * If the user does not enter a passcode, after 2 minutes a timeout is reached
+ * and the device sends a dictionary with:
+ * { Timeout: true }
+ * followed by { HideDialog: true }
+ * If the user aborts the passcode entry, the device sends a dictionary:
+ * { Error: 1, ErrorString: <error string> }
+ * followed by { HideDialog: true }
+ *
* @return PREBOARD_E_SUCCESS if the command was successfully submitted,
* PREBOARD_E_INVALID_ARG when client is invalid,
* or a PREBOARD_E_* error code on error.
@@ -155,6 +166,12 @@ preboard_error_t preboard_create_stashbag(preboard_client_t client, plist_t mani
* Can be NULL if you want to handle receiving messages in your own code.
* @param user_data User data for callback function or NULL.
*
+ * The callback or following preboard_receive* invocations will usually
+ * receive a dictionary with:
+ * { StashbagCommitComplete: true }
+ * or in case of an error:
+ * { StashbagCommitComplete: 0, Error: 1, <optional> ErrorString: <error string> }
+ *
* @return PREBOARD_E_SUCCESS if the command was successfully submitted,
* PREBOARD_E_INVALID_ARG when client is invalid,
* or a PREBOARD_E_* error code on error.
diff --git a/src/preboard.c b/src/preboard.c
index 7b27a34..b975f0e 100644
--- a/src/preboard.c
+++ b/src/preboard.c
@@ -229,73 +229,10 @@ LIBIMOBILEDEVICE_API preboard_error_t preboard_create_stashbag(preboard_client_t
}
return preboard_receive_status_loop_with_callback(client, status_cb, user_data);
-
- // return { ShowDialog: true} or {Timeout: true} followed by {HideDialog: true}
- // or { Error: 1, ErrorString: <error string> }
-
-
-/*
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>ShowDialog</key>
- <true/>
- <key>Version</key>
- <integer>2</integer>
-</dict>
-</plist>
-
-for success, it will send the HideDialog message, then wait up to 14400 seconds (4h) for the device to reboot?
-
-
-<!-- error: -->
-
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>Error</key>
- <integer>1</integer>
- <key>ErrorString</key>
- <string>user authentication failed: Error Domain=com.apple.LocalAuthentication Code=-2 "Canceled by user." UserInfo={BiometryType=1, NSLocalizedDescription=Canceled by user.}</string>
- <key>Version</key>
- <integer>2</integer>
-</dict>
-</plist>
-
-<!-- or after 2 minutes -->
-
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>Timeout</key>
- <true/>
- <key>Version</key>
- <integer>2</integer>
-</dict>
-</plist>
-
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>HideDialog</key>
- <true/>
- <key>Version</key>
- <integer>2</integer>
-</dict>
-</plist>
-
-*/
}
LIBIMOBILEDEVICE_API preboard_error_t preboard_commit_stashbag(preboard_client_t client, plist_t manifest, preboard_status_cb_t status_cb, void *user_data)
{
- // returns { StashbagCommitComplete: true }
- // or { StashbagCommitComplete: 0, Error: 1, <optional> ErrorString: <error string> }
-
if (!client) {
return PREBOARD_E_INVALID_ARG;
}