idevicerestore icon indicating copy to clipboard operation
idevicerestore copied to clipboard

iPhone 13 series fails to enter restore mode on iOS 15.6

Open a-gunter opened this issue 2 years ago • 12 comments

As far as I know this only happens on the 13 series devices (mini, regular, pro, pro max). iOS 15.5 is fine, but something is new on iOS 15.6. When restoring from recovery mode, after sending iBoot components -> DeviceTree -> RestoreSEP -> KernelCache, the device fails to transition to restore mode and instead boots back into recovery.

This was done on macOS using Apple's usbmuxd.

Debug log is attached; if needed, I also have pcaps of an unsuccessful idevicerestore attempt and a successful Apple Configurator 2 attempt (stopped the capture once the device transitioned to restore mode). They're uploaded here.

idevicerestore debug log: 13ProMax_15.6_idevicerestore_debug.txt

Anyone else seeing the same behavior?

a-gunter avatar Jul 22 '22 17:07 a-gunter

yes, idevicerestore is not working for 13 series devices. i am also facing same issue.

kindly reply, if anyone has resolve this issue.

ashishgah avatar Jul 25 '22 07:07 ashishgah

Me too. @nikias do you have any ideas?

truonggiang0710 avatar Jul 26 '22 09:07 truonggiang0710

@a-gunter @ashishgah Do you have any update?

truonggiang0710 avatar Jul 27 '22 13:07 truonggiang0710

I have the same problem. Tried on an iPhone 13 mini (iPhone14,4), both when starting in normal or recovery mode. "ERROR: Device failed to enter restore mode." appears. This error appears with the last version of libimobile and idevicerestore (I compiled it on 12th July). The log is attached : idevicerestore_iPhone14,4.txt

Naz4h avatar Jul 27 '22 14:07 Naz4h

Me too,if anyone has resolve this issue.

Neil-0609 avatar Aug 02 '22 05:08 Neil-0609

Me too,if anyone has resolve this issue.

mroger-tech avatar Aug 03 '22 08:08 mroger-tech

Hi here. I got it to work by adding the following to line 670 of src/tss.c.

if (_plist_dict_get_bool(info_dict, "IsFTAB")) {
    debug("DEBUG: %s: Skipping '%s' because IsFTAB\n", __func__, key);
    continue;
}

I haven't submitted a patch or pull request because I am not sure of all the implications, so I let the expert @nikias double check!

Thanks my friend!

pod2g avatar Aug 04 '22 09:08 pod2g

I tried it and it works @pod2g !

Just for curiosity how do you find that ?

Thank you so much !!!

Naz4h avatar Aug 04 '22 12:08 Naz4h

very effective, thank you @pod2g

AiXanadu avatar Aug 05 '22 03:08 AiXanadu

yes, it is working. great.. thank you @pod2g .

ashishgah avatar Aug 05 '22 04:08 ashishgah

it is working,and I'm curious how did you find this method.

mroger-tech avatar Aug 05 '22 06:08 mroger-tech

I tried it and it works @pod2g !

Just for curiosity how do you find that ?

Thank you so much !!!

Hey.

idevicerestore does not seem to check the return code of the usb control request for the "firmware" iBEC command following the upload of the Restore ANS firmware component (or any command actually); but it was failing.

I captured the USB communication of iTunes with the device and compared the Restore ANS payload of iTunes vs idevicerestore.

Only difference was about the manifest of idevicerestore having additional components.

These components had the aforementioned property in the BuildManifest.plist .

I tried to exclude them from the TSS request and that worked.

Greetings.

pod2g avatar Aug 05 '22 13:08 pod2g

Did anyone try that on different devices? (other than iPhone 13)

I verified this to work also on iPhone XR

doronz88 avatar Aug 21 '22 15:08 doronz88

@doronz88 I try all the iPhone X and above, it's OK.

truonggiang0710 avatar Aug 22 '22 02:08 truonggiang0710

Committed with 4a516e5f5e0c509de966cc1ac45622f452f23e0b.

nikias avatar Aug 23 '22 15:08 nikias

I tried it and it works @pod2g ! Just for curiosity how do you find that ? Thank you so much !!!

Hey.

idevicerestore does not seem to check the return code of the usb control request for the "firmware" iBEC command following the upload of the Restore ANS firmware component (or any command actually); but it was failing.

I captured the USB communication of iTunes with the device and compared the Restore ANS payload of iTunes vs idevicerestore.

Only difference was about the manifest of idevicerestore having additional components.

These components had the aforementioned property in the BuildManifest.plist .

I tried to exclude them from the TSS request and that worked.

Greetings.

Hi here. I got it to work by adding the following to line 670 of src/tss.c.

if (_plist_dict_get_bool(info_dict, "IsFTAB")) {
    debug("DEBUG: %s: Skipping '%s' because IsFTAB\n", __func__, key);
    continue;
}

I haven't submitted a patch or pull request because I am not sure of all the implications, so I let the expert @nikias double check!

Thanks my friend!

how can I apply this, having same issue with an iphone 13 pro max, not entering DFU and stuck at recovery screen

McVICTORY avatar Apr 10 '23 08:04 McVICTORY

Hi here. I got it to work by adding the following to line 670 of src/tss.c.

if (_plist_dict_get_bool(info_dict, "IsFTAB")) {
    debug("DEBUG: %s: Skipping '%s' because IsFTAB\n", __func__, key);
    continue;
}

I haven't submitted a patch or pull request because I am not sure of all the implications, so I let the expert @nikias double check!

Thanks my friend!

im sorry im new to this and i dont really understand where should add this. Could someone help pls

jiepbhaone avatar Jul 31 '23 02:07 jiepbhaone

` // Compared to ac2, not needed if ((strcmp(key, "BaseSystem") == 0)) { continue; }

	/* FIXME: only used with diagnostics firmware */
	if (strcmp(key, "Diags") == 0) {
		continue;
	}

	plist_t info_dict = plist_dict_get_item(manifest_entry, "Info");
	if (!info_dict) {
		continue;
	}

	if (_plist_dict_get_bool(parameters, "ApSupportsImg4")) {
		if (!plist_dict_get_item(info_dict, "RestoreRequestRules")) {
			debug("DEBUG: %s: Skipping '%s' as it doesn't have RestoreRequestRules\n", __func__, key);
			continue;
		}
	}
            // here

if (_plist_dict_get_bool(info_dict, "IsFTAB")) { debug("DEBUG: %s: Skipping '%s' because IsFTAB\n", func, key); continue; }

	if (_plist_dict_get_bool(parameters, "_OnlyFWComponents")) {
		if (!_plist_dict_get_bool(manifest_entry, "Trusted")) {
			debug("DEBUG: %s: Skipping '%s' as it is not trusted\n", __func__, key);
			continue;
		}

		if (!_plist_dict_get_bool(info_dict, "IsFirmwarePayload") && !_plist_dict_get_bool(info_dict, "IsSecondaryFirmwarePayload") && !_plist_dict_get_bool(info_dict, "IsFUDFirmware")) {
			debug("DEBUG: %s: Skipping '%s' as it is neither firmware nor secondary nor FUD firmware payload\n", __func__, key);
			continue;
		}
	}

`

@jiepbhaone

AiXanadu avatar Aug 04 '23 02:08 AiXanadu

The changes have been added to git last August already, just compile it from source @jiepbhaone @AiXanadu

nikias avatar Aug 04 '23 07:08 nikias