[Sony Xperia XA2 Guides, News, & Discussion] asdf2345:
Note: I haven't done any extended testing with this, so I have no idea how stable it is. I also have a MVNO of T-Mobile, so I don't know if that does anything or not.

Note 2: This guide requires you to be on stock firmware, rooted with Magisk, and have adb drivers and platform tools installed.

Step 1: Enable USB debugging under Developer options. (Settings, System, About, tap Build number 5 times, back out, Advanced, Developer options.)

(This is required to do most of the task. You could do it with just a terminal on the phone, but I found adb to be easier.)

Step 2: Open a terminal in your Android platform tools folder.

(We need this to interact with the phone.)

Step 3: Grab voenabler from the link below.

Release Release v1.8 · edgd1er/voenabler

Changes in this Release Test devices OP5 , Redmi Note 7 Pro enable: persist.data.iwlan.enable=true

github.com

(This is required to get VoLTE provisioned.)

Step 4: Copy voenabler to your adb folder, and type (without quotes) "adb push voenabler-v1.8.zip /storage/emulated/0".

(This pushes the file to your phone's internal storage for us to use later.)

Step 5: Type "adb shell" (again without quotes) and press enter.

(This gives us a terminal in the phone.)

Step 6: Type the below commands.

su
mount -o rw,remount /
cd /etc/customization/modem/
mv amss_fsg_pioneer_tar.mbn amss_fsg_pioneer_tar.old
cp amss_fsg_pioneer_tmobile_us_ims_tar.mbn amss_fsg_pioneer_tar.mbn

Note: If you have signal issues, you can try "rm amss_fsg_pioneer_tar.mbn" and then "cp amss_fsg_pioneer_ir51_ir92_ims_tar.mbn amss_fsg_pioneer_tar.mbn".

This swaps the mbn with another VoLTE compatible one. Both work as far as I know, however you could get better or worse signal with the ir51_ir92 mbn compared to the tmobile one.

(This gives the shell root, remounts the device as readable and writable, takes you to the modem configuration folder, and replaces the stock modem with one compatible with T-Mobile VoLTE.)

Step 7: Open Magisk, go to Modules, Install from storage, and pick "voenabler-v1.8.zip".

You might need to tap the three dots at the top right, tap Show internal storage, tap the three bars at the top left, tap your phones internal storage (the new item that appeared under downloads), and then tap voenabler-v1.8.zip.

(This installs the VoLTE enabler)

Step 8: After it installs, reboot.

(These changes require a restart)

Step 9: Once booted, check *#*#4636#*#*, Phone information, and make sure VoLTE is provisioned.

(This is the first half of checking if VoLTE is working. If you don't see this, something went wrong with voenabler.)

Step 10: Set Preferred Network Type to LTE only.

(This ensures that the next call will either be made through LTE, or not get made at all.)

Step 11: Try making a call.

(If you need a number to try, I recommend 248-434-5508. It's my favorite number for testing this type of thing.)

Step 12: You might want to go back to *#*#4636#*#*, Phone information, and set LTE only back to LTE/UMTS auto (PRL).

(Seeing as the T-Mobile 2G network still exists, it's probably a good idea to make sure the phone can still use it just in case, however it's not necessary.)

Now you should have working T-Mobile VoLTE on your phone, just a few months away from the 2G shutdown. The phone will be usable for a while longer.