This commit is contained in:
Cryptic 2021-09-27 07:27:32 -07:00
parent 9cdfb81e4b
commit 98e7cbd747
No known key found for this signature in database
GPG key ID: 6027B509EFE3A76B

View file

@ -103,7 +103,7 @@ extern "C"{
irecv_error_t irecv_send_command(irecv_client_t client, const char* command);
int recovery_send_component_and_command(struct idevicerestore_client_t* client, plist_t build_identity, const char* component, const char* command);
int recovery_send_component(struct idevicerestore_client_t* client, plist_t build_identity, const char* component);
};
}
#pragma mark futurerestore
futurerestore::futurerestore(bool isUpdateInstall, bool isPwnDfu, bool noIBSS, bool noRestore) : _isUpdateInstall(isUpdateInstall), _isPwnDfu(isPwnDfu), _noIBSS(noIBSS), _noRestore(noRestore){
@ -158,8 +158,6 @@ void futurerestore::putDeviceIntoRecovery(){
getDeviceMode(false);
info("Found device in %s mode\n", _client->mode->string);
if (_client->mode == MODE_NORMAL){
irecv_device_event_subscribe(&_client->irecv_e_ctx, irecv_event_cb, _client);
idevice_event_subscribe(idevice_event_cb, _client);
#ifdef HAVE_LIBIPATCHER
retassure(!_isPwnDfu, "isPwnDfu enabled, but device was found in normal mode\n");
#endif
@ -471,7 +469,7 @@ void futurerestore::enterPwnRecovery(plist_t build_identity, string bootargs){
libipatcher::fw_key iBECKeys;
/* Assure device is in dfu */
getDeviceMode(false);
getDeviceMode(true);
mutex_lock(&_client->device_event_mutex);
cond_wait_timeout(&_client->device_event_cond, &_client->device_event_mutex, 1000);
retassure(((_client->mode == MODE_DFU) || (mutex_unlock(&_client->device_event_mutex),0)), "Device isn't in DFU mode!");
@ -522,7 +520,7 @@ void futurerestore::enterPwnRecovery(plist_t build_identity, string bootargs){
info("Booting iBSS, waiting for device to disconnect...\n");
cond_wait_timeout(&_client->device_event_cond, &_client->device_event_mutex, 10000);
retassure(((_client->mode != MODE_UNKNOWN) || (mutex_unlock(&_client->device_event_mutex),0)), "Device did not disconnect. Possibly invalid iBSS. Reset device and try again");
retassure(((_client->mode == 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)) {
@ -1167,12 +1165,7 @@ void futurerestore::doRestore(const char *ipsw){
plist_dict_remove_item(client->tss, "BBTicket");
plist_dict_remove_item(client->tss, "BasebandFirmware");
irecv_device_event_unsubscribe(client->irecv_e_ctx);
idevice_event_unsubscribe();
client->idevice_e_ctx = NULL;
irecv_device_event_subscribe(&_client->irecv_e_ctx, irecv_event_cb, _client);
idevice_event_subscribe(idevice_event_cb, _client);
_client->idevice_e_ctx = (void *)idevice_event_cb;