diff options
author | Martin Szulecki | 2012-07-17 16:16:16 +0200 |
---|---|---|
committer | Nikias Bassen | 2012-07-17 16:16:16 +0200 |
commit | 94743be00fb0b66bb093210d091f17c5ac51d678 (patch) | |
tree | 49108f15bf31100de07495f0f415b3463386541a /src | |
parent | b28d4534d92e0385206401d0e9c0cd64206df3b1 (diff) | |
download | idevicerestore-94743be00fb0b66bb093210d091f17c5ac51d678.tar.gz idevicerestore-94743be00fb0b66bb093210d091f17c5ac51d678.tar.bz2 |
restore: Query and print hardware information in restore mode
Diffstat (limited to 'src')
-rw-r--r-- | src/restore.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/restore.c b/src/restore.c index 2c1ec5c..367e73e 100644 --- a/src/restore.c +++ b/src/restore.c @@ -1339,6 +1339,7 @@ int restore_device(struct idevicerestore_client_t* client, plist_t build_identit char* kernel = NULL; plist_t node = NULL; plist_t message = NULL; + plist_t info = NULL; idevice_t device = NULL; restored_client_t restore = NULL; idevice_error_t device_error = IDEVICE_E_SUCCESS; @@ -1356,6 +1357,38 @@ int restore_device(struct idevicerestore_client_t* client, plist_t build_identit restore = client->restore->client; device = client->restore->device; + restore_error = restored_query_value(restore, "HardwareInfo", &info); + if (restore_error == RESTORE_E_SUCCESS) { + uint64_t i = 0; + uint8_t b = 0; + info("Hardware Information:\n"); + + node = plist_dict_get_item(info, "BoardID"); + if (node && plist_get_node_type(node) == PLIST_UINT) { + plist_get_uint_val(node, &i); + info("BoardID: %d\n", (int)i); + } + + node = plist_dict_get_item(info, "ChipID"); + if (node && plist_get_node_type(node) == PLIST_UINT) { + plist_get_uint_val(node, &i); + info("ChipID: %d\n", (int)i); + } + + node = plist_dict_get_item(info, "UniqueChipID"); + if (node && plist_get_node_type(node) == PLIST_UINT) { + plist_get_uint_val(node, &i); + info("UniqueChipID: " FMT_qu "\n", (long long unsigned int)i); + } + + node = plist_dict_get_item(info, "ProductionMode"); + if (node && plist_get_node_type(node) == PLIST_BOOLEAN) { + plist_get_bool_val(node, &b); + info("ProductionMode: %s\n", (b==1) ? "true":"false"); + } + plist_free(info); + } + plist_t opts = plist_new_dict(); // FIXME: required? //plist_dict_insert_item(opts, "AuthInstallRestoreBehavior", plist_new_string("Erase")); |