Dirty ROOT solution - for unlocked BL

Search This thread

nilezon

Senior Member
Jan 30, 2008
342
223
I have ported the Z5 Compact root method to Z5.

Please note that both recovery.img and kernel img are different from the Z5 Compact thread. Do not use recovery or kernel for Z5 Compact on your regular Z5 phone.

Disclaimer
I am well aware that this is not the nicest method of rooting, but I got the phone a few hours ago and haven't got the time to put together a better way.

Credits
@Tommy-Geenexus for Zombie kernel
@AndroPlus for Z5 recovery and guidance :good:
@Chainfire for SuperSU

Guide

First, you need to unlock you bootloader (I know, I know, now stop weeping :crying::crying::crying:)

A rooted device does not boot using default kernel, so you need to install an insecure kernel.
I have repacked stock Z5 (32.0.A.4.11) kernel to disable Sony RIC, dm verity, make it insecure, etc.
Flash using:
Code:
fastboot flash boot z5_stock_fixed.img

Reboot your phone using:
Code:
fastboot reboot
And verify that it works as expected.

Now, reboot your phone to bootloader again (see info how to at the end of post).
Then issue:
Code:
fastboot boot recovery.img
This recovery is partly broken, but it works well enough to install root.
Thanks to @AndroPlus for TWRP.

The phone will boot to a black screen, but you can connect to it using ADB.
You need to manually mount the system and userdata partition by issuing:
Code:
adb shell mount /dev/block/platform/soc.0/by-name/system /system
adb shell mount /dev/block/platform/soc.0/by-name/userdata /data

If you get this error:
mount: mounting /dev/block/platform/soc.0/by-name/system on /system failed: No such file or directory
You probably just need to wait a while and try again. You usually have to wait ~120 sec for the mount to work. Be patient.

If you got /system and /data to mount, you can now push SuperSU to the phone and install it:
Code:
adb push UPDATE-SuperSU-v2.46.zip /data/media/0/
adb shell twrp install /data/media/0/UPDATE-SuperSU-v2.46.zip
adb shell rm /data/media/0/UPDATE-SuperSU-v2.46.zip

If it all works, just reboot and enjoy root:
Code:
adb reboot

Files
z5_stock_fixed.img
recovery.img (for Z5)

Extra info
Boot to bootloader by adb command:
Code:
adb reboot bootloader
or by turning off the phone, and then hold down VOL UP while plugging in the USB cable.
 

rohorubo

Senior Member
Nov 27, 2008
898
341
Bottmingen
If you unlock yourbootloadeR TA partition it lost forever! You can't get it back and things like x-reality won't work anymore.

Gesendet von meinem E6653 mit Tapatalk
 

koziakauzu

Senior Member
May 7, 2007
156
30
Hong Kong
We know that, but it must have a way (yet to find?) to backup and restore the TA partition just like previous devices (it was possible on Z and Z1, don't know about the others)

Sent from my E6653
 

gwiqu

Senior Member
Jun 2, 2012
154
19
are there unlocked bootloader Z5s? how do we check if our bootloader is locked?
 

mindstormsguy

Member
Oct 6, 2012
36
9
I ran through these instructions, and I now have root privileges, but I can't write to /system. Is there something I missed to enable this, or does this just not work?

Sent from my E6653 using Tapatalk
 

nilezon

Senior Member
Jan 30, 2008
342
223

mindstormsguy

Member
Oct 6, 2012
36
9
Operation not permitted for me too. And I also tried reinstalling the kernel before posting.

Sent from my E6653 using Tapatalk
 
I see I have this problem too.
Using terminal cmd

# mount -o rw,remount /system

replies

mount: Operation not permitted

Also not possible with Root Explorer

In this way it's also not possible to install Busybox.
I reinstalled kernel but didn't change anything.

Hmm. Same for me. Maybe Sony RIC or SELinux is not fully disabled after all.

@DooMLoRD:
Hello my friend,
Long time no see - hope you are doing well.
Am I wrong if I remember this "half" root once in a DooMKernel? Cannot find it but I'm sure you know the reason.
Thanks
 

nilezon

Senior Member
Jan 30, 2008
342
223
It looks like Zombie kernel doesn't have changes like this:
https://github.com/AndroPlus-org/an...mmit/f0544c997bb22da293005ffcaaeeeb4a55394c8d
I think he can improve this current method...

I don't think it is needed.

Setting:
CONFIG_SECURITY_SONY_RIC=n
in kernel config seem to solve the remount rw problem.
It's much cleaner to remove Sony RIC module this way, than just patching it, IMHO.

It's sad this can't be done by just repacking stock ramdisk.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 32
    Recover DRM credentials

    Hi everyone,

    in the meanwhile I was able to extract the Sony application credentials from another Sony device and I was able to write a wrapper library in order to inject them into the secd deamon.
    This will bring you back everything which is protected by Sony app credentials, e.g. X-Reality, enhanced camera function, Sony updates etc.
    This package needs SuperSU installed as it uses supolicy to patch the SE policy

    For now I have created just a package for the Z5 dual, but I am working on a universal solution.

    Just flash the attached kernel package to your device with fast boot as usual.
    Afterwards delete the contents of /data/credmgr. That's all.

    Let me know if it works for you.
    17
    I have ported the Z5 Compact root method to Z5.

    Please note that both recovery.img and kernel img are different from the Z5 Compact thread. Do not use recovery or kernel for Z5 Compact on your regular Z5 phone.

    Disclaimer
    I am well aware that this is not the nicest method of rooting, but I got the phone a few hours ago and haven't got the time to put together a better way.

    Credits
    @Tommy-Geenexus for Zombie kernel
    @AndroPlus for Z5 recovery and guidance :good:
    @Chainfire for SuperSU

    Guide

    First, you need to unlock you bootloader (I know, I know, now stop weeping :crying::crying::crying:)

    A rooted device does not boot using default kernel, so you need to install an insecure kernel.
    I have repacked stock Z5 (32.0.A.4.11) kernel to disable Sony RIC, dm verity, make it insecure, etc.
    Flash using:
    Code:
    fastboot flash boot z5_stock_fixed.img

    Reboot your phone using:
    Code:
    fastboot reboot
    And verify that it works as expected.

    Now, reboot your phone to bootloader again (see info how to at the end of post).
    Then issue:
    Code:
    fastboot boot recovery.img
    This recovery is partly broken, but it works well enough to install root.
    Thanks to @AndroPlus for TWRP.

    The phone will boot to a black screen, but you can connect to it using ADB.
    You need to manually mount the system and userdata partition by issuing:
    Code:
    adb shell mount /dev/block/platform/soc.0/by-name/system /system
    adb shell mount /dev/block/platform/soc.0/by-name/userdata /data

    If you get this error:
    mount: mounting /dev/block/platform/soc.0/by-name/system on /system failed: No such file or directory
    You probably just need to wait a while and try again. You usually have to wait ~120 sec for the mount to work. Be patient.

    If you got /system and /data to mount, you can now push SuperSU to the phone and install it:
    Code:
    adb push UPDATE-SuperSU-v2.46.zip /data/media/0/
    adb shell twrp install /data/media/0/UPDATE-SuperSU-v2.46.zip
    adb shell rm /data/media/0/UPDATE-SuperSU-v2.46.zip

    If it all works, just reboot and enjoy root:
    Code:
    adb reboot

    Files
    z5_stock_fixed.img
    recovery.img (for Z5)

    Extra info
    Boot to bootloader by adb command:
    Code:
    adb reboot bootloader
    or by turning off the phone, and then hold down VOL UP while plugging in the USB cable.
    15
    Here is a new stock kernel boot.img with DM_VERITY and SONY_RIC disabled
    This is archived by changing just two files in the ramdisk:

    • fstab.qcom
      remove "verify" from the line for /system (disables DM VERITY)
    • init.sony-platform.rc
      add "write /sys/kernel/security/sony_ric/enable 0" (disable RIC)

    I also created a TWRP recovery image for the Z5 dual with the stock kernel, so you can easily flash SuperSU and xposed from the GUI

    For now you have to enter recovery still with fastboot, but when I have some time I will adapt the scripts from dual recovery for other xperias in order to access it without fastboot.

    BTW: I also have already some ideas for a hack to get the functions back, which you lost by unlocking the bootloader (X-Reality etc). But it will take a little bit more time to implement it.

    Cheers,
    Tobias
    13
    The final version for all Z5 without changing the kernel :D

    Finally I managed to overcome the SE Linux issues and was able to create a version wich does not required any change in the kernel package anymore.
    You can just flash it with recovery :D

    Let me know if it works for you, then I will open a new thread for this.

    Cheers,
    Tobias
    13
    As CLShortFuse has pointed out there is now a new dedicated thread for the DRM topic.

    Regarding the kernel I think the only thing left is to integrate recovery in order to have to start it via fastboot every time.
    I will start to work on this in the next days and probably provide a kernel kitchen in order to automate the following steps for new kernel packages:

    - Enable changes to /sytem
    I.e. disable dm verity and Sony RIC

    - Integrate TRWP recovery

    With this you will be able to update the kernel for your device on each update and don't have to wait until someone does the change
    So stay tuned ;)