Reverting Xperia X to Android using only Linux

Hi, I have Sailfish on my Xperia X right now, and is has a serious issue that makes it unusable.
I want to go back to Android, and I have found several questions about it on TJC, but several differing approaches are proposed there as well as in other sources. My particular situation is different from what I’ve found:

  • I have only Linux computers (can’t use Emma)
  • I don’t want to flash Android 6, 7 (my device came with this, bought it refurbished) or 8 - unless it’s an unavoidable step for getting to 10.
    I want to flash Android 10, provided @xda-devs

It is suggested that you can flash any ROM from a Linux box using Flashtool, but instructions are meager, and I can’t tell whether they also apply to my case, where there’s Sailfish on the device.

Also, it says to flash an *.ftf file, but there isn’t one included in the downloads from xda.
There is, however this SW_BINARIES_FOR_XPERIA_ANDROID_9.0_2.3.2_V9_LOIRE.img file (as opposed to SW_binaries_for_Xperia_AOSP_M_MR1_3.10_v13_loire.img found on Jolla’s site), but this isn’t mentioned anywhere in the instructions for Flashtool.
So, I’m quite lost… Anyone has done this?

Do you think I need to install an older Android AOSP first (which one?) and then upgrade to 10 (but all just with Linux), or is there a way to flash the Android 10 directly?


Oh I did the same hard way. Especially without windows. Here is the workflow (the only one). Adb and fastboot tools needed.

  1. Get your stockfirmware with xperifirm.
  2. Extract all.
  3. Search newflasher from xda.
  4. Put newflasher script in the firmware folder.
  5. Start the script with plugged phone in flashmode (not fastboot).
  6. Now you are back to stock rom.

From here you are free to flash any custom roms. It is the only way, because without reverting to stock a custom rom would be a mess.

here is the link to newflasher. Check all the questions in the flashing progress carefully.


Thank you for confirming this works with Xperia X a device released in 2016 as inference is that Newflasher applies to Sony phones including and newer than the XZ Premium here:

1 Like

Which Android version would you recommend flashing?

Newflasher is letting me down it seems. In flash mode, it seems to read the usb device in a mode that Newflasher doesn’t support - look here:

The gist is that this device (Xperia X) would be incompatible with Newflasher, but if you did it, then how…?


In regard to your original query where “It is suggested that you can flash any ROM from a Linux box using Flashtool”, as far as I can remember it doesn’t matter if you are downgrading or upgrading provided the correct “wipe” boxes are ticked before flashing else it won’t boot. Although attached is a guide that I found at the time I am not sure if this just appertained to downgrading Xperia X to allow saving TABackup. Sorry I can’t provide credit to original source of screenshot.

With regards to SW Binaries these “blobs” only have to be added to Sailfish OS as are part of Sony “Stock ROM”. Remember holding down volume up and power button in case device becomes unresponsive until “three vibrations” and ensure battery full before flashing. Bear in mind installation of TWRP makes “wiping” of device a lot simpler:

1 Like

Okay, I am now on stock Android 8 flashed with xflasher. But back to the problem that I don’t have an ftf file that Flashtool seems to require.
I also installed TWRP now, I think:

[ben@catull-mnj ~]$ adb reboot bootloader
[ben@catull-mnj ~]$ fastboot flash recovery /mnt/RedData/ISO-images/Xperia-X/twrp-3.3.1-0-suzu.img
Sending 'recovery' (21824 KB)                      OKAY [  0.741s]
Writing 'recovery'                                 OKAY [  0.161s]
Finished. Total time: 0.918s
[ben@catull-mnj ~]$ fastboot reboot
Rebooting                                          OKAY [  0.001s]
Finished. Total time: 0.052s

I’m trying to flash Android Q onto the Xperia X. It has the the stock Android 8 from Sony right now, but can’t figure out where to go from here.
this is what I want to install:
The instructions say “Copy to SD card and flash with recovery”. I copied the .zip file to an SD card which I inserted into the Xperia X. I installed the zip file using TWRP in recovery mode now , but now the phone isn’t booting, it’s stuck on the Sony logo.

Sorry for late reply as was not following this thread. Did you format user data rather than wipe before trying to install Android Q?

Thank you for looking at this issue again! What is the difference between format and wipely exactly? I mean I think I know, but the effect is that all data are wiped in both cases, no?
I have managed to install Android 8 on it now using Xperifirm and, I think, Flashtool (honestly I don’t remember). Then (unfortunately) found that Ubuntu Touch has been ported for the Xperia X and tried flashing it. Somehow this failed halfways, and I seem to have the Ubports recovery on it, but can’t get beyond a boot loop here. Now I tried to go back to Android once again, but alas, the phone is not responding to Flashtool, I keep getting this error:
" [ERROR - The bundle does not match the connected device](https://forum dot xda-developers dot com/showpost.php?p=83937781&postcount=8)"
I does respond to holding down volume up and power button until “three vibrations”, and the LED turns green when I connect the usb to PC, but
adb devices
returns nothing.
Any idea how I could still breath back life into this phone? It would a shame if it stays bricked…

What happens if you try to get device in fastboot mode? After device powered off for 30 seconds keep volume up button depressed and quickly insert USB cable from PC when LED should light up “Blue”. You can always then flash TWRP which should give you opportunity to “wipe” whatever you want from device, before starting again.

What exactly do I need to wipe in TWRP? people seem to have differring ideas about that.

Just out of curiosity: What is the “serious issue” you have with SailfishOS? Maybe it’s easier to solve that than reverting the device back to Android? Given the device is pretty old I wouldn’t rely on continuous Android security updates in the long term…

Does this resource help?
It always seems alarming when get result of “no operating system upon device” but at least a fresh start.

Here’s the issue:
This does make the phone basically unusable, you have the camera app coming to the foreground every couple seconds, you can’t do anything uninterrupted.
Haven’t found a solution…

This is what happens when I try to flash TWRP, following instructions from XDA-devs:
I connect the Xperia X’s usb to my PC while holding the “volume up” button. LED turns red for a second, then blue. I run these commands:

[ben@catull-mnj ~]$ adb reboot bootloader
* daemon not running; starting now at tcp:5037
* daemon started successfully
error: no devices/emulators found
[ben@catull-mnj ~]$ adb devices
List of devices attached
                                           // <= emtpy line here

So there is behavior as if fastboot isn’t recognizing my device. But, now I try to flash recovery anyways:

[ben@catull-mnj ~]$ fastboot flash recovery /mnt/RedData/ISO-images/Xperia-X/twrp-3.3.1-0-suzu.img
Sending 'recovery' (21824 KB)                      OKAY [  0.735s]
Writing 'recovery'                                 OKAY [  0.155s]
Finished. Total time: 0.902s
[ben@catull-mnj ~]$ fastboot reboot
Rebooting                                          OKAY [  0.001s]
Finished. Total time: 0.052s

Voila, TWRP is flashed, even though fastboot first pretended it wasn’t seeing any devices.
This last reboot leads to the black-on-white Sony logo, device becomes unresponsive. I hold power + volume up until three vibrations to power it off.
I boot to TWRP by holding power button and volume up.
Wiping as in the instructions posted above:

i.e., I did first “Format Data” and then at Advanced Wipe, I checked
Dalvik / ART Cache

Leads to this:

Just to make sure it’s noticed, I’ll copy here again what happened when I tried to flash the Sony Android using Flashtool:

16/037/2020 22:37:18 - INFO  - Selected Bundle for Sony Xperia X(F5121). FW release : 34.4.A.2.118-R1E. Customization : 3-AT
16/037/2020 22:37:18 - INFO  - Preparing files for flashing
16/037/2020 22:37:51 - INFO  - Please connect your device into flashmode.
16/037/2020 22:37:52 - INFO  - Opening device for R/W
16/037/2020 22:37:52 - INFO  - Device ready for R/W.
16/037/2020 22:37:52 - INFO  - Reading device information
16/037/2020 22:37:52 - INFO  - Phone ready for flashmode operations.
16/037/2020 22:37:52 - INFO  - **Opening TA partition 2**
16/037/2020 22:37:52 - INFO  - **Current device : Unknown:** Sep  6 2018/05:53:44 - CB512A07NC - Unknown: Sep  6 2018/05:53:44 - Unknown: Sep  6 2018/05:53:44 - Unknown: Sep  6 2018/05:53:44
16/037/2020 22:37:52 - INFO  - Closing TA partition
16/037/2020 22:37:52 - ERROR - The bundle does not match the connected device
16/037/2020 22:37:52 - INFO  - Ending flash session

Is the TA partition the one that gets deleted when unlocking the bootloader?
Also, at first it seems to recognize the phone, but then it tries to open that TA partition 2 and there it says Current device : Unknown
… What does it all mean?

Read the topic and I think this is rather a hardware issue? Did you check the system log files for what had triggered the launch of the camera app (journalctl -f)?
I think there should be a possibility to completely disable the camera button. Yo can try an older SfOS release and the Powerbutton Menu from coderus: (it’s not yet compatible with the current version).
Did the problem appear with the current release or did it occur in earlier versions as well?

Thanks, that might have been a good thing to try when I still had SfOS on it. But when I got no more replies and couldn’t find anything helpful on the internet, I decided to go back to its factory firmware. Then I wanted to try Ubports, which failed to install, now I’d just love to have any OS that works.

Think that “red lines” in TWRP only because you are using latest version and are not errors. Whilst not advocating to follow advice in this resource, just pointing out device is still recoverable if you could "borrow’ Windows machine with Emma installed: