From dc484d17a2c38660afc60b23a339f82a68c2ef6e Mon Sep 17 00:00:00 2001 From: BALATON Zoltan Date: Mon, 13 Nov 2017 17:06:56 +0100 Subject: Decide what to do when updating SE firmware based on chip ID This should be more accurate than guessing based on what is in the build identity and avoid doing unexpected things for unknown hardware. --- src/restore.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/restore.c') diff --git a/src/restore.c b/src/restore.c index fd646a3..7cc2295 100644 --- a/src/restore.c +++ b/src/restore.c @@ -1789,10 +1789,14 @@ plist_t restore_get_se_firmware_data(restored_client_t restore, struct idevicere plist_t request = NULL; plist_t response = NULL; int ret; - - if (build_identity_has_component(build_identity, "SE,Firmware")) { + uint64_t chip_id = 0; + plist_t node = plist_dict_get_item(p_info, "SE,ChipID"); + if (node && plist_get_node_type(node) == PLIST_UINT) { + plist_get_uint_val(node, &chip_id); + } + if (chip_id == 0x20211) { comp_name = "SE,Firmware"; - } else if (build_identity_has_component(build_identity, "SE,UpdatePayload")) { + } else if (chip_id == 0x73) { comp_name = "SE,UpdatePayload"; } else { error("ERROR: Neither 'SE,Firmware' nor 'SE,UpdatePayload' found in build identity.\n"); -- cgit v1.1-32-gdbae