summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common.h1
-rw-r--r--src/idevicerestore.c9
-rw-r--r--src/idevicerestore.h3
-rw-r--r--src/restore.c3
4 files changed, 16 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h
index 4b88129..b01e471 100644
--- a/src/common.h
+++ b/src/common.h
@@ -112,6 +112,7 @@ struct idevicerestore_client_t {
char* device_build;
int build_major;
char* restore_boot_args;
+ char* post_restore_action;
char* cache_dir;
unsigned char* root_ticket;
int root_ticket_len;
diff --git a/src/idevicerestore.c b/src/idevicerestore.c
index 61fa1be..23db769 100644
--- a/src/idevicerestore.c
+++ b/src/idevicerestore.c
@@ -1657,6 +1657,7 @@ void idevicerestore_client_free(struct idevicerestore_client_t* client)
if (client->restore_boot_args) {
free(client->restore_boot_args);
}
+ free(client->post_restore_action);
if (client->cache_dir) {
free(client->cache_dir);
}
@@ -1716,6 +1717,14 @@ void idevicerestore_set_ipsw(struct idevicerestore_client_t* client, const char*
}
}
+void idevicerestore_set_post_restore_action(struct idevicerestore_client_t* client, const char* action)
+{
+ if (!client)
+ return;
+ free(client->post_restore_action);
+ client->post_restore_action = action ? strdup(action) : NULL;
+}
+
void idevicerestore_set_cache_path(struct idevicerestore_client_t* client, const char* path)
{
if (!client)
diff --git a/src/idevicerestore.h b/src/idevicerestore.h
index ce8686f..2b98191 100644
--- a/src/idevicerestore.h
+++ b/src/idevicerestore.h
@@ -85,6 +85,9 @@ void idevicerestore_set_flags(struct idevicerestore_client_t* client, int flags)
void idevicerestore_set_ipsw(struct idevicerestore_client_t* client, const char* path);
void idevicerestore_set_cache_path(struct idevicerestore_client_t* client, const char* path);
void idevicerestore_set_progress_callback(struct idevicerestore_client_t* client, idevicerestore_progress_cb_t cbfunc, void* userdata);
+/* What the restore OS does once it has sent its final status: "Reboot" (its
+ * default) or "Shutdown". NULL sends no PostRestoreAction. */
+void idevicerestore_set_post_restore_action(struct idevicerestore_client_t* client, const char* action);
int idevicerestore_start(struct idevicerestore_client_t* client);
const char* idevicerestore_get_error(void);
diff --git a/src/restore.c b/src/restore.c
index fbe54de..251f2ec 100644
--- a/src/restore.c
+++ b/src/restore.c
@@ -5772,6 +5772,9 @@ int restore_device(struct idevicerestore_client_t* client, plist_t build_identit
if (client->restore_boot_args) {
plist_dict_set_item(opts, "RestoreBootArgs", plist_new_string(client->restore_boot_args));
}
+ if (client->post_restore_action) {
+ plist_dict_set_item(opts, "PostRestoreAction", plist_new_string(client->post_restore_action));
+ }
plist_t spp = plist_access_path(build_identity, 2, "Info", "SystemPartitionPadding");
if (spp) {
spp = plist_copy(spp);