summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-02-07 16:58:26 +0100
committerGravatar Nikias Bassen2012-02-07 16:58:26 +0100
commit284c497680a84906575920efa5352764934925ff (patch)
tree69c034e60e8b05ffb9100b472d8046ae4baf5dbe
parent5231462b8a7716800f9cb129a58f9ba120cda88a (diff)
downloadidevicerestore-284c497680a84906575920efa5352764934925ff.tar.gz
idevicerestore-284c497680a84906575920efa5352764934925ff.tar.bz2
recovery: store device serial number upon connect
-rw-r--r--src/common.h3
-rw-r--r--src/recovery.c10
2 files changed, 12 insertions, 1 deletions
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;