[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] honz:
Hello and thank you for all your work [MENTION=4418980]j4nn[/MENTION]

Precursory steps, cleaned up

For any future readers, I have found the additional reading helpful:

- The great adventure of rooting the XZ1C

- Munted's root instructions guide (v3)

- G8441_Customized_NOBA_1211-0104_47.1.A.16.20_R22B

I picked up a new G8441 - XZ1 Compact a few months back but have not had a chance to do much with it - except let it do some updates before I knew any better, my bad. Currently the phone has the 47.1.A.12.34 firmware ... just one version too new to take natively advantage of this unlock method. Here's a screen shot of my starting point.

and . The phone currently has no data or sim card, but is connected to my wifi.

1310-8853_R9B is coming out of France with Customized FR firmware. I've downloaded 47.1.A.2.324_CE1 and 47.1.A.8.49_CE1 for the XZ1 listed at the start of this thread.

Side question: This my 5th Xperia and never has changing market customization affected usability (locally or traveling) - does it matter beyond pre-installed apps? Are there any pre-installed apps / addons that are worth considering?

After reading this thread, the rooted kernel hiding bootloader thread, and the Attest key lost thread I'm hoping I have sense of things (at least to start). To start, I've got the the latest XperiFirm, FlashTool, NewFlasher (v16), MinimalADB, and Sony/Google Fastboot/ADB drivers.

However was was not clear from the beginning whether NewFlasher requires the GordonGate driver -- something got installed and worked properly :D (tested ADB and Fastboot). Maybe one or the other had the flash driver, maybe I installed the GordonGate driver a while back on this computer.

Following the steps from the original post:

1. Mine is a new phone, no backup of user data required.

2. I'm going to try to downgrade one version to the 8.49 CE1 firmware using the instructions in the original post, step 2 - as confirmed by orsonmmz in post #232

--- 8.49 extracted, following on the experience mentioned here , I have removed all .ta (auto-boot, cust-reset, fota-reset, master-reset, osv-restriction, reset-kernel-cmd-debug, reset-non-secure-adb, reset-wipe-reason, simlock) files, and persist_X-FLASH-ALL-C93B.sin. I also removed the appslog, diag, Qnovo, and ssd sin files as they appear to be optional.

--- I extracted the partition.zip file into a folder called partition, the partition.zip file remained.

--- Phone was put into flash mode (off & unplugged --> hold volume-down and plug in USB)

--- Waited until driver was recognized and installed.

Result: System downgraded to 47.1.A.8.49, Customization 1310-7123_R6B -- no headaches at all, plug and chug. All keys remained provisioned through the downgrade.

3. Phone adjustments made: developer tools -> Stay Awake, static background, took snapshots of system config and security windows.

4. Tools installed

5. Renoroot run... 4270 events required for 1 Overwrite, got #.

6. /data/local/tmp/TA-locked.img: 1 file pulled. 5.7 MB/s (2097152 bytes in 0.350s)

I actually performed this twice with a reboot in the middle, just to be sure.

7. I followed the instructions from Sony's Developer Website. Basically an adb reboot bootloader, and then a fastboot command.

8. Same phone adjustments as before, tools installed, renoroot ran (this time for ever) ... Currently at 27000 events to 4 overwrites and still going. This is the 4th time the phone has run renoroot, the previous times it rebooted on me. Wow, 48585 to 6, and we're in. UN-Locked TA pulled, Locked TA written, rebooted.

9. So there we have it, TA has been restored; however, the SOMC keys are NOT PROVISIONED... time to do more stuff

In a panic, I reran renoroot, this time it triggered after around 1500 events and dumped the second TA backup I made via DD. And same result as before (as expected)

Current (last?) Step...

10. The TWRP threw me off a bit, but I followed the XZ1c rooted kernel hiding bootloader thread... flashed G8441_Customized_NOBA_1211-0104_47.1.A.16.20_R22B (no *ta's from the root, no persist, ta in /boot/ remains). I then grabbed boot-G8441-47.1.A.16.20-hideunlock-magisk-19.1.img, and booted to that. Now, am I understanding correctly that this

temporarily

boots the modified kernel, and that if I power down and restart - it boots the original, unpatched kernel? Seems that FOTA is the deciding factor here which I don't care to use (right now).

So, am I getting this right:

--- I boot the -noverity version of the patch, then follow the instructions from post #10 of the XZ1 thread as follows: fastboot boot boot-G8441-47.1.A.16.20-hideunlock-magisk-19.1-noverity

--- go into Magisk Manager, unselect "Preserve...", go and press the Install Magisk button, (no confirmation to install Magisk*.zip is presented), go to patch a boot image file, select the kernel image (same one I booted with)

--- When I go to boot off of the magisk_patched.img file (fastboot boot ....), I get one boot loop and then it boots.

--- I went back, tried to install Magisk, do some other reboots and fastboot boot's to the *-noverity.img file ...

--- Now I just got back into Magisk Manager, it told me 19.1 was installed and to update to 19.3, so I did.

It rebooted, and I get: Rooting Status: DONE, Suntory blobs [ERROR]

If I manually go back and boot with one of the other image files, I get a Rooting Status NOT_DONE and Suntory blobs [READY].

In both cases, both SOMC keys are provisioned.

Just wondering what I may have missed now. Do I need to <fastboot flash> the .img? <fast forward a day, some dd backups/re-flashes later>

... This worked: fastboot flash boot boot-G8441-47.1.A.16.20-hideunlock-magisk-19.1-noverity.img

... as did this: fastboot flash boot boot-G8441-47.1.A.16.20-hideunlock-magisk-19.1.img

---> Is there a difference?

Just went into Magisk, told it to install / upgrade 19.3 via direct install... and now I'm in a boot loop. Cool, so I guess that's not the right thing to do...

Reflashed the previously flashed img and it's back with 19.1.

A few specific questions:

1a. To keep a permanent kernel, is this all one needs to do: <flashboot flash boot boot.-...-noverity.img>?

1b. What about flashing your other kernel with verity enabled?

2. What's the practical difference between the normal img and the noverity.img? (I read about dm-verity and understand what's it's doing - but don't understand the practical implications of it). I flashed both kernel files and see no behavioral differences with the phone.

3. There's talk loosing FOTA ability ... How do I get rid of the system update notifications because I want to stay on Oreo.

4. Is there any benefit in trying to get upgraded to Magisk 19.3? All my attempts through Magisk Manager lead to a boot loop.

Thank you.