summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2012-07-17 16:06:23 +0200
committerGravatar Nikias Bassen2012-07-17 16:06:23 +0200
commit91a94c556245a74c0a7187388688178c11fceaa1 (patch)
tree8bf7bdaa230d359d97e36e4c2141d9c4de1b5a37 /src
parent995ed659864e14b7c55ee948889b3ffff7ff4991 (diff)
downloadidevicerestore-91a94c556245a74c0a7187388688178c11fceaa1.tar.gz
idevicerestore-91a94c556245a74c0a7187388688178c11fceaa1.tar.bz2
restore: Set client struct's serial number field from restore mode, too
Diffstat (limited to 'src')
-rw-r--r--src/restore.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/restore.c b/src/restore.c
index eb07763..2c1ec5c 100644
--- a/src/restore.c
+++ b/src/restore.c
@@ -150,6 +150,23 @@ int restore_check_device(struct idevicerestore_client_t* client) {
return -1;
}
+ if (client->srnm == NULL) {
+ char snbuf[256];
+ snbuf[0] = '\0';
+
+ restore_error = restored_get_value(restore, "SerialNumber", &node);
+ if (restore_error != RESTORE_E_SUCCESS || !node || plist_get_node_type(node) != PLIST_STRING) {
+ error("ERROR: Unable to get SerialNumber from restored\n");
+ restored_client_free(restore);
+ idevice_free(device);
+ return -1;
+ }
+
+ plist_get_string_val(node, &client->srnm);
+ info("INFO: device serial number is %s\n", client->srnm);
+ node = NULL;
+ }
+
restore_error = restored_get_value(restore, "HardwareModel", &node);
if (restore_error != RESTORE_E_SUCCESS) {
error("ERROR: Unable to get HardwareModel from restored\n");