[Xperia Z Original Android Development] Incanity:
*EDIT* - BUGS: Mounting the system r/w with a root explorer, makes the phone reboot.

Hi,

After looking EVERYWHERE on this forum to see if there is a tutorial to upgrade my rooted stock .434 rom to .253 without losing root, I've come across many threads explaining bits and pieces on how to get to .253, and how to get your bootloader and TA partition back in place.

After summoning up some courage, I've decided to try and upgrade my XZ to .253 and rooting it with a bootloader unlock. But it didn't end there. I then tried to relock the bootloader and restore the TA partition using information from many other threads.

The good news is, this worked. I now have:

- Stock ROM

- Root

- DRM Keys intact

- Bootloader LOCKED

- Bootloader unlock allowed = yes

Before explaining step by step how I accomplished this, I'd like to thank the following awesome members of the XDA community:

DooMLoRD , shadowboy23 , krabappel2548 , rickwyatt , DevShaft

And now, the tutorial:

DISCLAIMER: I am not responsible for bricked phones, failed root attempts, heart attacks, or anything else caused by this tutorial. This method worked for me, and I sincerely hope that it will work for everyone else.

Requirements:

-	Flashtool

-	Stock Firmware .253 - The list of unbranded, stock firmwares is in this thread

-	PC Companion

-	Doomlord’s Advanced stock kernel

-	SuperSU zip - also in DooMLoRD's thread

-	Backup-TA 8.0 by DevShaft

-	A strong heart (this process nearly gave me a heart attack)

I assume you already have a rooted stock rom, so I won’t be taking the trouble to explain how to root the .434 firmware.

Step 1:

Backup your TA partition using the Backup-TA 8.0 By DevShaft

Step 2:

Backup EVERYTHING you need. Especially your internal storage and your SD-card, these will both be wiped.

Step 3:

Upgrade your phone using sony’s PC companion to the .253 firmware. Let it boot completely after upgrade, so the NFC Firmware is upgraded.

Step 4:

Use flashtool to unlock your bootloader. <- Reminder: This will wipe EVERYTHING. So make sure you have made your backups!

Step 5:

With the bootloader unlocked, root the firmware by using Doomlord’s method as described HERE.

Step 6:

With flashtool, flash the stock Kernel over the advanced stock kernel.

Make sure you flash ONLY the kernel, not the system partition, this will probably make you lose root.

Step 7:

Now that we’ve got a stock, rooted rom, it is time to restore the TA-backup.

From here on, please double check every step you take, as flashing a wrong TA backup will hard brick your device. Also, this is where the increased heart rate starts ;)

Use TA-Backup 8.0 by DevShaft to restore your TA partition, thus locking the bootloader and restoring your DRM keys.

Step 8:

Suffer from a minor heart attack while waiting for your phone to boot. This took my XZ a while..

Now that it has booted, check if your DRM keys are intact and your bootloader is locked:

First, dial *#*#7378423#*#*

- Service Info

- Configuration

- Check if bootloader unlock allowed = yes

Second, Go back to the service menu.

- Service Tests

- Verify Certificates

- Check if your certs are all there and intact.

If the bootloader status and the DRM keys are all ok, congratulations! you now have stock, rooted, bootloader closed, drm-rich, .253 rom!

If you have any questions, I will try my best to answer them.