From 284c497680a84906575920efa5352764934925ff Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Tue, 7 Feb 2012 16:58:26 +0100 Subject: recovery: store device serial number upon connect --- src/common.h | 3 ++- src/recovery.c | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/common.h b/src/common.h index 6e1441a..1949a8c 100644 --- a/src/common.h +++ b/src/common.h @@ -134,7 +134,8 @@ struct idevicerestore_client_t { uint64_t ecid; unsigned char* nonce; int nonce_size; - const char* uuid; + char* uuid; + char* srnm; const char* ipsw; const char* filesystem; struct dfu_client_t* dfu; diff --git a/src/recovery.c b/src/recovery.c index 279fe50..41ed4fb 100644 --- a/src/recovery.c +++ b/src/recovery.c @@ -83,6 +83,16 @@ int recovery_client_new(struct idevicerestore_client_t* client) { debug("Retrying connection...\n"); } + if (client->srnm == NULL) { + char snbuf[256]; + snbuf[0] = '\0'; + irecv_get_srnm(recovery, snbuf); + if (snbuf[0] != '\0') { + client->srnm = strdup(snbuf); + info("INFO: device serial number is %s\n", client->srnm); + } + } + irecv_event_subscribe(recovery, IRECV_PROGRESS, &recovery_progress_callback, NULL); client->recovery->client = recovery; return 0; -- cgit v1.1-32-gdbae