[Sony Xperia X Compact Guides, News, & Discussion] camdecoster:
Try making the XC work like the XZ1C, Part 3

Alright, I've had partial success. Using some of the overlay files from the flashable zip that [MENTION=4782500]pbarrette[/MENTION] created, I was able to get the VoLTE and WiFi Calling menus to show up in settings. Here's a summary:

Flash old firmware. I used this one available on XperiFirm: F5321_34.1.A.1.198_Commercial and Journalists (1305-9054). It's not strictly necessary to flash the old firmware, but you need root, and root requires an unlocked bootloader, and unlocking the BL will delete your TA partition. I wanted to backup the TA partition for my DRM keys. In order to use the backup tool, you have to use an older version of Android so that the exploit used by the backup tool is still available.

Backup TA partition

Flash current firmware (34.4.A.2.118)

Unlock bootloader (use the Sony Mobile website for this)

Root phone (I used the method described here with the DRM fix option. The use-your-own-TA option didn't work for me.

https://xdaforums.com/x-compact/how-to/stock-8-0-root-recovery-t3747479

Install the following files from the [MENTION=4782500]pbarrette[/MENTION] flashable zip:

/oem/modem-config/408/modem.conf

/oem/overlay/android-res-305.apk

/oem/overlay-408/android-res-310-408.apk

/oem/overlay-408/com.android.carrierconfig-res-310-408.apk

/oem/overlay-408/com.android.phone-res-310-408.apk

/oem/overlay-408/com.android.settings-res-310-408.apk

/oem/overlay-408/com.android.systemui-res-310-408.apk

/oem/system-properties/408/config.prop

You also need to install /oem/overlay/com.sonymobile.customizationselector-res-305.apk, but I had to modify the file from the XZ1C to get things to work. Within the APK, there's one XML file that needs to be updated to include the sim_config_id I'm seeing on MetroPCS. That is /res/xml/configuration_selectors.xml. I modified it to look like the following (with my addition in red):

<?xml version="1.0" encoding="utf-8"?>
<configurations>
<configuration config_id="408">
<sim_config_id>S264.1</sim_config_id>
<sim_config_id>S264.2</sim_config_id>
<sim_config_id>S264.3</sim_config_id>
<sim_config_id>S264.4</sim_config_id>
<sim_config_id>S264.5</sim_config_id>
<sim_config_id>S264.6</sim_config_id>
<sim_config_id>S264.7</sim_config_id>
<sim_config_id>S264.8</sim_config_id>
<sim_config_id>S264.9</sim_config_id>
<sim_config_id>S264.10</sim_config_id>
<sim_config_id>S264.11</sim_config_id>
<sim_config_id>S264.12</sim_config_id>
<sim_config_id>S264.13</sim_config_id>
<sim_config_id>S264.14</sim_config_id>
<sim_config_id>S264.15</sim_config_id>
<sim_config_id>S264.16</sim_config_id>
<sim_config_id>S264.17</sim_config_id>
<sim_config_id>S264.18</sim_config_id>
<sim_config_id>S8663.1</sim_config_id>
[COLOR="Red"]<sim_config_id>S8957.1</sim_config_id>[/COLOR]
</configuration>
</configurations>

To do this, I decompiled the Sony APK from the XZ1C, changed the file, recompiled the APK, signed the file, then placed the file in the /oem/overlay directory with Solid Explorer, and made sure the file permissions were correct.

It's worth mentioning that /oem/modem-config/408/modem.conf lists the modem binary file to be loaded when a T-Mobile SIM is detected. On the XZ1C, this is tmobile_us_ims and that's what modem.conf lists by default. You'll need to change this to one of the modem binary files contained on the XC. I tried using the tmobile_us_ims modem binary file from the XZ1C and it sent my phone into a bootloop. So it's confirmed that the XZ1C modem binary files aren't compatible with the XC. Just pick one from the /etc/customization/modem folder, like amss_fsg_kugo_a1_austria_ims_tar.mbn and list this in the file. You'll need to cut out the prefix and suffix, so just a1_austria_ims for this example. The prefix and suffix will get added by the phone when selecting the file.

Trigger a SIM check by CustomizationSelector. To do this, I deleted the file /data/data/com.sonymobile.customizationselector/shared_prefs/com.sonymobile.customizationselector_preferences.xml and rebooted (as suggested by [MENTION=4782500]pbarrette[/MENTION] here: https://xdaforums.com/showpost.php?p=74560870&postcount=76 and here https://xdaforums.com/showpost.php?p=74560870&postcount=77). After a couple of minutes, my phone stated that it needed to reboot to optimize for my network. Once it loaded back up, the proper overlays had been loaded and I could see the settings for VoLTE and WiFi Calling.

This is where my success stops. Without the proper modem binary file, it's a bit of a crapshoot to see if an existing file will work. To do this, just repeat steps 8 and 9 with a different modem binary file. I've tried a handful of these files, but no luck yet. There are 127 files, but I'm sticking with the ones that mention IMS or VoLTE. This reduces the total to 88, but it's still a lot of rebooting and waiting. The files I've tried so far are listed below.

amss_fsg_kugo_a1_austria_ims_tar.mbn

amss_fsg_kugo_a1_austria_volte_vowifi_tar.mbn

amss_fsg_kugo_bouygues_france_ims_tar.mbn

amss_fsg_kugo_bouygues_france_volte_vilte_tar.mbn

amss_fsg_kugo_ee_ims_tar.mbn

amss_fsg_kugo_singtel_ims_tar.mbn

amss_fsg_kugo_telefonica_uk_ims_tar.mbn

amss_fsg_kugo_telekom_germany_ims_tar.mbn

amss_fsg_kugo_tmobile_us_tar.mbn

amss_fsg_kugo_vivo_ims_tar.mbn

amss_fsg_kugo_vodafone_germany_ims_tar.mbn

amss_fsg_kugo_vodafone_spain_ims_tar.mbn

amss_fsg_kugo_vodafone_uk_ims_tar.mbn

amss_fsg_lilac_tmobile_us_ims_tar.mbn

So that's my current status. I'm not planning on doing anything else at this point, because I figured out a way to get my XZ1C working on MetroPCS with VoLTE and WiFi Calling. I'll write a bit about that over in the XZ1C forum. If anyone wants to continue looking into it, please provide an update.