• XDA Forums have been migrated to XenForo. To discuss, report bugs and other issues, use this thread.

[Guide] Rooting and unlocking bootloader (bonus) back up DRM

josephnero

New member
Mar 23, 2011
2,174
720
0
Sanford NC
Hi Everyone.I see some members are new to Sony phones and some to unlocked boot loader.So here is a simple guide.
BTW I'm not the developer of any of these methods.that's why I won't post any links for downloads and will redirect you to original threads.
Do it at your own risk

So let's begin.You have either updated your Z5 to MM or still on LP.

.First step is to flash a kernel that can be rooted.If your Kernel is older than december then you are good to go.If not follow these steps.

1.Download the latest Flashtool
http://www.flashtool.net/downloads.php

2.Download 32.0.A.6.200 or any older build for your Z5.(pay attention to download the right firmware. for example you may have E6633 or E6653)

3.Flash it and power on your phone.

4.Download Iovyroot and use it to back up your DRM key.(don't forget to enable USB debugging)
http://forum.xda-developers.com/crossdevice-dev/sony/iovyroot-temp-root-tool-t3349597

5.Copy your DRM keys to a safe back up.(warning:never try to flash another handsets DRM key or you will hardbrick your phone)

6.Update back to MM.You can use Sony PC companion to update if you have Locked bootloader or simply download and flash your latest FTF file

7.Unlock your bootloader now.request keys from here.follow the guide
http://developer.sonymobile.com/unlockbootloader/start-unlocking-your-boot-loader/

8.Now to keep your DRM intact and have root and xposed this is the best choice.Download this tool and patch your kernel
http://forum.xda-developers.com/xperia-z5/development/root-automatic-repack-stock-kernel-dm-t3301605

9.after patching your kernel with your own TA back up just power down your phone.press and hold volume up while plugging USB cable to PC to go to fastboot mode.

10.use this command to flash your new kernel

fastboot flash boot boot.img

11.Download latest SuperSu zip and copy it to your phone or memory card
http://www.supersuroot.com/download.html

12.restart your handset.Keep pressing volume up to go to TWRP recovery.Flash the superSU zip.Now you are rooted with locked bootloader

13.(optional)download and flash Xposed zip http://dl-xda.xposed.info/framework/sdk23/arm64/
 
Last edited:

josephnero

New member
Mar 23, 2011
2,174
720
0
Sanford NC
Fix camera apps FC after updating xposed.

connect your phone to PC with usb.(USB debugging must be on).open ADB shell ans type SU
grant superuser permission to ADB then copy and paste this to ADB and press enter.that's it

/system/bin/dex2oat --runtime-arg -classpath --runtime-arg /system/framework/XposedBridge.jar --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xnorelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=cortex-a53 --instruction-set-features=default --dex-file=/system/priv-app/CameraCommon/oat/arm/CameraCommon.odex --oat-file=/data/dalvik-cache/arm/[email protected]@[email protected]@classes.dex
 
Last edited:
  • Like
Reactions: Kaktusdeutschmann

Aklo01

New member
Mar 10, 2016
46
7
0
many many thanks josephnero.

I've experience with other devices but I find Xperia rooting quite confusing.

Any chance you can also post a brief tutorial on how to return full stock with locked bootloader after having rooted the device?
So we can use OTA updates again.

I suppose it should be:
1) full wipe
2) flash stock rom with flashtool
3) use Iovyroot tool to restore TA (this should automatically relock BL)

but not sure.
 

josephnero

New member
Mar 23, 2011
2,174
720
0
Sanford NC
many many thanks josephnero.

I've experience with other devices but I find Xperia rooting quite confusing.

Any chance you can also post a brief tutorial on how to return full stock with locked bootloader after having rooted the device?
So we can use OTA updates again.

I suppose it should be:
1) full wipe
2) flash stock rom with flashtool
3) use Iovyroot tool to restore TA (this should automatically relock BL)

but not sure.
you mean to unroot and return to full stock?if so yes. make sure to flash the same firmware that you used to back up TA. you can also use The Ta back up tool to restore.no need to full wipe before flashing,you can use wipe option in flashtool
 
Last edited:

devilmaycry2020

New member
Apr 27, 2013
1,373
244
0
Hi Everyone.I see some members are new to Sony phones and some to unlocked boot loader.So here is a simple guide.
BTW I'm not the developer of any of these methods.that's why I won't post any links for downloads and will redirect you to original threads.

So let's begin.You have either updated your Z5 to MM or still on LP.

.First step is to flash a kernel that can be rooted.If your Kernel is older than december then you are good to go.If not follow these steps.

1.Download the latest Flashtool
http://www.flashtool.net/downloads.php

2.Download 32.0.A.6.200 or any older build for your Z5.(pay attention to download the right firmware. for example you may have E6633 or E6653)

3.Flash it and power on your phone.

4.Download Iovyroot and use it to back up your DRM key.(don't forget to enable USB debugging)
http://forum.xda-developers.com/crossdevice-dev/sony/iovyroot-temp-root-tool-t3349597

5.Copy your DRM keys to a safe back up.(warning:never try to flash another handsets DRM key or you will hardbrick your phone)

6.Update back to MM.You can use Sony PC companion to update if you have Locked bootloader or simply download and flash your latest FTF file

7.Unlock your bootloader now.request keys from here.follow the guide
http://developer.sonymobile.com/unlockbootloader/start-unlocking-your-boot-loader/

8.Now to keep your DRM intact and have root and xposed plus locked bootloader this is the best choice.Download this tool and patch your kernel
http://forum.xda-developers.com/xperia-z5/development/root-automatic-repack-stock-kernel-dm-t3301605

9.after patching your kernel with your own TA back up just power down your phone.press and hold volume up while plugging USB cable to PC to go to fastboot mode.

10.use this command to flash your new kernel

fastboot flash boot boot.img

11.Download latest SuperSu zip and copy it to your phone or memory card
http://www.supersuroot.com/download.html

12.restart your handset.Keep pressing volume up to go to TWRP recovery.Flash the superSU zip.Now you are rooted with locked bootloader

13.(optional)download and flash Xposed zip http://dl-xda.xposed.info/framework/sdk23/arm64/
In step 12. You got root with locked bootloader? I don't think so cause any modification in kernel required to have unlock bootloader if not phone got boot loop or won't boot at all
 
  • Like
Reactions: frostmore

josephnero

New member
Mar 23, 2011
2,174
720
0
Sanford NC
In step 12. You got root with locked bootloader? I don't think so cause any modification in kernel required to have unlock bootloader if not phone got boot loop or won't boot at all
Remember this is not a custom kernel.It's your own stock kernel just RIC and Dm protection patched
After step 10 you have locked bootloader with a patched Kernel and recovery.no DM variety to stop root afterwards
 
Last edited:

Aklo01

New member
Mar 10, 2016
46
7
0
you mean to unroot and return to full stock?if so yes. make sure to flash the same firmware that you used to back up TA. you can also use The Ta back up tool to restore.no need to full wipe before flashing,you can use wipe option in flashtool

When I will be rooted I don't think I'll need to "flash the same firmware that I used to back up TA" to restore TA and go back to stock & unrooted.

There will be no need to use an exploit to restore TA.
It will be just a matter of :
dd if=TA.img of=....

and then flash lastest stock ROM.

am I wrong ?
 

Duvel999

New member
Nov 1, 2010
1,536
363
0
If I made a Backup on my Unrooted Z5 MM. 163 with Xperia Backup in settings.

I downgrade. Root my Z5 etc. Update to.. 163 again.

Unlock Bootloader, then Root.
Can I restore that Backup?

Or might that not work?

Sent from my E6653 using XDA-Developers mobile app
 

jugglerpl

New member
Nov 8, 2011
139
18
0
Warsaw
www.xperiasite.pl
This tutorial works and I used it some days ago.

But when you flash kernel with your Ta and Sony release update you must unlock bootloader and wiping system once again to flash new kernel. Update via ota is not recomended. Of course we can flash firmware without kernel in Flashtool, but when I tried mobile notify that new update from .185 to 185 is ready....


Wysłane z mojego E6653 przy użyciu Tapatalka
 

josephnero

New member
Mar 23, 2011
2,174
720
0
Sanford NC
This tutorial works and I used it some days ago.

But when you flash kernel with your Ta and Sony release update you must unlock bootloader and wiping system once again to flash new kernel. Update via ota is not recomended. Of course we can flash firmware without kernel in Flashtool, but when I tried mobile notify that new update from .185 to 185 is ready....


Wysłane z mojego E6653 przy użyciu Tapatalka
Maybe We can extract and patch the kernel then flash it with flashtool?
 

josephnero

New member
Mar 23, 2011
2,174
720
0
Sanford NC
If I made a Backup on my Unrooted Z5 MM. 163 with Xperia Backup in settings.

I downgrade. Root my Z5 etc. Update to.. 163 again.

Unlock Bootloader, then Root.
Can I restore that Backup?

Or might that not work?

Sent from my E6653 using XDA-Developers mobile app
I would strongly recommend to use another back up app.In my experience Sony back up failed many times
 
  • Like
Reactions: Duvel999

josephnero

New member
Mar 23, 2011
2,174
720
0
Sanford NC
When I will be rooted I don't think I'll need to "flash the same firmware that I used to back up TA" to restore TA and go back to stock & unrooted.

There will be no need to use an exploit to restore TA.
It will be just a matter of :
dd if=TA.img of=....

and then flash lastest stock ROM.

am I wrong ?
Honestly I'm not sure but better safe than sorry
 

jackq

New member
Mar 1, 2012
785
709
0
B-B
I currently have (had ;)) UB and root on .163 MM, today decided to update and LB follow this guide.
I download and flash .185 MM via flashtool (without wipes), in meanwhile I unpack kernel from stock .185 and patched it with my TAbackup.img After flash I disconnect usb cable, don't reboot system, pluged again in fastboot mode, open cmd window with adb, pushed patched with my TA backup stock .185 kernel and latest twrp, next i start device and don't let them start fully but first go to recovery, in twrp choose reboot recovery and after that flash latest root package. Then reboot system and everything works exellent.
Now if i think correctly I have latest MM with UB and stock kernel with my DRM and ofcourse root. :D
 
Last edited:
  • Like
Reactions: josephnero

josephnero

New member
Mar 23, 2011
2,174
720
0
Sanford NC
I currently have (had ;)) UB and root on .163 MM, today decided to update and LB follow this guide.
I download and flash .185 MM via flashtool (without wipes), in meanwhile I unpack kernel from stock .185 and patched it with my TAbackup.img After flash I disconnect usb cable, don't reboot system, pluged again in fastboot mode, open cmd window with adb, pushed patched with my TA backup stock .185 kernel and latest twrp, next i start device and don't let them start fully but first go to recovery, in twrp choose reboot recovery and after that flash latest root package. Then reboot system and everything works exellent.
Now if i think correctly I have latest MM with LB and stock kernel with my DRM and ofcourse root. :D
So can we flash kernel from fastboot in current state?I don't think so because our BL is locked now.did you use patched kernel before update or did you have unlocked BL?
 

jackq

New member
Mar 1, 2012
785
709
0
B-B
So can we flash kernel from fastboot in current state?I don't think so because our BL is locked now.did you use patched kernel before update or did you have unlocked BL?
Like i wrote, i had unlocked BL when i start.
I flash MM in flashtool
after that unplug device (dont start system) and flash patched kernel trought adb, flash twrp, and all steps mentioned...
 
Last edited:
Our Apps
Get our official app! (coming soon)
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone