summaryrefslogtreecommitdiffstats
path: root/src/libirecovery.c
diff options
context:
space:
mode:
authorGravatar Rick Mark2019-12-04 01:20:43 -0800
committerGravatar Nikias Bassen2019-12-16 17:48:01 +0100
commitd90d4af50af321cf491a2e305d6b1999f9aee35c (patch)
tree4e79981c9cb03a1affb56e544084a2bfb5ff2400 /src/libirecovery.c
parentcfb8d673c728ff1597d14f6069c1934f4e0c25f0 (diff)
downloadlibirecovery-d90d4af50af321cf491a2e305d6b1999f9aee35c.tar.gz
libirecovery-d90d4af50af321cf491a2e305d6b1999f9aee35c.tar.bz2
Adding support for Apple T2 processors
Diffstat (limited to 'src/libirecovery.c')
-rw-r--r--src/libirecovery.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/libirecovery.c b/src/libirecovery.c
index 7b50ff2..62cdaa5 100644
--- a/src/libirecovery.c
+++ b/src/libirecovery.c
@@ -228,6 +228,16 @@ static struct irecv_device irecv_devices[] = {
228 { "AppleTV3,2", "j33iap", 0x00, 0x8947, "Apple TV 3 (2013)" }, 228 { "AppleTV3,2", "j33iap", 0x00, 0x8947, "Apple TV 3 (2013)" },
229 { "AppleTV5,3", "j42dap", 0x34, 0x7000, "Apple TV 4" }, 229 { "AppleTV5,3", "j42dap", 0x34, 0x7000, "Apple TV 4" },
230 { "AppleTV6,2", "j105aap", 0x02, 0x8011, "Apple TV 4K" }, 230 { "AppleTV6,2", "j105aap", 0x02, 0x8011, "Apple TV 4K" },
231 /* Apple T2 Coprocessor */
232 { "iBridge2,1", "j137ap", 0x0A, 0x8012, "Apple T2 Coprocessor (j137)" },
233 { "iBridge2,3", "j680ap", 0x0B, 0x8012, "Apple T2 Coprocessor (j680)" },
234 { "iBridge2,4", "j132ap", 0x0C, 0x8012, "Apple T2 Coprocessor (j132)" },
235 { "iBridge2,5", "j174ap", 0x0E, 0x8012, "Apple T2 Coprocessor (j174)" },
236 { "iBridge2,6", "j160ap", 0x0F, 0x8012, "Apple T2 Coprocessor (j160)" },
237 { "iBridge2,7", "j780ap", 0x07, 0x8012, "Apple T2 Coprocessor (j780)" },
238 { "iBridge2,8", "j140kap", 0x17, 0x8012, "Apple T2 Coprocessor (j140k)" },
239 { "iBridge2,10", "j213ap", 0x18, 0x8012, "Apple T2 Coprocessor (j213)" },
240 { "iBridge2,12", "j140aap", 0x37, 0x8012, "Apple T2 Coprocessor (j140a)" },
231 { NULL, NULL, -1, -1, NULL } 241 { NULL, NULL, -1, -1, NULL }
232}; 242};
233 243
@@ -442,7 +452,7 @@ static int irecv_get_string_descriptor_ascii(irecv_client_t client, uint8_t desc
442 452
443 if (ret < 0) return ret; 453 if (ret < 0) return ret;
444 if (data[1] != 0x03) return IRECV_E_UNKNOWN_ERROR; 454 if (data[1] != 0x03) return IRECV_E_UNKNOWN_ERROR;
445 if (data[0] > ret) return IRECV_E_UNKNOWN_ERROR; 455 if (data[0] > ret) return IRECV_E_UNKNOWN_ERROR;
446 456
447 for (di = 0, si = 2; si < data[0]; si += 2) { 457 for (di = 0, si = 2; si < data[0]; si += 2) {
448 if (di >= (size - 1)) break; 458 if (di >= (size - 1)) break;
@@ -539,7 +549,7 @@ static void irecv_load_device_info_from_iboot_string(irecv_client_t client, cons
539 } 549 }
540 client->device_info.srtg = strdup(tmp); 550 client->device_info.srtg = strdup(tmp);
541 } 551 }
542} 552}
543 553
544static void irecv_copy_nonce_with_tag(irecv_client_t client, const char* tag, unsigned char** nonce, unsigned int* nonce_size) 554static void irecv_copy_nonce_with_tag(irecv_client_t client, const char* tag, unsigned char** nonce, unsigned int* nonce_size)
545{ 555{
@@ -797,7 +807,7 @@ irecv_error_t mobiledevice_connect(irecv_client_t* client, unsigned long long ec
797 if (serial_str[j] == '_') { 807 if (serial_str[j] == '_') {
798 serial_str[j] = ' '; 808 serial_str[j] = ' ';
799 } else { 809 } else {
800 serial_str[j] = toupper(serial_str[j]); 810 serial_str[j] = toupper(serial_str[j]);
801 } 811 }
802 } 812 }
803 813
@@ -963,7 +973,7 @@ IRECV_API int irecv_usb_control_transfer(irecv_client_t client, uint8_t bm_reque
963 packet->wValue = w_value; 973 packet->wValue = w_value;
964 packet->wIndex = w_index; 974 packet->wIndex = w_index;
965 packet->wLength = w_length; 975 packet->wLength = w_length;
966 976
967 if (bm_request_type < 0x80 && w_length > 0) { 977 if (bm_request_type < 0x80 && w_length > 0) {
968 memcpy(packet->data, data, w_length); 978 memcpy(packet->data, data, w_length);
969 } 979 }
@@ -3174,7 +3184,7 @@ IRECV_API irecv_client_t irecv_reconnect(irecv_client_t client, int initial_paus
3174 debug("Waiting %d seconds for the device to pop up...\n", initial_pause); 3184 debug("Waiting %d seconds for the device to pop up...\n", initial_pause);
3175 sleep(initial_pause); 3185 sleep(initial_pause);
3176 } 3186 }
3177 3187
3178 error = irecv_open_with_ecid_and_attempts(&new_client, ecid, 10); 3188 error = irecv_open_with_ecid_and_attempts(&new_client, ecid, 10);
3179 if(error != IRECV_E_SUCCESS) { 3189 if(error != IRECV_E_SUCCESS) {
3180 return NULL; 3190 return NULL;