[Sony XA2 Ultra Questions & Answers] woodykill:
[IMG="Demo"]https://i.imgur.com/Im6U9Mt.png?1[/IMG]

I have rooted my H4233 with this post. Thanks for your help a lot. Here is the step from 0 to 100.

0. Backup your device

1. Unlock Bootloader (Reminder: all data in your device will be deleted. Please do a BACKUP)

1a. To unlock Xperia device, a unlock key is needed, go to Sony Xperia Unlock Bootloader page to find it. (I'm not allow to post the link here as a new user) IMEI is needed to get access to the key. If your XA2 Ultra has dual SIM slot, enter the IMEI for SIM1.

1b. Download all the driver needed and adb Enable USB Debugging in your device.

1c. There is a "How to unlock bootloader" link in Sony Bootloader Page. Follow everything in it. To enter Fastboot mode, Turn off your phone. Press Volume UP while you plug usb cable to connect PC and you phone. You are in fastboot mode if you see a blue LED and a black blank screen.

1d. Your device should automatically reboot after success. If it doesn't, unplug the device and press the power button. You will see a red triangle warning everytime you boot the device after unlocking the bootloader.

1e. If you are still worried your device is unlocked or not, you can check the status by the code *#*#7378423#*#* and you will see "Bootloader unlocked: Yes" (instead of Bootloader unlocker allowed: Yes)

[IMG="Check Unlock Bootloader Status"]https://i.imgur.com/Mn9r0yO.jpg[/IMG]

2. Get the correct boot.img for your XA2 Ultra

2a. Here I will re-describe what @frantisheq #41 and @li0nh3art3d #48 said. First download XperiFirm and unsin.

2b. Use XperiFirm to down the correct firmware your device is using. Use *#*#7378423#*#* to check your XA2 Ultra model (Service Info>Model Info) and the CDA code (Service Info>Software info>Customization Version). Make sure that "Unpack firmware automatically" is checked in the setting of XperiFirm

2c. After completed the download, find the kernel sin file (~50MB). It should be named sometime like kernel_X-FLASH-ALL-18AE.sin. Name might slightly change with different firmware. Drag it to unsin.exe to extract a img file.

2d. Rename it to boot.img and put it in your device.

3. Create a patched boot.img by Magisk Manager

Here I mainly re-describe #4 posted by @mchlbenner

3a. Download Magisk Manager from #14 posted by [MENTION=1058356]mchlbenner[/MENTION]

3b. Open Magisk Manager, it may ask you to upgrade your Magisk Manager to v.5.6.x, do it. After that tab the "Install button" and it asks you to install Magisk v16.0.zip. Do it by Install>Patch Boot Image File>Select your boot.img.

3c. A patched boot.img is created in [Internal Storage]/MagiskManager/patched_boot.img. Pull it into your adb file by MTP or using

adb pull /sdcard/MagiskManager/patched_boot.img

4. Root Your device

4a. Go to fastboot mode

adb reboot bootloader

4b1. If you are afraid anything may go wrong, check can your device boot with the patched boot.img by

fastboot boot patched_boot.img

If anything is okay, you can flash the patched boot.img without any problem.

4b2. Flash your patched boot.img by

fastboot flash boot patched_boot.img

5. Done. Enjoy your rooted phone.

I have a question tho. After rooting, Xperia Companion says it failed to check any update available for my XA2 Ultra. Does it mean I can't receive official update anymore with this rooting method?