diff options
author | Nikias Bassen | 2013-11-20 21:37:19 +0100 |
---|---|---|
committer | Nikias Bassen | 2013-11-20 21:37:19 +0100 |
commit | d0f4512a38c0f1be90b39cc774ad16f28d8bec23 (patch) | |
tree | 6feca7b18be77c01e95dc60596fb5fb9277d84fa /src | |
parent | 17ecc7b0a4f8d9eececd5317bbed30ce09c5ec85 (diff) | |
download | idevicerestore-d0f4512a38c0f1be90b39cc774ad16f28d8bec23.tar.gz idevicerestore-d0f4512a38c0f1be90b39cc774ad16f28d8bec23.tar.bz2 |
get baseband ticket in normal mode and pass preflight info to StartRestore request
Diffstat (limited to 'src')
-rw-r--r-- | src/common.h | 1 | ||||
-rw-r--r-- | src/idevicerestore.c | 32 | ||||
-rw-r--r-- | src/restore.c | 20 |
3 files changed, 53 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h index 0805e0a..61dfbb1 100644 --- a/src/common.h +++ b/src/common.h @@ -78,6 +78,7 @@ struct idevicerestore_client_t { unsigned char* nonce; int nonce_size; int image4supported; + plist_t preflight_info; char* udid; char* srnm; char* ipsw; diff --git a/src/idevicerestore.c b/src/idevicerestore.c index e5e46c5..84cded0 100644 --- a/src/idevicerestore.c +++ b/src/idevicerestore.c @@ -1482,6 +1482,38 @@ int get_tss_response(struct idevicerestore_client_t* client, plist_t build_ident } } + if (client->mode->index == MODE_NORMAL) { + /* normal mode; request baseband ticket aswell */ + plist_free(parameters); + parameters = plist_new_dict(); + plist_t pinfo = NULL; + normal_get_preflight_info(client, &pinfo); + if (pinfo) { + plist_t node; + node = plist_dict_get_item(pinfo, "Nonce"); + if (node) { + plist_dict_insert_item(parameters, "BbNonce", plist_copy(node)); + } + node = plist_dict_get_item(pinfo, "ChipID"); + if (node) { + plist_dict_insert_item(parameters, "BbChipID", plist_copy(node)); + } + node = plist_dict_get_item(pinfo, "CertID"); + if (node) { + plist_dict_insert_item(parameters, "BbGoldCertId", plist_copy(node)); + } + node = plist_dict_get_item(pinfo, "ChipSerialNo"); + if (node) { + plist_dict_insert_item(parameters, "BbSNUM", plist_copy(node)); + } + + /* add baseband parameters */ + tss_request_add_baseband_tags_from_manifest(request, build_identity, NULL); + tss_request_add_baseband_tags(request, parameters); + } + client->preflight_info = pinfo; + } + /* send request and grab response */ response = tss_request_send(request, client->tss_url); if (response == NULL) { diff --git a/src/restore.c b/src/restore.c index 252b2e3..8cac931 100644 --- a/src/restore.c +++ b/src/restore.c @@ -1708,10 +1708,30 @@ int restore_device(struct idevicerestore_client_t* client, plist_t build_identit plist_free(hwinfo); } + if (plist_dict_get_item(client->tss, "BBTicket")) { + client->restore->bbtss = plist_copy(client->tss); + } + plist_t opts = plist_new_dict(); // FIXME: required? //plist_dict_insert_item(opts, "AuthInstallRestoreBehavior", plist_new_string("Erase")); plist_dict_insert_item(opts, "AutoBootDelay", plist_new_uint(0)); + + if (client->preflight_info) { + plist_t node; + plist_t bbus = plist_copy(client->preflight_info); + + plist_dict_remove_item(bbus, "FusingStatus"); + plist_dict_remove_item(bbus, "PkHash"); + + plist_dict_insert_item(opts, "BBUpdaterState", bbus); + + node = plist_dict_get_item(client->preflight_info, "Nonce"); + if (node) { + plist_dict_insert_item(opts, "BasebandNonce", plist_copy(node)); + } + } + // FIXME: new on iOS 5 ? plist_dict_insert_item(opts, "BootImageType", plist_new_string("UserOrInternal")); // FIXME: required? |