Sony Xperia XA2: successfully update LineageOS 16.0
Updating LineageOS 16.0 on your Sony Xperia XA2 can result in no network, bluetooth and Wi-Fi. It’s a common problem, but there is a solution: update the firmware, but to an older version than 50.2.A.0.*. After that, updating to newer LineageOS versions won’t be a problem anymore. Here’s a step-by-step guide how it worked for me.
Note: If you make a mistake, you can brick your phone for good. I do not take any warranty if you do so. If you’re not sure about a step, do some research until you feel save to continue. Also consult the links at the bottom for more information.
I flashed the firmware using Gentoo Linux as my OS. If you use a different distro or OS, (some of) the commands will be different.
- Backup your phone data (everything will be erased)
- Download XperiFirm
- Open XperiFirm
- Download the “Commercial and Journalists” firmware version (50.1.A.5.59) for your Xperia XA2 model
In the folder of the newly downloaded and extracted firmware, delete the following files (you don’t need them for the firmware update, but they will be copied to the phone if left in the folder):
- kernel_X-FLASH-ALL-18AE_0x00.hash
- kernel_X-FLASH-ALL-18AE.sin
- persist_X-FLASH-ALL-18AE_0x00.hash
- persist_X-FLASH-ALL-18AE.sin
- system_other_X-FLASH-ALL-18AE_0x00.hash
- system_other_X-FLASH-ALL-18AE.sin
- system_other_X-FLASH-ALL-9B8D_0x00.hash
- system_X-FLASH-ALL-18AE_0x00.hash
- system_X-FLASH-ALL-18AE.sin
- system_X-FLASH-ALL-9B8D_0x00.hash
- userdata_X-FLASH-CUST-18AE.sin
- vendor_X-FLASH-ALL-18AE_0x00.hash
- vendor_X-FLASH-ALL-18AE.sin
- vendor_X-FLASH-ALL-9B8D_0x00.hash
Using linux, you can do so by running the following command:
rm kernel_X-FLASH-ALL-18AE_0x00.hash kernel_X-FLASH-ALL-18AE.sin persist_X-FLASH-ALL-18AE_0x00.hash persist_X-FLASH-ALL-18AE.sin system_other_X-FLASH-ALL-18AE_0x00.hash system_other_X-FLASH-ALL-18AE.sin system_other_X-FLASH-ALL-9B8D_0x00.hash system_X-FLASH-ALL-18AE_0x00.hash system_X-FLASH-ALL-18AE.sin system_X-FLASH-ALL-9B8D_0x00.hash userdata_X-FLASH-CUST-18AE.sin vendor_X-FLASH-ALL-18AE_0x00.hash vendor_X-FLASH-ALL-18AE.sin vendor_X-FLASH-ALL-9B8D_0x00.hash
Clone newflasher repository to your local machine:
git clone https://github.com/newflasher/newflasher.git ~/.local/share/newflasher
Install libexpat and zlib libraries:
emerge -a dev-libs/expat sys-libs/zlib
Compile newflasher:
make -C ~/.local/share/newflasher
- Copy the compiled file (called newflasher) into the folder with the firmware
- Turn off your phone
- Hold the volume down button while you plug in the USB cable; the LED on your phone should turn green
- Open a console
- Go to the directory with the firmware and newflash binary
Run newflash:
./newflasher
Find out the active slot by typing
fastboot getvar current-slot
The result is either current-slot: _a or current-slot: _b
Change slot:
fastboot set_active b
(if current-slot is _a) or
fastboot set_active a
(if current-slot is _b); the console will confirm the changed slot
- Unplug the USB cable
- Repeat step 10 and 11
- Install LineageOS according the official guide
- Restore phone data
Delete the newflasher folder:
rm -r ~/.local/share/newflasher
Uninstall libexpat and zlib libraries. Using Gentoo, run
emerge -ac dev-lib/expat sys-libs/zlib
Source: