summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-09-21 23:11:23 +0200
committerGravatar Nikias Bassen2012-09-21 23:11:23 +0200
commit465477b251b065f24c3c834e5f7d3398b37ee069 (patch)
tree9b258485f0552912ba1cfd636d04aadef64401a6
parente22c85cbf5211b3f8b87c9ee824cf4ccd70cab36 (diff)
downloadlibirecovery-465477b251b065f24c3c834e5f7d3398b37ee069.tar.gz
libirecovery-465477b251b065f24c3c834e5f7d3398b37ee069.tar.bz2
added support for iPod5,1
-rw-r--r--include/libirecovery.h4
-rw-r--r--src/libirecovery.c22
2 files changed, 26 insertions, 0 deletions
diff --git a/include/libirecovery.h b/include/libirecovery.h
index 781123b..9b9ee01 100644
--- a/include/libirecovery.h
+++ b/include/libirecovery.h
@@ -59,6 +59,7 @@ extern "C" {
59#define CPID_IPAD32 0x8945 59#define CPID_IPAD32 0x8945
60#define CPID_IPAD33 0x8945 60#define CPID_IPAD33 0x8945
61#define CPID_IPHONE5 0x8950 61#define CPID_IPHONE5 0x8950
62#define CPID_IPOD5G 0x8942
62 63
63#define BDID_UNKNOWN -1 64#define BDID_UNKNOWN -1
64#define BDID_IPHONE2G 0x00 65#define BDID_IPHONE2G 0x00
@@ -83,6 +84,7 @@ extern "C" {
83#define BDID_IPAD33 0x04 84#define BDID_IPAD33 0x04
84#define BDID_IPHONE51 0x00 85#define BDID_IPHONE51 0x00
85#define BDID_IPHONE52 0x02 86#define BDID_IPHONE52 0x02
87#define BDID_IPOD5G 0x00
86 88
87#define DEVICE_UNKNOWN -1 89#define DEVICE_UNKNOWN -1
88#define DEVICE_IPHONE2G 0 90#define DEVICE_IPHONE2G 0
@@ -107,6 +109,7 @@ extern "C" {
107#define DEVICE_IPAD33 19 109#define DEVICE_IPAD33 19
108#define DEVICE_IPHONE51 20 110#define DEVICE_IPHONE51 20
109#define DEVICE_IPHONE52 21 111#define DEVICE_IPHONE52 21
112#define DEVICE_IPOD5G 22
110 113
111enum { 114enum {
112 kRecoveryMode1 = 0x1280, 115 kRecoveryMode1 = 0x1280,
@@ -211,6 +214,7 @@ static struct irecv_device irecv_devices[] = {
211 { 19, "iPad3,3", "j2aap", 0x04, 0x8945 }, 214 { 19, "iPad3,3", "j2aap", 0x04, 0x8945 },
212 { 20, "iPhone5,1", "n41ap", 0x00, 0x8950 }, 215 { 20, "iPhone5,1", "n41ap", 0x00, 0x8950 },
213 { 21, "iPhone5,2", "n42ap", 0x02, 0x8950 }, 216 { 21, "iPhone5,2", "n42ap", 0x02, 0x8950 },
217 { 22, "iPod5,1", "n78ap", 0x00, 0x8942 },
214 { -1, NULL, NULL, -1, -1 } 218 { -1, NULL, NULL, -1, -1 }
215}; 219};
216 220
diff --git a/src/libirecovery.c b/src/libirecovery.c
index 4db314b..e8ce634 100644
--- a/src/libirecovery.c
+++ b/src/libirecovery.c
@@ -1607,6 +1607,28 @@ irecv_error_t irecv_get_device(irecv_client_t client, irecv_device_t* device) {
1607 break; 1607 break;
1608 } 1608 }
1609 break; 1609 break;
1610
1611 case CPID_APPLETV31:
1612 // AppleTV 3rd gen. iPad2,4 and iPod5,1 share the same ChipID, so we need to check the BoardID
1613 if (irecv_get_bdid(client, &bdid) < 0) {
1614 break;
1615 }
1616 switch (bdid) {
1617 case BDID_APPLETV31:
1618 device_id = DEVICE_APPLETV31;
1619 break;
1620 case BDID_IPAD24:
1621 device_id = DEVICE_IPAD24;
1622 break;
1623 case BDID_IPOD5G:
1624 device_id = DEVICE_IPOD5G;
1625 break;
1626 default:
1627 device_id = DEVICE_UNKNOWN;
1628 break;
1629 }
1630 break;
1631
1610 case CPID_IPHONE5: 1632 case CPID_IPHONE5:
1611 if (irecv_get_bdid(client, &bdid) < 0) { 1633 if (irecv_get_bdid(client, &bdid) < 0) {
1612 break; 1634 break;