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
140 * Can be NULL if you want to handle receiving messages in your own code. 140 * Can be NULL if you want to handle receiving messages in your own code.
141 * @param user_data User data for callback function or NULL. 141 * @param user_data User data for callback function or NULL.
142 * 142 *
143 * The callback or following preboard_receive* invocations will usually
144 * receive a dictionary with:
145 * { ShowDialog: true }
146 * If the user does not enter a passcode, after 2 minutes a timeout is reached
147 * and the device sends a dictionary with:
148 * { Timeout: true }
149 * followed by { HideDialog: true }
150 * If the user aborts the passcode entry, the device sends a dictionary:
151 * { Error: 1, ErrorString: <error string> }
152 * followed by { HideDialog: true }
153 *
143 * @return PREBOARD_E_SUCCESS if the command was successfully submitted, 154 * @return PREBOARD_E_SUCCESS if the command was successfully submitted,
144 * PREBOARD_E_INVALID_ARG when client is invalid, 155 * PREBOARD_E_INVALID_ARG when client is invalid,
145 * or a PREBOARD_E_* error code on error. 156 * 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
155 * Can be NULL if you want to handle receiving messages in your own code. 166 * Can be NULL if you want to handle receiving messages in your own code.
156 * @param user_data User data for callback function or NULL. 167 * @param user_data User data for callback function or NULL.
157 * 168 *
169 * The callback or following preboard_receive* invocations will usually
170 * receive a dictionary with:
171 * { StashbagCommitComplete: true }
172 * or in case of an error:
173 * { StashbagCommitComplete: 0, Error: 1, <optional> ErrorString: <error string> }
174 *
158 * @return PREBOARD_E_SUCCESS if the command was successfully submitted, 175 * @return PREBOARD_E_SUCCESS if the command was successfully submitted,
159 * PREBOARD_E_INVALID_ARG when client is invalid, 176 * PREBOARD_E_INVALID_ARG when client is invalid,
160 * or a PREBOARD_E_* error code on error. 177 * 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
229 } 229 }
230 230
231 return preboard_receive_status_loop_with_callback(client, status_cb, user_data); 231 return preboard_receive_status_loop_with_callback(client, status_cb, user_data);
232
233 // return { ShowDialog: true} or {Timeout: true} followed by {HideDialog: true}
234 // or { Error: 1, ErrorString: <error string> }
235
236
237/*
238<?xml version="1.0" encoding="UTF-8"?>
239<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
240<plist version="1.0">
241<dict>
242 <key>ShowDialog</key>
243 <true/>
244 <key>Version</key>
245 <integer>2</integer>
246</dict>
247</plist>
248
249for success, it will send the HideDialog message, then wait up to 14400 seconds (4h) for the device to reboot?
250
251
252<!-- error: -->
253
254<?xml version="1.0" encoding="UTF-8"?>
255<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
256<plist version="1.0">
257<dict>
258 <key>Error</key>
259 <integer>1</integer>
260 <key>ErrorString</key>
261 <string>user authentication failed: Error Domain=com.apple.LocalAuthentication Code=-2 "Canceled by user." UserInfo={BiometryType=1, NSLocalizedDescription=Canceled by user.}</string>
262 <key>Version</key>
263 <integer>2</integer>
264</dict>
265</plist>
266
267<!-- or after 2 minutes -->
268
269<?xml version="1.0" encoding="UTF-8"?>
270<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
271<plist version="1.0">
272<dict>
273 <key>Timeout</key>
274 <true/>
275 <key>Version</key>
276 <integer>2</integer>
277</dict>
278</plist>
279
280<?xml version="1.0" encoding="UTF-8"?>
281<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
282<plist version="1.0">
283<dict>
284 <key>HideDialog</key>
285 <true/>
286 <key>Version</key>
287 <integer>2</integer>
288</dict>
289</plist>
290
291*/
292} 232}
293 233
294LIBIMOBILEDEVICE_API preboard_error_t preboard_commit_stashbag(preboard_client_t client, plist_t manifest, preboard_status_cb_t status_cb, void *user_data) 234LIBIMOBILEDEVICE_API preboard_error_t preboard_commit_stashbag(preboard_client_t client, plist_t manifest, preboard_status_cb_t status_cb, void *user_data)
295{ 235{
296 // returns { StashbagCommitComplete: true }
297 // or { StashbagCommitComplete: 0, Error: 1, <optional> ErrorString: <error string> }
298
299 if (!client) { 236 if (!client) {
300 return PREBOARD_E_INVALID_ARG; 237 return PREBOARD_E_INVALID_ARG;
301 } 238 }