Change client call to dfu(pt.2)

This commit is contained in:
Cryptiiiic 2021-08-23 13:44:32 -07:00
parent 5c64d001ac
commit 634d811c64
No known key found for this signature in database
GPG key ID: 6027B509EFE3A76B

View file

@ -524,6 +524,7 @@ void futurerestore::enterPwnRecovery(plist_t build_identity, string bootargs){
cond_wait_timeout(&_client->device_event_cond, &_client->device_event_mutex, 10000);
retassure(((_client->mode == &idevicerestore_modes[MODE_UNKNOWN]) || (mutex_unlock(&_client->device_event_mutex),0)), "Device did not disconnect. Possibly invalid iBSS. Reset device and try again");
info("Booting iBSS, waiting for device to reconnect...\n");
bool dfu = false;
if((_client->device->chip_id >= 0x7000 && _client->device->chip_id <= 0x8004) || (_client->device->chip_id >= 0x8900 && _client->device->chip_id <= 0x8965)) {
cond_wait_timeout(&_client->device_event_cond, &_client->device_event_mutex, 10000);
retassure(((_client->mode == &idevicerestore_modes[MODE_DFU]) || (mutex_unlock(&_client->device_event_mutex),0)), "Device did not reconnect. Possibly invalid iBSS. Reset device and try again");
@ -550,13 +551,13 @@ void futurerestore::enterPwnRecovery(plist_t build_identity, string bootargs){
mutex_lock(&_client->device_event_mutex);
}
} else if((_client->device->chip_id >= 0x8006 && _client->device->chip_id <= 0x8030) || (_client->device->chip_id >= 0x8101 && _client->device->chip_id <= 0x8301)) {
dfu = true;
cond_wait_timeout(&_client->device_event_cond, &_client->device_event_mutex, 10000);
retassure(((_client->mode == &idevicerestore_modes[MODE_RECOVERY]) || (mutex_unlock(&_client->device_event_mutex),0)), "Device did not reconnect. Possibly invalid iBSS. Reset device and try again");
} else {
mutex_unlock(&_client->device_event_mutex);
reterror("Device not supported!\n");
}
// label:
/* Verify correct nonce/set nonce */
if(_client->image4supported) {
@ -566,7 +567,11 @@ void futurerestore::enterPwnRecovery(plist_t build_identity, string bootargs){
});
mutex_unlock(&_client->device_event_mutex);
if(_client->device->chip_id < 0x8015) {
assure(!irecv_send_command(_client->dfu->client, "bgcolor 255 0 0"));
if(dfu) {
assure(!irecv_send_command(_client->dfu->client, "bgcolor 255 0 0"));
} else {
assure(!irecv_send_command(_client->recovery->client, "bgcolor 255 0 0"));
}
sleep(2);
}
auto nonceelem = img4tool::getValFromIM4M({_im4ms[0].first,_im4ms[0].second}, 'BNCH');