[Google Pixel 2 XL Guides, News, & Discussion] Airpil:
Hi all.

First of all

I DO NOT PROVIDE ANY KIND OF SUPPORT. YOU ALONE RESPONSIBLE FOR ANY POSSIBLE ISSUES.

I wrote this post during my vacation. I know it could be quite handy, but unfortunately/thankfully my primary sources of money are completely aside from this findings.

I came to XDA from iOS jailbreak community and still believe that any findings have to be published if they allow to escape any kind of jail .

Sorry for any delays in my responses in PM and here, but i am really busy.

In case somebody wants to share this info with other communities, feel free to do so

.

Sorry for my EN

P.S.

all this small findings and adjustments would not be possible without [MENTION=4470081]topjohnwu[/MENTION] i have tried to rase a CR on github to enable a sub-function in Magisk for init.rc scripts injection through the existing magicg.rc but it was rejected. So any one who intrested in the same kind of projects please open an issue on Magis github page we really need *.rc injection as a part of Magisk module.

[/MENTION]

For the past couple of months I've been looking into finding the way to get an access to the Pixel 2 XL diag port.

As many of you know this feature is disabled by default on user builds. Thanks to [MENTION=1522329]deeproot[/MENTION] for his ROM. Because this is the only one userbuild ROM available right now with diag configuration. https://xdaforums.com/pixel-2-xl/development/aosp-tamien-8-1-opengapps-t3727948

The only downside of this ROM is outdated version of the Android. To fix this unpleasant issue. I've took the init.taimen.diag.rc init script from the ROM and put it into the custom ROM. Later I have discovered couple of issues. First - dm-verity have to be disabled. Second - different ROMs dont play nice with instructions from init.taimen.diag.rc. (adb doesn't work properly).

With this being said I started to looking for a way to inject this instructions into Google Official ROM. Without touching the file system itself.

Unfortunately i haven't found the way make it via Magisk Modules. Because MagiskMount mount the module directory after init stage.

As many of you know Magisk injects init.magisk.rc into init.rc script. So ive decided to recompile the Magisk with the necessary init instructions. I simply updated init.magisk.rc with the following instructions. ( Thanks [MENTION=4470081]topjohnwu[/MENTION] for Magisk )

on property:sys.usb.config=diag,serial_cdev,rmnet_gsi,adb && property:sys.usb.configfs=1

start adbd

start port-bridge

on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,serial_cdev,rmnet_gsi,adb && property:sys.usb.configfs=1

write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "Default composition"

rm /config/usb_gadget/g1/configs/b.1/f1

rm /config/usb_gadget/g1/configs/b.1/f2

rm /config/usb_gadget/g1/configs/b.1/f3

rm /config/usb_gadget/g1/configs/b.1/f4

rm /config/usb_gadget/g1/configs/b.1/f5

write /config/usb_gadget/g1/idVendor 0x05C6

write /config/usb_gadget/g1/idProduct 0x9091

write /config/usb_gadget/g1/os_desc/use 1

symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1

symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2

symlink /config/usb_gadget/g1/functions/gsi.rmnet /config/usb_gadget/g1/configs/b.1/f3

symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f4

write /config/usb_gadget/g1/UDC ${sys.usb.controller}

setprop sys.usb.state ${sys.usb.config}

as a result I was able to open diag port when the following properties are set.

setprop property:sys.usb.configfs 1

sys.usb.config diag,serial_cdev,rmnet_gsi,adb

There are two files attached.

1) Magisk-v18-Taimen-Diag.zip - Modified version of the Magisk. I strongly recommend to install the original version when you finish to play with QXDM. Because I am not a SW developer at all. From the Word "COMPLETELY"

2) Pixel 2 Diag Port.zip - Module for Magisk to properly enable the Diag port on boot via

setenforce 0
setprop sys.usb.configfs 1 && setprop sys.usb.config diag,serial_cdev,rmnet_gsi,adb

When you flash the Magisk via twrp and install the module you should be able to get an access to the diag port

[IMG="Device Manager"]https://i.ibb.co/QbFmsNj/Screenshot-2018-12-31-at-17-59-06.png[/IMG]

To activate VoLTE on you phone you have to install VoEnabler module and upload proper mcfg_sw.mbn for your MNO.

ive tested Russian MNOs on my phone using Nokia 8 mbn. Works fine for me.

3)Open PDC tool -> Load -> Choose proper MBN -> SetSelectedConfig -> Sub0 -> Activate.

About VoEnabler and other OS methods.

There are actually two methods to get VoLTE\VoWiFI on the phone from OS point of view (VoLTE and VoWiFI provisioned) in *#*#4636#*#* Phone info -> IMS Status.

1) install VoEnabler it performs setprop for Vo*** related parameters.

2)modify /data/user_de/0/com.android.phone/files/carrierconfig-com.android.carrierconfig-XXXXXXXXXXX.xml .

Parameters for xml file you can get from https://developer.android.com/reference/android/telephony/CarrierConfigManager

for example

<boolean name="carrier_volte_available_bool" value="true" />
<boolean name="carrier_wfc_supports_wifi_only_bool" value="true" />
<boolean name="carrier_wfc_ims_available_bool" value="true" />

I use several SIM cards so for me it is more comfortable to use second method because this files configure phone module with different settings and it is easier to troubleshoot the issues

<?xml version='1.0' encoding='utf-8' standalone='yes' ?>

<carrier_config>

<package_version>2</package_version>

<bundle_data>

<string name="_carrier_settings_version_string">25099-3000000346</string>

<boolean name="carrier_volte_available_bool" value="true" />

<boolean name="carrier_wfc_supports_wifi_only_bool" value="true" />

<boolean name="carrier_wfc_ims_available_bool" value="true" />

<boolean name="display_hd_audio_property_bool" value="true" />

<boolean name="editable_enhanced_4g_lte_bool" value="true" />

<boolean name="hide_ims_apn_bool" value="false" />

<boolean name="remove_modify_call_capability" value="false" />

<boolean name="transmit_static_image" value="false" />

<boolean name="support_video_conference_call_bool" value="true" />

<boolean name="emergency_sms_support_bool" value="false" />

<boolean name="vowifi_call_quality" value="false" />

<boolean name="show_apn_setting_cdma_bool" value="true" />

<boolean name="carrier_rtt_downgrade_supported" value="false" />

<boolean name="allow_video_call_in_low_battery" value="true" />

<boolean name="world_phone_bool" value="true" />

<boolean name="carrier_rtt_upgrade_supported" value="false" />

<boolean name="hide_preferred_network_type_bool" value="false" />

<boolean name="show_static_image_ui" value="false" />

<boolean name="show_video_quality_ui" value="false" />

<boolean name="show_video_quality_toast" value="true" />

<string-array name="ratchet_rat_families" num="3">

<item value="1,2" />

<item value="7,8,12" />

<item value="3,11,9,10,15" />

</string-array>

<boolean name="apn_expand_bool" value="true" />

<boolean name="allow_adding_apns_bool" value="true" />

<boolean name="carrier_rtt_auto_upgrade" value="false" />

<boolean name="config_carrier_cs_retry_available" value="false" />

<boolean name="video_call_use_ext" value="true" />

<boolean name="show_cdma_choices_bool" value="true" />

<boolean name="carrier_rtt_supported_on_vtcalls" value="false" />

<boolean name="show_data_usage_toast" value="true" />

<boolean name="use_custom_video_ui" value="false" />

<boolean name="carrier_allow_deflect_ims_call_bool" value="false" />

<boolean name="config_hide_preview_in_vt_confcall" value="false" />

<boolean name="config_enable_display_14digit_imei" value="false" />

<boolean name="carrier_rtt_supported" value="false" />

<boolean name="show_call_session_event_toast" value="true" />

<string name="config_ims_package_override_string" value="com.google.android.ims" />

<string name="default_sim_call_manager_string" value="com.google.android.ims" />

</bundle_data>

</carrier_config>

Update 23/03/2019

Thanks to [MENTION=4470081]topjohnwu[/MENTION] work on Android Q i've updated the Magisk.zip with diag scripts enabled. Magisk-v18.2-f5f7fd91_Taimen_Diag.zip

The same approach the same steps.

That is true that Magisk module is not required, just disable enforcement and change the sys.usb.config settings.

Just be sure you are using correct drivers.

VoEnabler needs to be updated, not sure whether is works or not. VoLTE provisioning is disabled under "Phone Info"

I was able to open Phone Info app only through the "QuikShortcutMaker" app.

Because i modified /data/user_de/0/com.android.phone/files/carrierconfig-com.android.carrierconfig as well i am not sure what exactly activate the VoLTE. VoEnabler, or the file modification.

Also because TWRP was not able to decrypt the storage in my Phone i uploaded Magisk.zip to /tmp/ directory on my phone.

+ i installed the modified version of the Magisk on top of original canary build. Don;t know whether it important or not.

Update 14/04/2019

Android Q Beta 2 Magisk 19 attached.

Magisk-v19.0_Taimen_Diag

Magisk-uninstaller-20190413

Update 09/05/2019

I have forked Magisk repo. Now OTA updates should work for Taimen_Diag mod.

Testet on Android Q beta 3

App

https://github.com/AGagarin/magisk_files/blob/master/canary_builds/app-debug.apk

Zip

https://github.com/AGagarin/magisk_files/blob/master/canary_builds/magisk-debug.zip

For Drivers search for QUD.WIN.1.1 Installer-10037.3 Setup

For CA https://mt-tech.fi/en/modify-sony-xz-xzs-xz-premium-xz1-and-xz2-lte-a-band-combos/

For more information about PDC tool and mbn files https://xdaforums.com/oneplus-5t/how-to/guide-volte-vowifi-german-carriers-t3817542

Command line tool to read\write EFS settings https://github.com/JohnBel/EfsTools