[Sony Xperia XZ ROMs, Kernels, Recoveries, & Other ] knoxploration:
I've never changed the ROM on a Sony device before, and am struggling to find any instructions on how to do so. I need to revert to my XZ Dual (F8332) as my current Pixel 2 XL has multiple hardware and software issues I can't afford to fix right now.

The Pixel can't even make it through a single day without multiple recharges, its compass is permanently off by ~90 degrees and can't be recalibrated, one of the speakers is blown and badly distorted, and my mobile connection is usually only 2.5 or 3G even though the same SIM in my XZ Dual is 4G all of the time in the same location.

That plus the fact it's abandoned by Google and I can't use a third-party ROM to keep it up to date on security patches mean it's time to abandon it. (I was lied to by the seller years ago who sold me a permanently-locked Verizon phone as an unlocked, unbranded one which I didn't realize until a few months ago when I tried to switch to a third-party Android 11 ROM with newer security patches. Pro tip: Don't buy from swingcomputers on eBay; they're scam artists.)

Anyway, I'm extremely grateful that anyone is still making ROMs for the XZ Dual and am hopeful that this ROM will save me having to go through the pain of jumping back multiple Android versions, in the process not just having to relearn the UI and lose many features, but also exposing myself to many years of unpatched security exploits.

I really hope some other kind soul can point me in the right direction to figure out how to do so, though. Right now, I'm lost in a painful world of vague guides that don't seem to contain half of the information I need.

* I presume I need to unlock the bootloader, and I can get Sony's Unlock Bootloader page to give me an unlock code, and the phone to show that bootloader unlock is allowed, but their worthless instructions don't tell me where to put that code to actually unlock it. If I enter "adb reboot bootloader" the phone restarts but nothing ever appears on the screen and neither adb or fastboot can communicate with it until I pull the USB cable and power-cycle the phone, I presume because it's not yet unlocked.

* I presume I need to install TWRP next, but the instructions for the XZ Dual have a long, rambling "Note about Sony Devices" that tells me I need to use something called extractelframdisk, but don't actually tell me how to use it, and nor does the github it's linked from. Is this something I flash, and if so where in the process / how do I do it? If so, do I flash it before TWRP or after, and do I reboot in between or not?

I'm not sure what else I need to know beyond that, because I've not managed to come even close to getting past these first two steps, and can't find a single guide that tells me *everything* I need to do in one place.

Would anybody be able to point me to a detailed guide that I can follow, please? I've installed ROMs on multiple other devices before, but not for years and never for anything that had to be unlocked, only for tablets which were already unlocked or switching between official first-party ROMs on locked devices. I've spent hours and hours on this and am no closer to getting anywhere.