[Sony Xperia ZR] gspbeetle:
Edit: Use PRFCreated method for lollipop 5.0.2->5.1.1

Edit: For windows 8/10, you need to enable test mode for S1Boot fastboot driver install, you can also sign it with Zadig afterwards and turn off test mode.

bcdedit.exe -set loadoptions DDISABLE_INTEGRITY_CHECKS
bcdedit.exe -set TESTSIGNING ON
(reboot)

Thanks NeoJeo for the method!

For some reason, my friend's new machine have to use flashtool to create a ftf backup first after updating the official firmware . Using other kernels will fail and creates a bootloop. (Maybe carrier locked? No idea.)

Bootloop can be solved by re-flashing the stock firmware completely and redo all the steps again, so its quite safe.

Stock roms:

You can always download the latest with firmware with xperifirm.

http://xdaforums.com/crossdevice-dev/sony/pc-xperifirm-xperia-firmware-downloader-t2834142

HK stock roms seem to be less bloated.

Old roms for research purpose:

C5503_10.1.1.A.1.310 (HK) (4.1.2)

https://docs.google.com/file/d/0B-WWAl17NsavUWJRZldCZVdpNTQ/edit?pli=1

* (Doomlord rooter for this rom:

http://xdaforums.com/showthread.php?t=2327472)

Pre-rooted 10.4.B.0.569 (4.3.0) rom by Sijav:

http://xdaforums.com/showthread.php?t=2590174

C5503_10.5.A.0.230 (HK) (4.4.2)

https://www.dropbox.com/s/phqyx3awwpjr1ab/C5503_10.5.A.0.230_Generic HK.rar

C5503_10.5.A.0.230 (NORDIC) (4.4.2):

http://xdaforums.com/showthread.php?t=2774540

C5503_10.6.A.0.454 (HK) (5.0.2):

https://drive.google.com/file/d/0B7l5nu0bqYuGWUk3WkpQbm9EQm8/view?usp=sharing

Tools:

Flashtool:

http://flashtool.net/download.html

(Remember to install drivers as well from C:\Flashtool\drivers)

Backup TA:

http://xdaforums.com/showthread.php?t=2292598

or https://www.dropbox.com/s/xjm6t08xy946lee/Backup-TA-9.10.zip

SDK Platfom tools:

http://developer.android.com/

or https://www.dropbox.com/s/lgs2m90p1et87hx/platform-tools.7z

Super SU zip install:

http://download.chainfire.eu/supersu

or

https://download.chainfire.eu/740/SuperSU/BETA-SuperSU-v2.49.zip

Boot.img:

http://xdaforums.com/showthread.php?t=2774540

or

https://www.dropbox.com/s/0n62ripm00u4z78/boot_v8.img

UPDATE FOR 5.0.2, new boot.img:

(ref: http://xdaforums.com/xperia-zr/general/c5502-unlock-bootloader-rom-c5502stock5-t3115901)

https://drive.google.com/file/d/0B7l5nu0bqYuGX19QcUl5VWdKOXc/view

Step by step reference for my friends:

1. download & install flashtool http://flashtool.net/download.html

^if doesnt work, then try https://www.dropbox.com/s/xyk493qa8psydrf/flashtool-0.9.13.0-windows.exe

2. install flashmode and fastboot drivers from C:\Flashtool\drivers

3. plugin your phone, make sure settings->security->unknown source and settings->developer options->usb debugging is checked at all times

(if cant find developer options, go to settings->about phone->build number, keep tapping build number to see what happens)

4. - If your already phone upgraded, then:

4.1 If you want to keep your current kernel for later use, see: http://xdaforums.com/showthread.php?t=2334653)

4.2 download 31x kernel (4.1.2) from http://xdaforums.com/showthread.php?t=2384512

4.3 save it to \Flashtool\firmwares

4.4 open FlashTool.exe, click Flash device -> Flashmode

^ to enter flashmode, either plugin usb without battery or plugin usb with Volume - while your phone is OFF

4.5 select the 31x kernel and downgrade

4.6 kill FlashTool.exe

5. download and run doomlord's rooter from http://xdaforums.com/showthread.php?t=2327472

6. use task manager or cmd to kill adb.exe, if it is still running

- Now you have a rooted phone

7. download and run backup ta from http://xdaforums.com/showthread.php?t=2292598 , keep the zip file for later use

- Backup TA only works with rooted rom

- If you want to use the latest andriod continue below:

7 download the latest firmware with xperifirm and bundle it with flashtool.

8. upgrade / flash your system to the latest version (see step 4, but use the latest firmware file instead)

9. get unlock key from http://unlockbootloader.sonymobile.com/unlock/step1

11. download andriod sdk from google and install http://developer.android.com/

12. open SDK manager, scroll down and check Google USB Driver then click install packages

^ if doesnt work, then try: https://www.dropbox.com/s/lgs2m90p1et87hx/platform-tools.7z

^ USB drivers is also avaible under flashtools/drivers

13. go to \sdk\platform-tools

(replace %key% below with the key from sony's email)

run fastboot.exe -i 0x0fce oem unlock 0x%key% in cmd

or create a plain text file and save it as a .bat with

fastboot.exe -i 0x0fce oem unlock 0x[B][I]%key%[/I][/B] [MENTION=607132]pause[/MENTION]

^ If stuck at 'waiting for device', you can use flashtool.exe to enter 'fastboot mode via adb' (run Flashtool.exe -> Flash device -> fastbootmode

), then re-try the command above

^ while in fastboot mode, your phone screen is off and led is blue

- Now you bootloader is unlocked.

14. put this zip file into your external sd from http://download.chainfire.eu/supers...om/s/sy1vzzq9ygfvqvb/UPDATE-SuperSU-v2.01.zip

15. run Flashtool.exe -> Flash device -> fastbootmode

16. reboot into fastboot mode (via ADB)

17. after led turns blue, select kernel to flash and choose boot.img from http://www.mediafire.com/download/4bs9zy3z4sl1lvl/boot.img

^ if doesnt work, try: https://www.dropbox.com/s/y5is541wd5lck79/boot.img

18 click reboot device into system while pressing Volume +

- if LED does not turn purple at all, something must be wrong

- press Volume +

as long as but NOT before

the LED turn purple.

^ return to step 4 if needed, bootloader may be not properly unlocked.

19 select install zip -> choose zip from external sdcard

^ Volume+ - is up and down, Power is select

20 confirm

21 go to advance -> power off

22 remove battery and plugin usb to enter flash mode

^ Flashtool.exe should show the phone is connected in flash mode

^ But there seems to be a time limit where CM 10.1 remount itself automatically with the wired blue thing popping up and then crash

23 return to Flashtool.exe -> Flash device -> Flashmode

24 choose the .ftf either from the one in step 8 or the one you have downloaded

25 Uncheck anything on the "Wipe" colon

26 Check everything on the "Exclude" colon except "KERNEL"

^ You should now only have kernel.sin and loader.sin on the content colon

27 FLASH!

- if bootloop occurs, return to step 4 lol

^ alternatively you can just redo step 24, but this time "Wipe" everything and "Include" everything. If it boots, then jump right to step 14 and retry installing the zip

28 Install super su in google play

^ first boot may need battery in and usb removed

29 (optional) Re-run backup-ta to restore the zip from step 7 for Relocking bootloader (and check for rooted at the same time)

- if backup ta failed because of no su rights, return to step 4 lol

EDIT: do not re-lock bootloader if using the new img

EDIT:

Upgrading should keep your settings and stuff, unless something went wrong that you have to wipe data for a clean install.

Quick check list:

1. Most Important. Make sure you still have your bootloader backups.

Run Backup-TA to backup your current bootlocker if needed (new version here:http://xdaforums.com/showthread.php?t=2292598). Backup-TA only works on rooted.

2. If you somehow lost it, re-obtain your unlock key from http://unlockbootloader.sonymobile.com/unlock/step1

3. Have your Flashtool and SDK ready (https://www.dropbox.com/s/xyk493qa8psydrf/flashtool-0.9.13.0-windows.exe, https://www.dropbox.com/s/lgs2m90p1et87hx/platform-tools.7z)

4. If you need the stock firmware from your carrier, remember to clear contents in something like: C:\ProgramData\Sony Ericsson\Update Engine\db\13740270\blob_fs and/or C:\ProgramData\Sony Mobile\Update Engine\db\13740270\blob_fs (or something similar in %appdata% for windows XP)

5. You can use any ADB backup tool or Sony Companion to backup your settings, best timing is right after OS update but before rooting.

To do:

1. Either upgrade with Sony Companion and use Flashtool -> SEUS Decrypt, or download by XperiFirm to create your own firmware (Will take a while to load depending on the power level of your PC.)

or just use the firmware people uploaded

2. open Flashtool.exe -> Flash device -> fastbootmode

3. reboot into fastboot mode (via ADB)

4. Unlock you bootlocker by running "fastboot.exe -i 0x0fce oem unlock 0x%key%" (%key% is your unlock key from Sony's email)

^ (Last time I checked, some people say they need to update SDK first.)

^ (unlock key may change after new firmware is flashed)

^ you need to enter fastboot mode via ADB first, or it will get stuck at 'waiting for device'

5. select kernel to flash and choose boot.img

6. click reboot device into system while pressing Volume + (press Volume + after the LED turn purple)

7. select install zip -> choose zip from external sdcard -> your-su-zip-file (http://download.chainfire.eu/supersu)

^ 'Volume+' 'Volume-' and 'Power'.

8. go to advance -> power off

^ If you get a boot loop, simply remove battery and plugin usb cable to enter flashmode and re-flash the new firmware again.

^ remember to re-enable "Usb debugging" under "Developer options"

^ tap "About phone" -> "Build number" 10 times to unlock "Developer options"

[/hide]