Open pekn opened 1 year ago
Hi, feel free to drop me a full debug log output via PM on Telegram (you can find me in the https://t.me/libimobiledevice channel)
Hi @pekn , can you share the iTunes's request ?
tss-request.txt tss request attached
This also affects tsschecker as well, any tss request for the iPhone 14 Pro models always fails.
i have to ask though, do you mind sharing the BasebandCertID using ideviceinfo? it would help me to make tsschecker able to request baseband tickets for the SDX65M inside the iPhone 14 family.
EDIT:
after looking-over the tss request, i found an interesting key
<key>UID_MODE</key>
idevicerestore and tsschecker don't add this key or it's parameters and consequently it ends in error 69.
adding <key>UID_MODE</key> <false/>
to the request, fixes the problem!
sample code for tss.c to do this automatically is here:
plist_dict_set_item(request, "UID_MODE", plist_new_bool(0));
more research however, is needed.
I noticed that idevicerestore's baseband firmware is different than iTunes version.
There are same differences with iPhone 14 - that works OK with idevicerestore.. so above changes might not explain why iPhone 14 Pro Max does not boot after idevicerestore.
did you try adding plist_dict_set_item(request, "UID_MODE", plist_new_bool(0));
to tss.c on line 75?
i suggest you give it a try if you are still getting error 69 during the tss request.
the device won't boot if the firmwares can't get their signing tickets.
There's a new key RequiresUIDMode (true) in the BuildManifest/BuildIdentity but regardless it is set to false, I haven't understood the code yet. There's also a key Ap,SikeFuse in the iTunes request but I have no idea where the value is taken from. All a bit hard to experiment with without having the actual device 🙃
if i set AP,SkiaFuse in the request to 1, it ends in error 94. it seems to be much like ApProductionMode and related integers in behavior.
also, @pekn can you share the BasebandCertId from ideviceinfo? it can be helpful in testing baseband tss requests for the SDX65M in tsschecker.
it should look something like this: 2241363181
this example is from the SDX57M found in the iPhone SE 3.
Ok so I added the missing eUICC,Gold
and eUICC,Main
to tss_request_add_vinyl_tags
and also eUICC,ApProductionMode
which - I believe - is just a copy of ApProductionMode
with commit 88aeb4ce1313a9e89209c08efa62fb6b7eb428c4.
Regarding UID_MODE
I looked at MobileDevice framework but didn't fully understand how this is handled exactly, and came up with some preliminary handling code with commit bb7f206090649933ad616baa1b9497ee978052c8.
Still unsure how to decide when to set Ap,SikaFuse
. Maybe just set it alongside UID_MODE if it doesn't interfere with requests for older devices.
Hi @pekn , I have same the problem. The idVendor and idProduction is "Bus 001 Device 044: ID 05ac:1881 Apple, Inc". Do you have any idea?
Here's BasebandCertId: 3559316616
No, I haven't solved this one yet. In TSS response, there are LLB-TBM and iBSS-TBM entries. Probably those should be used for something. See here: tss-response.txt
Finally, now I know what changes are needed. In TSS response, we get LLB-TBM ucer and ucon fields (see tss-response.txt above). Those need to be added with specific syntax to the end of LLB (part of NorData) - so there is kind of two levels of personalization in that file. llb.txt
I attached example llb - see llb.txt.. now you can use xxd -d llb.txt > llb.dat.. then use https://lapo.it/asn1js/ to decode llb.dat. At end of decoded data, you can see IM4R structure - that needs to be added.
Also forgot to mention.. similar change is probably needed for iBSS (iBSS-TBM in tss-response.txt).. However, DFU mode seems to have changed - idevicerestore does not recognize that.
Hi @pekn , what news in the new IM4R structure ?
Put together this patch that should handle the TBM / ucon / ucer during stitching: https://gist.github.com/nikias/c766020303b62484eff9c601d281c5d8
Tested your patch -> now it works.
Awesome! Thanks for testing. Pushed commit a4f5a0c1a65c9df239a737c350d4723c2a8cbc55.
@pekn I know that there is no more DFU mode, but afaik there is still recovery mode. If you manually put the device in recovery mode, does it still work? While looking through the code I realized that it only does only add e.g. eUICC*
elements when starting from normal mode. Also, your tss response has a eUICC,Ticket
but this is never sent to the device anywhere in idevicerestore code...
So I wonder if restoring would actually still work when starting from recovery mode?
Yes, at least with this device idevicerestore works OK from recovery mode. I think eUICC ticket is placed to baseband zip file (see my comment about vinyl_07 above).
And I think there is still DFU mode (or Apple Debug mode). When device did not restart after idevicerestore, then iTunes recognized that mode as DFU. However, idevicerestore did not recognize that device anymore.
@pekn ah right, that actually makes sense. You don't happen to have a sample of stitched basebandfirmware by any chance?
File is too large to attach here, I will send it to you via telegram.
idevicerestore of iPhone 14 Pro Max seems to fail:
I checked differences between iTunes TSS request and idevicerestore TSS request. The following are missing from idevicerestore TSS request:
By adding above to TSS request, idevicerestore goes fine.. However, after idevicerestore, device does not boot up - instead it goes to DFU mode :(