2018-07-21

Folly of the iPhone. iFolly?

Today, I thought to myself, "Boy, what better time to restore my iPhone 5S to iOS 12 Beta 4 while simultaneously erasing the device than now. I am sure it will be a quick and seamless operation." I could not have been more wrong.

iTunes does not allow the user to erase the device as you restore it (EDIT: I think SHIFT/OPTION+"Restore" does just that), so I was forced to look for alternatives... just kidding, I won't touch iTunes with a ten-foot stick, so I already knew what program to use: idevicerestore. The aforementioned program is a command-line tool that acts like iTunes, but only for restoring/updating iOS firmware. It also allows the user to do some cool things, like downgrade devices, given proper circumstances (EDIT: No, I think only futurerestore/idevicererestore allows this). Unfortunately, idevicerestore is not readily available for Windows (my OS of choice), so I had to use my trusty macOS Sierra VM to use it. Little did I know that fuck-all would work.

Installing idevicerestore on macOS was a fairly painless process; I am no stranger to the command line. It even got pretty far in the restoring process - except, to my dismay, it didn't restore anything. It got stuck on "waiting for the device," despite the device being plugged in, recognized, and ripe for a restore. I thought to myself, "Fuck. Fucking fuck. Fucking fuck fuckity." That's when I turned to the trustier-than-macOS Linux. I didn't exactly want to install Debian on my primary desktop quite yet, so I used the 16 year old Dell desktop that sits at the other side of my room (this desktop was already running Debian). I once again installed idevicerestore, and started the restoring process -- but what's this? "Error 5"? Thanks for being so incredibly verbose, libzip.

It turns out libzip can't comprehend files larger than 2GB on i386 systems, which the IPSW file is and the Dell desktop is, respectively. "No big fucking deal," I thought to myself, cursing more than usual. "I'll just fucking recompile libzip with a fucking compiler flag that will fucking fix everything." It did not fix anything, as I was soon to find out. I append the flag, and recompile libzip. idevicerestore throws the same error. I append the flag again, this time by inserting it directly in CMakeLists.txt, and recompile libzip. Again, no dice. It was at this point that I exploded.

Afterwards, I decided to make a Blogger account for the sole purpose of writing this blog post. Wow, I feel like the average early 21st century Internet user! See you all next week, for another episode of "Twist Says Fuck."

Oh crap my iPhone is still in DFU mode.



P.S. For those interested, what finally worked was using idevicerestore on my Chromebook (running GalliumOS 3.0 beta).