• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[GUIDE] All-In-One noob friendly guide for xperia X (Root/Bootloader/Rom)

Is my guide any helpful?


  • Total voters
    44
Search This thread

FoxTheLegend

Senior Member
Feb 5, 2017
413
110
Athens
[UPDATE]: USE THIS ONLY FOR NOUGAT 7 OR 7.1! THERE IS A DIFFERENT GUIDE FOR ANDROID OREO!
https://forum.xda-developers.com/xperia-x/how-to/root-xperia-x-f5122-android-n-34-2-2-47-t3594502 (Written by YasuHamed, not me!)

If you are not interested in android Oreo, or you want to go back to Nougat, this guide is still valid! :) [End of Update]

This is a guide for newbies or for people that are simply confused. If you have any questions, you can always ask me, and I will reply. but please make sure you haven't made mistakes and do not ask about things that are already stated here. Let's go!


BEFORE DOING ANYTHING, NOTES


-make sure you have installed ADB : https://forum.xda-developers.com/showthread.php?t=2588979
-make sure ADB can read your phone with the correct drivers installed. If you have trouble with that, read "DRIVERS" section
!It is absolutely necessary to install the drivers correctly!
-Backup your stuff if you have any, you will need to delete everything from the phone
-Enable USB debugging
-Note: some of these instructions apply to Windows OS only!
-Note: links to downloads have been shortcutted as much possible to make it easier for you!
-Find some stock roms here! https://forum.xda-developers.com/xperia-x/how-to/sonyx-f5121-downgrade-8-0-0-to-7-1-1-to-t3754986
(Credit: HEKER510)
-Warning: you will lose your warranty!
-I am not responsible for any damage done to your device.


BACKUP DRM KEYS (OR WORKAROUND)


You may want to unlock your bootloader. If you unlock it without backing up the DRM keys, you will lose them. I did that mistake and I regret it. If you already did, there is an alternative solution, skip to step 8.
1) If you are running android 7 nougat, you will need to downgrade to MM. If you are running MM, skip to step 7.
2) You will need to wipe everything before rolling back, so if you have any data back it up
3) Download any stock MM 6.0.1 firmware for the xperia X. You can find one here : https://mega.nz/#!1xRj2CYS Decryption key: !qBVi7yky8AL84eUF3bpTTGQ2YmN0ePCjc-eSDZGIZCI
Watch out: if you have the dual SIM model, F5122, you need to download accordingly!
For more firmwares, check "BEFORE DOING ANYTHING"
4) Download the latest flashtool: http://www.flashtool.net/downloads.php
Upon installation, tick on fastboot, flashmode drivers! If it didn't ask you, go to the installation folder and run Flashtool-drivers.exe. Please read "DRIVERS" section!
5) Flash the .tft file
How to flash?
0. Go to "C:\Users\[Your PC Name]\.flashTool\firmwares" , and put your firmware .ftf file in there!
1. Open Flashtool and click on the lightning bolt icon (first one from the left)
2. In the prompt, choose flashmode.
3. Under firmware, click on the version you put (It should probably only be one option)
4. Under wipe , tick everything. Under the others, do not make any changes.
5. Click "Flash"
6. When the popup appears, connect your device. It needs to be powered off, and connected while you are holding the
"volume down" button.
7. Wait for it to finish.
8. Done. Boot up the device, it might take some time to open so don't worry.
6)If your phone bootloops, try flashing again or a different firmware and make sure you followed the steps correctly.
7) Once your phone successfully boots android MM, use Dirtycow to get your DRM keys out: https://forum.xda-developers.com/crossdevice-dev/sony/universal-dirtycow-based-ta-backup-t3514236
8) If you unlocked the bootloader before backing up your keys, you can use DRM kernel fix. You can get it here: https://forum.xda-developers.com/xperia-x/development/kernel-drm-fix-nougat-t3530849 Before using it check out the custom rom that includes this fix and other things.

UNLOCK BOOTLOADER

This is relatively easy and you can follow official sony instructions to do it.

1) Go to your phone settings, developer options, and enable OEM unlock
"But there is no developer options!" -Go to the bottom of your settings, system, about phone, and tap multile times on "Build Number", also at the bottom.
2) If you haven't already , install ADB fastboot and configure drivers (Link on top )
3) Follow the steps on the Sony website to get your unlock code: https://developer.sonymobile.com/unlockbootloader/email-verification/
4) After unlocking, a warning message on boot is normal!

INSTALL RECOVERY

Installing TWRP on your xperia X is very important, since you can flash zips and img files so easily, plus wipe, backup and other features.

1) Download the TWRP .img file: https://androidfilehost.com/?w=files&flid=197369 (Credit: eagleeyetom )
2) Make sure you have USB debugging enabled
3) Open your downloaded twrp folder
4) Run CMD in that folder (shift + right click inside the folder, Open CMD here )
5) Connect your Xperia X to your PC
6) Type these lines:

adb reboot bootloader

fastboot flash recovery recovery.img [where recovery.img is your twrp file name]

fastboot reboot

7) If no errors, twrp is now installed. Once your phone boots , turn it off,. To access TWRP recovery hold power button and volume down button until the TWRP menu appears.

STOCK ROM, ROOT

If you just want to root and not interested in additional features and tweaks, you can simply flash SU through TWRP to get your phone rooted.
Note: Current best stock ROM available: 7.1.1 (252) - better features than older ver, and good battery life.

0) Install your desired stock firmware using the exact same previous instructions, (under DRM section) with flashtool.
1) Download SuperSu
Or magisk, using YasuHamed guide mentioned on top, but I have not tested with anything other than Oreo 8.0
Use magisk if you want more stability / root features (like hide root from apps, modules )

2) copy it anywhere on your phone
3) Run TWRP
4) Tap on install
4) Flash the file
5) Reboot, you are now rooted
6) Insert your DRM keys if you have them


Custom ROMS

After unlocking the bootloader and installing TWRP this is the best way to go in order to get full root, tweaks.
https://forum.xda-developers.com/xperia-x/development/rom-xperia-x-pexorom-v1-0-0-f5122-f5121-t3590552
^ This is a very good custom ROM made by prmk74. You can see its features in his thread.
1) Download the rom and copy it to your phone
2) Run TWRP
note: It is recommended to wipe dalvik, cache, data ( your storage partition doesn't need to be wiped)
3) Tap install, find your downloaded file and execute
note: It is recommended to wipe dalvik, cache, data ( your storage partition doesn't need to be wiped)
4) Follow on-screen instructions, do not stop the booting after finishing the installation, it will take some time
5) Insert your DRM keys if you have them
6) For those who lost their keys: Now the functions like vivid image mode are working properly.

DRIVERS
For Windows 8/8.1/10 users, how to solve driver problems:
1) Press the Windows key + R together and in the ‘Run’ box type: shutdown.exe /r /o /f /t 00
– Now make the following selections to boot into the Start Up Setting Screen: Troubleshoot > Advanced options > Start Up Settings > Restart
– Then, when the machine restarts, select number 7 i.e. “Disable driver signature enforcement”. Your machine will start with Driver signing enforcement disabled until the next reboot.

B) Now you can install the Flashtool drivers. Go to the flashtool install location and run the drivers.exe again, check fastboot and flashmode
– Windows will warn that the driver is not signed and will require you to confirm the installation.
– Once the installation is complete, reboot the machine


TO CONCLUDE:

This is what you may want to do to get the most out of your new xperia x:
1) Backup DRM
2) Unlock BL
3) Install TWRP
4) Flash Persian (or a different rom) through TWRP (And subscribe to the thread so you receive updates)
5) Restore DRM

Notes:
None of the links, tools are of my work, I'm just writing a guide for my fellow XX owners :D:D:D
 
Last edited:

brianx87

Member
Jul 17, 2014
12
0
Thanks for this, I need some help!

All was fine until I tried flashing the recovery, comes back "partition unknown" error. I was unable to bring the device up under an adb device only as a fastboot device.

34.0.A.1.264_R3A firmware.
Different official sony driver (Sony bootloader guide driver didn't work)

Device now hangs on the Sony logo after boot messgae warning "OEM bootloader unlocked, device not trusted," any help would be appreciated.
 

FoxTheLegend

Senior Member
Feb 5, 2017
413
110
Athens
Thanks for this, I need some help!

All was fine until I tried flashing the recovery, comes back "partition unknown" error. I was unable to bring the device up under an adb device only as a fastboot device.

34.0.A.1.264_R3A firmware.
Different official sony driver (Sony bootloader guide driver didn't work)

Device now hangs on the Sony logo after boot messgae warning "OEM bootloader unlocked, device not trusted," any help would be appreciated.

These USB drivers are very annoying to work with. I got mine to finally work using a program called ADB driver installer. http://adbdriver.com/downloads/ Choose automated installation and try what I said. I believe it should fix your problem, after installing the drivers reboot and flash again.
Other than that, I have to ask are you 1000% sure you used the exact commands?
I saw another thread someone mistook
"flash recovery recovery.img" for "flash recovery.img"
"recovery" should be included before the recovery file name
 
  • Like
Reactions: remar786

FoxTheLegend

Senior Member
Feb 5, 2017
413
110
Athens
Thanks for this, I need some help!

All was fine until I tried flashing the recovery, comes back "partition unknown" error. I was unable to bring the device up under an adb device only as a fastboot device.

34.0.A.1.264_R3A firmware.
Different official sony driver (Sony bootloader guide driver didn't work)

Device now hangs on the Sony logo after boot messgae warning "OEM bootloader unlocked, device not trusted," any help would be appreciated.

Why didn't the sony guide work? It worked for me. Just so you know, the "device cant be trusted" message is appearing on everyones' phones after unlocking the bootloader, it's not a problem or something
 

FoxTheLegend

Senior Member
Feb 5, 2017
413
110
Athens
the part of restoring DRM is skipped,
please xplain

I know, as I said there is room for improvement. The reason I did not include it is because I never did it myself, so I don't want to write something wrong or something that could lead to problems. I write something only if I am 100% sure. If anyone of you is kind to offer that piece so the guide is complete I will be glad :)
 

YasuHamed

Senior Member
Dec 17, 2013
2,178
864
I know, as I said there is room for improvement. The reason I did not include it is because I never did it myself, so I don't want to write something wrong or something that could lead to problems. I write something only if I am 100% sure. If anyone of you is kind to offer that piece so the guide is complete I will be glad :)
thank you for the answer sir
i am unable to find any twrp that work for my F5122, it always bricks and i have to reset.
is there any twrp recovery image that works correctly with f5122?
 

YasuHamed

Senior Member
Dec 17, 2013
2,178
864
Hmm.. Did you try the one from the poison thread? I myself have still the old version installed (not 3 or 3.1) if I find it on my pc I will share it with you
I have to modified kernel
all i want is to boot it via fastboot command

for example i have the rooted kernel SU installed (but battery drain is high) so i what wana do is flashing kernel with all securities OFF and then with twrp image i will do
Code:
fastboot boot twrp.img
i will boot the X in to twrp and i will flash SUPERSU via twrp.

thanks all
 

FoxTheLegend

Senior Member
Feb 5, 2017
413
110
Athens
I have to modified kernel
all i want is to boot it via fastboot command

for example i have the rooted kernel SU installed (but battery drain is high) so i what wana do is flashing kernel with all securities OFF and then with twrp image i will do

i will boot the X in to twrp and i will flash SUPERSU via twrp.

thanks all
I see, but don't you want to figure out why it's not working normally? Noone has reported a similar problem
 

max26292

Senior Member
May 23, 2016
101
32
Ho Chi Minh
since there is no offcial twrp for X out yes and only DORA (XA) is available) even XA don't work for X
so either twrp 2.8, 3.0 or 3.1 any should just boot in order to let us flash superSU.

=-= try to use this command fastboot flash recovery [your_recovery_name].img
I use f5122 and flash successfull twrp 3.0.2 and 3.1. with this, i flash some kernel and rom without any problem.
 

brianx87

Member
Jul 17, 2014
12
0
Everything is working good for me now, the only issue now is restoring the DRM keys, has anyone found a credible source for doing this on this device?

How can I be sure I have a full root? I can't seem to be able to uninstall some of the bloatware only disable it!
 

FoxTheLegend

Senior Member
Feb 5, 2017
413
110
Athens
Everything is working good for me now, the only issue now is restoring the DRM keys, has anyone found a credible source for doing this on this device?

How can I be sure I have a full root? I can't seem to be able to uninstall some of the bloatware only disable it!
Well titanium backup can assure you but I don't see why you wouldn't have full root... You need an app uninstaller to uninstall bloatware, it can't be done through the settings you know that right
 

Top Liked Posts

  • There are no posts matching your filters.
  • 24
    [UPDATE]: USE THIS ONLY FOR NOUGAT 7 OR 7.1! THERE IS A DIFFERENT GUIDE FOR ANDROID OREO!
    https://forum.xda-developers.com/xperia-x/how-to/root-xperia-x-f5122-android-n-34-2-2-47-t3594502 (Written by YasuHamed, not me!)

    If you are not interested in android Oreo, or you want to go back to Nougat, this guide is still valid! :) [End of Update]

    This is a guide for newbies or for people that are simply confused. If you have any questions, you can always ask me, and I will reply. but please make sure you haven't made mistakes and do not ask about things that are already stated here. Let's go!


    BEFORE DOING ANYTHING, NOTES


    -make sure you have installed ADB : https://forum.xda-developers.com/showthread.php?t=2588979
    -make sure ADB can read your phone with the correct drivers installed. If you have trouble with that, read "DRIVERS" section
    !It is absolutely necessary to install the drivers correctly!
    -Backup your stuff if you have any, you will need to delete everything from the phone
    -Enable USB debugging
    -Note: some of these instructions apply to Windows OS only!
    -Note: links to downloads have been shortcutted as much possible to make it easier for you!
    -Find some stock roms here! https://forum.xda-developers.com/xperia-x/how-to/sonyx-f5121-downgrade-8-0-0-to-7-1-1-to-t3754986
    (Credit: HEKER510)
    -Warning: you will lose your warranty!
    -I am not responsible for any damage done to your device.


    BACKUP DRM KEYS (OR WORKAROUND)


    You may want to unlock your bootloader. If you unlock it without backing up the DRM keys, you will lose them. I did that mistake and I regret it. If you already did, there is an alternative solution, skip to step 8.
    1) If you are running android 7 nougat, you will need to downgrade to MM. If you are running MM, skip to step 7.
    2) You will need to wipe everything before rolling back, so if you have any data back it up
    3) Download any stock MM 6.0.1 firmware for the xperia X. You can find one here : https://mega.nz/#!1xRj2CYS Decryption key: !qBVi7yky8AL84eUF3bpTTGQ2YmN0ePCjc-eSDZGIZCI
    Watch out: if you have the dual SIM model, F5122, you need to download accordingly!
    For more firmwares, check "BEFORE DOING ANYTHING"
    4) Download the latest flashtool: http://www.flashtool.net/downloads.php
    Upon installation, tick on fastboot, flashmode drivers! If it didn't ask you, go to the installation folder and run Flashtool-drivers.exe. Please read "DRIVERS" section!
    5) Flash the .tft file
    How to flash?
    0. Go to "C:\Users\[Your PC Name]\.flashTool\firmwares" , and put your firmware .ftf file in there!
    1. Open Flashtool and click on the lightning bolt icon (first one from the left)
    2. In the prompt, choose flashmode.
    3. Under firmware, click on the version you put (It should probably only be one option)
    4. Under wipe , tick everything. Under the others, do not make any changes.
    5. Click "Flash"
    6. When the popup appears, connect your device. It needs to be powered off, and connected while you are holding the
    "volume down" button.
    7. Wait for it to finish.
    8. Done. Boot up the device, it might take some time to open so don't worry.
    6)If your phone bootloops, try flashing again or a different firmware and make sure you followed the steps correctly.
    7) Once your phone successfully boots android MM, use Dirtycow to get your DRM keys out: https://forum.xda-developers.com/crossdevice-dev/sony/universal-dirtycow-based-ta-backup-t3514236
    8) If you unlocked the bootloader before backing up your keys, you can use DRM kernel fix. You can get it here: https://forum.xda-developers.com/xperia-x/development/kernel-drm-fix-nougat-t3530849 Before using it check out the custom rom that includes this fix and other things.

    UNLOCK BOOTLOADER

    This is relatively easy and you can follow official sony instructions to do it.

    1) Go to your phone settings, developer options, and enable OEM unlock
    "But there is no developer options!" -Go to the bottom of your settings, system, about phone, and tap multile times on "Build Number", also at the bottom.
    2) If you haven't already , install ADB fastboot and configure drivers (Link on top )
    3) Follow the steps on the Sony website to get your unlock code: https://developer.sonymobile.com/unlockbootloader/email-verification/
    4) After unlocking, a warning message on boot is normal!

    INSTALL RECOVERY

    Installing TWRP on your xperia X is very important, since you can flash zips and img files so easily, plus wipe, backup and other features.

    1) Download the TWRP .img file: https://androidfilehost.com/?w=files&flid=197369 (Credit: eagleeyetom )
    2) Make sure you have USB debugging enabled
    3) Open your downloaded twrp folder
    4) Run CMD in that folder (shift + right click inside the folder, Open CMD here )
    5) Connect your Xperia X to your PC
    6) Type these lines:

    adb reboot bootloader

    fastboot flash recovery recovery.img [where recovery.img is your twrp file name]

    fastboot reboot

    7) If no errors, twrp is now installed. Once your phone boots , turn it off,. To access TWRP recovery hold power button and volume down button until the TWRP menu appears.

    STOCK ROM, ROOT

    If you just want to root and not interested in additional features and tweaks, you can simply flash SU through TWRP to get your phone rooted.
    Note: Current best stock ROM available: 7.1.1 (252) - better features than older ver, and good battery life.

    0) Install your desired stock firmware using the exact same previous instructions, (under DRM section) with flashtool.
    1) Download SuperSu
    Or magisk, using YasuHamed guide mentioned on top, but I have not tested with anything other than Oreo 8.0
    Use magisk if you want more stability / root features (like hide root from apps, modules )

    2) copy it anywhere on your phone
    3) Run TWRP
    4) Tap on install
    4) Flash the file
    5) Reboot, you are now rooted
    6) Insert your DRM keys if you have them


    Custom ROMS

    After unlocking the bootloader and installing TWRP this is the best way to go in order to get full root, tweaks.
    https://forum.xda-developers.com/xperia-x/development/rom-xperia-x-pexorom-v1-0-0-f5122-f5121-t3590552
    ^ This is a very good custom ROM made by prmk74. You can see its features in his thread.
    1) Download the rom and copy it to your phone
    2) Run TWRP
    note: It is recommended to wipe dalvik, cache, data ( your storage partition doesn't need to be wiped)
    3) Tap install, find your downloaded file and execute
    note: It is recommended to wipe dalvik, cache, data ( your storage partition doesn't need to be wiped)
    4) Follow on-screen instructions, do not stop the booting after finishing the installation, it will take some time
    5) Insert your DRM keys if you have them
    6) For those who lost their keys: Now the functions like vivid image mode are working properly.

    DRIVERS
    For Windows 8/8.1/10 users, how to solve driver problems:
    1) Press the Windows key + R together and in the ‘Run’ box type: shutdown.exe /r /o /f /t 00
    – Now make the following selections to boot into the Start Up Setting Screen: Troubleshoot > Advanced options > Start Up Settings > Restart
    – Then, when the machine restarts, select number 7 i.e. “Disable driver signature enforcement”. Your machine will start with Driver signing enforcement disabled until the next reboot.

    B) Now you can install the Flashtool drivers. Go to the flashtool install location and run the drivers.exe again, check fastboot and flashmode
    – Windows will warn that the driver is not signed and will require you to confirm the installation.
    – Once the installation is complete, reboot the machine


    TO CONCLUDE:

    This is what you may want to do to get the most out of your new xperia x:
    1) Backup DRM
    2) Unlock BL
    3) Install TWRP
    4) Flash Persian (or a different rom) through TWRP (And subscribe to the thread so you receive updates)
    5) Restore DRM

    Notes:
    None of the links, tools are of my work, I'm just writing a guide for my fellow XX owners :D:D:D
    2
    yes I want to downgrade to keep my DRM keys, thanks for clarifying that I can flash new firmware via TWRP, but I am seeing that sony firmwares are in FTF format, can this format be flashed via TWRP? I am coming from Asus Zenfone and earlier I used to get zip files and flash those in TWRP. So, I am a bit confused now.
    Sure. Here is the link for the latest (official) ROM.
    http://www.xperiablog.net/forum/resources/xperia-x_f5121_34-3-a-0-217_central-europe-5_generic.925/
    I recommend this website (I have used it and it is 100% legit)
    Just download the file to your phone, and using twrp, you can immediately flash it.
    1
    ^^ this guide is so really good :3. I post flash script for someone dont know how to find it ^^
    unzip it in this position.
    C:\Users\[user-name]\.flashTool\mydevices
    1
    Thanks for this, I need some help!

    All was fine until I tried flashing the recovery, comes back "partition unknown" error. I was unable to bring the device up under an adb device only as a fastboot device.

    34.0.A.1.264_R3A firmware.
    Different official sony driver (Sony bootloader guide driver didn't work)

    Device now hangs on the Sony logo after boot messgae warning "OEM bootloader unlocked, device not trusted," any help would be appreciated.

    These USB drivers are very annoying to work with. I got mine to finally work using a program called ADB driver installer. http://adbdriver.com/downloads/ Choose automated installation and try what I said. I believe it should fix your problem, after installing the drivers reboot and flash again.
    Other than that, I have to ask are you 1000% sure you used the exact commands?
    I saw another thread someone mistook
    "flash recovery recovery.img" for "flash recovery.img"
    "recovery" should be included before the recovery file name
    1
    Hello there
    As far as I know you can put them in a custom rom too, but the truth is there isn't any particularly great custom rom for the X now, so my choice would be stock and some tweaks through magisk like YasuHamed suggested. Even if it doesn't work with a custom one, you won't lose them if you extracted them so don't worry. Now about the DRM fix. This is a flashable file that you can flash on your own or it is included already in the custom ROM I have linked. It doesn't restore your keys (that's impossible) It emulates their existence? so that features like display engine, camera performance etc. are not lost. The security provided with the keys however is lost.
    The most important thing you should worry about now is extracting the keys before unlocking BL, the rest is no problem