How to Root XZ2 (probably also XZ2c) in Android 10

Search This thread

craigary

Member
Apr 24, 2016
5
10
Chongqing
Android 10 comes earlier than expected, but there's no twrp to flash Magisk to gain root access. I tried to use SAR method to patch boot image, and it actually worked:

Requirements:
- A PC with ADB environment setup. * If you are using macOS, try to use a Virtual machine instead.
- XperiFirm to download Android 10 firmware.
- Magisk Manager App.
- unsin.exe program to extract sin file. Download here.

Instructions:
1. download the latest Android 10 firmware from XperiFirm, the current one is 52.1.A.0.532
2. open the downloaded folder and find boot_X-FLASH-ALL-B6B5.sin file. it may vary on XZ2C, but it surely will start with `boot_X-FLASH-ALL` .
3. drag the boot_X-FLASH-ALL-B6B5.sin file over unsin.exe to extract boot image, then you will get boot_X-FLASH-ALL-B6B5.img in the same directory.
4. Copy boot_X-FLASH-ALL-B6B5.img into your phone.
5. Install Magisk manager app, and make sure your phone is connected to the internet
6. Press Install → Install → Select and Patch a File, and select boot_X-FLASH-ALL-B6B5.img
7. Copy the patched image from your device to your PC, then flash it with fastboot command:

Code:
fastboot flash boot_a magisk_patched.img
fastboot flash boot_b magisk_patched.img

fastboot reboot

after reboot the devices, your XZ2 is should be rooted, but it probably not pass SafetyNet Check, you can use MagiskHide Props Config Module to fix it.

I can't find the way to leave the boot image and patched boot image down below as the attachments, but even if I did, I still suggest to do it manually, just in case I am an idiot and it might broke your phone.
 
Last edited:

cyberwytch

Senior Member
Jul 24, 2015
62
38
Samsung Galaxy S22
Thanks for posting this! Figured I'm chime in with my experience:
1. I'd recommend wiping userdata when upgrading to Android 10 - I don't know if this is strictly necessary, but I do know that I haven't experienced the unresponsive fingerprint sensor issue others have mentioned, or any other issues.
2. If you want to use Xposed modules like GravityBox, don't install EdXposed! The versions in the Magisk stable repository are not compatible with Android 10 and will bootloop, and even the beta version 0.4.6.0 from https://github.com/ElderDrivers/EdXposed/releases doesn't work with any module I tried.
3. Fortunately, https://taichi.cool/ works perfectly with GravityBox! Install it along with its Magisk module, and then install GravityBox Q beta 6 from https://forum.xda-developers.com/xposed/modules/app-gravitybox-v10-0-0-beta-1-android-10-t3974497.
 

Klaus N.

Senior Member
Oct 14, 2012
1,300
692
Nuremberg
@everyone who is interested in getting EdXposed working with Android 10

You need to add the following Magisk modules:
1. Riru - Core 19.6 from here
2. EdXposed-SandHook-0.4.6.1 from here (not the YAHFA version!)

Further you need to install the most current Xposed Manager app from here (the default Xposed Installer app won't work, so deinstall it!).

After a soft reboot, it should work :good:

Most probably it'll break Safety Net (have a look inside Magisk Manager). As a workaround, you have to open Xposed Manager and black-list the following:
- Google PlayStore
- Google Play Services
- Google-Services-Framework

Reboot system

Done!

> Apply your modules (maybe not every module will work. I have successfully tested AFWall+ and XprivacyLUA)

@serajr
Thanks a lot for your kind help to get this working :highfive:
 

PerfectJam

Senior Member
Jan 11, 2013
68
10
@everyone who is interested in getting EdXposed working with Android 10

You need to add the following Magisk modules:
1. Riru - Core 19.6 from here
2. EdXposed-SandHook-0.4.6.1 from here (not the YAHFA version!)

Further you need to install the most current Xposed Manager app from here (the default Xposed Installer app won't work, so deinstall it!).

After a soft reboot, it should work :good:

Most probably it'll break Safety Net (have a look inside Magisk Manager). As a workaround, you have to open Xposed Manager and black-list the following:
- Google PlayStore
- Google Play Services
- Google-Services-Framework

Reboot system

Done!

> Apply your modules (maybe not every module will work. I have successfully tested AFWall+ and XprivacyLUA)

@serajr
Thanks a lot for your kind help to get this working :highfive:

Hello, thanks for this little tutorial !

However, on another thread, ppl aren't singing the same tune ! Look at this answer that I get. @Ænimal explained me that YAHFA version should be better, especially if I want to use XPrivacyLUA.

I guess I should follow your instruction, but I downgraded my XZ2C to Android 9 from 10. I don't know if it will work as you.

I tried with this version of EdXposed : magisk-EdXposed-SandHook-v0.4.6.0_beta.4471.-release.zip and after installed Riru succesfully, I installed SandHook v0.4.6.0 and I get a bootloop issue on my phone.

So I guess I have to try SandHook v0.4.6.1 and if it doesn't work I should try YAHFA v0.4.6.1.
 

serajr

Recognized Developer / Recognized Themer
Apr 21, 2011
5,065
18,697
São Paulo - SP
Hello, thanks for this little tutorial !

However, on another thread, ppl aren't singing the same tune ! Look at this answer that I get. @Ænimal explained me that YAHFA version should be better, especially if I want to use XPrivacyLUA.

I guess I should follow your instruction, but I downgraded my XZ2C to Android 9 from 10. I don't know if it will work as you.

I tried with this version of EdXposed : magisk-EdXposed-SandHook-v0.4.6.0_beta.4471.-release.zip and after installed Riru succesfully, I installed SandHook v0.4.6.0 and I get a bootloop issue on my phone.

So I guess I have to try SandHook v0.4.6.1 and if it doesn't work I should try YAHFA v0.4.6.1.
I've always used to install YAHFA builds till android 9, with no issues. So, while you're on android 9, YAHFA is the answer!
SandHook builds, on android 10, FOR NOW, seem to cause less error than YAHFA (at least in the logs - verbose/modules), that's why I'm using it.
But, as soon as EdXposed's dev releases an android 10 YAHFA fixed version, I flash it!
 
  • Like
Reactions: Klaus N. and TiTiB

PerfectJam

Senior Member
Jan 11, 2013
68
10
@everyone who is interested in getting EdXposed working with Android 10

You need to add the following Magisk modules:
1. Riru - Core 19.6 from here
2. EdXposed-SandHook-0.4.6.1 from here (not the YAHFA version!)

Further you need to install the most current Xposed Manager app from here (the default Xposed Installer app won't work, so deinstall it!).

After a soft reboot, it should work :good:

Most probably it'll break Safety Net (have a look inside Magisk Manager). As a workaround, you have to open Xposed Manager and black-list the following:
- Google PlayStore
- Google Play Services
- Google-Services-Framework

Reboot system

Done!

> Apply your modules (maybe not every module will work. I have successfully tested AFWall+ and XprivacyLUA)

@serajr
Thanks a lot for your kind help to get this working :highfive:

Hell yeah ! This method worked for me !

I have a XZ2C (H8324) on Android 9 (build 52.0.1.8.131), and I follow step by step your tutorial, and everything worked like a charm !

I installed XPrivacyLua, it seems working. I'll post here if I have any issue to report !

Thanks !
 

maricn

Member
Jan 4, 2020
10
3
Backup TA

Thank you for your post :)

Sorry for going offtopic, but can someone give info on how to safely backup TA? I spent two days but couldn't find any info on how to do it on (at the moment, latest) stock Android 10 (52.1.A.0.532) on H8324 (XZ2c).

The way I understand for this root procedure to work, I need to unlock bootloader, and that means losing DRM keys. Is there any info on how to restore bootloader and DRM keys after I finish rooting my device?

I tried to:
1) Downgrade to stock Android 8.
2) Use backupTA_v2 or FlashTool to backup TA.
But that doesn't work.
 
Last edited:

PerfectJam

Senior Member
Jan 11, 2013
68
10
Thank you for your post :)

Sorry for going offtopic, but can someone give info on how to safely backup TA? I spent two days but couldn't find any info on how to do it on (at the moment, latest) stock Android 10 (52.1.A.0.532) on H8324 (XZ2c).

The way I understand for this root procedure to work, I need to unlock bootloader, and that means losing DRM keys. Is there any info on how to restore bootloader and DRM keys after I finish rooting my device?

I tried to:
1) Downgrade to stock Android 8.
2) Use backupTA_v2 or FlashTool to backup TA.
But that doesn't work.

Hello there,

If you unlock your bootloader on Android 8, DRM keys will be lost on Android 8 so you'll lost camera definitely.

However, on Android 10 and 9, you won't lost DRM keys. Take care, you'll loose camera preview on Android 9 with this version of build and lower : 52.0.A.3.84.
So better to upgrade at least to Android 9, and the lower firmware where camera isn't bugged at all when you unlock bootloader is Android 9 (52.0.A.8.131).

Conclusion : for rooting your device, you need to unlock your bootloader. If you're running on Android 10 (build 52.1.A.0.532) then, everything will be ok, I did it myself and everything worked fine.

If you need more help on how to downgrade your firmware, just let me. Personally, I didn't like Android 10 so I came back to Android 9 (52.0.A.8.131)
 

DUMIY

Member
Dec 27, 2012
18
3
So, if unlocking bootloader on android 10 we won't lose the DRM keys or any other functionality?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    Android 10 comes earlier than expected, but there's no twrp to flash Magisk to gain root access. I tried to use SAR method to patch boot image, and it actually worked:

    Requirements:
    - A PC with ADB environment setup. * If you are using macOS, try to use a Virtual machine instead.
    - XperiFirm to download Android 10 firmware.
    - Magisk Manager App.
    - unsin.exe program to extract sin file. Download here.

    Instructions:
    1. download the latest Android 10 firmware from XperiFirm, the current one is 52.1.A.0.532
    2. open the downloaded folder and find boot_X-FLASH-ALL-B6B5.sin file. it may vary on XZ2C, but it surely will start with `boot_X-FLASH-ALL` .
    3. drag the boot_X-FLASH-ALL-B6B5.sin file over unsin.exe to extract boot image, then you will get boot_X-FLASH-ALL-B6B5.img in the same directory.
    4. Copy boot_X-FLASH-ALL-B6B5.img into your phone.
    5. Install Magisk manager app, and make sure your phone is connected to the internet
    6. Press Install → Install → Select and Patch a File, and select boot_X-FLASH-ALL-B6B5.img
    7. Copy the patched image from your device to your PC, then flash it with fastboot command:

    Code:
    fastboot flash boot_a magisk_patched.img
    fastboot flash boot_b magisk_patched.img
    
    fastboot reboot

    after reboot the devices, your XZ2 is should be rooted, but it probably not pass SafetyNet Check, you can use MagiskHide Props Config Module to fix it.

    I can't find the way to leave the boot image and patched boot image down below as the attachments, but even if I did, I still suggest to do it manually, just in case I am an idiot and it might broke your phone.
    6
    @everyone who is interested in getting EdXposed working with Android 10

    You need to add the following Magisk modules:
    1. Riru - Core 19.6 from here
    2. EdXposed-SandHook-0.4.6.1 from here (not the YAHFA version!)

    Further you need to install the most current Xposed Manager app from here (the default Xposed Installer app won't work, so deinstall it!).

    After a soft reboot, it should work :good:

    Most probably it'll break Safety Net (have a look inside Magisk Manager). As a workaround, you have to open Xposed Manager and black-list the following:
    - Google PlayStore
    - Google Play Services
    - Google-Services-Framework

    Reboot system

    Done!

    > Apply your modules (maybe not every module will work. I have successfully tested AFWall+ and XprivacyLUA)

    @serajr
    Thanks a lot for your kind help to get this working :highfive:
    2
    Hello, thanks for this little tutorial !

    However, on another thread, ppl aren't singing the same tune ! Look at this answer that I get. @Ænimal explained me that YAHFA version should be better, especially if I want to use XPrivacyLUA.

    I guess I should follow your instruction, but I downgraded my XZ2C to Android 9 from 10. I don't know if it will work as you.

    I tried with this version of EdXposed : magisk-EdXposed-SandHook-v0.4.6.0_beta.4471.-release.zip and after installed Riru succesfully, I installed SandHook v0.4.6.0 and I get a bootloop issue on my phone.

    So I guess I have to try SandHook v0.4.6.1 and if it doesn't work I should try YAHFA v0.4.6.1.
    I've always used to install YAHFA builds till android 9, with no issues. So, while you're on android 9, YAHFA is the answer!
    SandHook builds, on android 10, FOR NOW, seem to cause less error than YAHFA (at least in the logs - verbose/modules), that's why I'm using it.
    But, as soon as EdXposed's dev releases an android 10 YAHFA fixed version, I flash it!
    2
    Sorry for my ignorance but I used to mod my phone till I bought a Sony. Which differences are there?
    Don't worry, no one can know everything

    In the past there was a DRM system integrated
    Unlocking the phone removed the keys and killed some features
    In the past was it camera, Sony PS controller, color manipulation of videos, the Sony store, dynamic vibration
    Only stock stuff

    In 8 , 9 , and 10 they removed more and more of the DRM key dependency
    Means more and more stock features still just work after unlocking

    If you use a custom ROM it wouldn't bother you
    Just stock firmware stuff

    Since the Xperia 1 / 5 you can also lock the bootloader again in the phone
    2
    Netflix only SD, Spotify don't use certs.

    Sent from my Sony Xperia 1!

    Okay, i can really live with that, so if i unlock my bootloader will these things really still work?
    HDR on display
    stereo sound
    and camera quality is staying the same as before.

    I hope you can help me, but i also want to ask if this rooting method (without twrp) really is safe
    and can i still receive Sony's updates?

    Thank you really much.:)