ProtonAOSP / android_device_google_redbull

19 stars 5 forks source link

[radio/modem]Looking forward to supporting China Telecom #1

Closed 0x1af2aec8f957 closed 3 years ago

0x1af2aec8f957 commented 3 years ago

Hello,

Can you support China Telecom? I've tried a lot of solutions, but they can't mount images.

# Official ROM
.
├── bootloader-redfin-r3-0.3-6776358.img
├── flash-all.bat
├── flash-all.sh
├── flash-base.sh
├── image-redfin-rd1a.201105.003.c1.zip
└── radio-redfin-g7250-00016-200911-B-6826885.img

I was recently porting modems( radio.img )The mirror package cannot always be mounted.

hdiutil attach -imagekey diskimage-class=CRawDiskImage -nomount /Users/m/Downloads/redfin-rd1a.201105.003.c1/radio-
redfin-g7250-00016-200911-b-6826885.img
# output
/dev/disk2
hdiutil mount /dev/disk2
#output
hdiutil: mount failed -no file system to mount

Vivo X50 uses the same modem( NON-HLOS.bin ).

# Vivo X50 NON-HLOS.bin: NON-HLOS.bin/image/modem_pr/mcfg/configs/mcfg_sw/generic/China/CT
.
├── Commercial
│   ├── OpenMkt
│   │   └── mcfg_sw.mbn
│   ├── VoLTE_OpenMkt
│   │   └── mcfg_sw.mbn
│   └── hVoLTE_OpenMkt
│       └── mcfg_sw.mbn
└── Lab
    ├── CTA
    │   └── mcfg_sw.mbn
    ├── EPS_Only_VoLTE_Conf
    │   └── mcfg_sw.mbn
    ├── NoAPN_Vo_Conf
    │   └── mcfg_sw.mbn
    ├── Nsiot_VoLTE
    │   └── mcfg_sw.mbn
    ├── TEST
    │   └── mcfg_sw.mbn
    ├── TEST_EPS_ONLY
    │   └── mcfg_sw.mbn
    ├── TEST_NO_APN
    │   └── mcfg_sw.mbn
    └── VoLTE_Conf
        └── mcfg_sw.mbn

If I can mount it successfully radio.img, I will follow the following steps to transplant the modem to support China Telecom:

First:

Linux:

mkdir modem_pixel
mkdir modem_vivo
sudo mount -o loop radio.img modem_pixel
sudo mount -o loop NON-HLOS.bin modem_vivo

macOS:

hdiutil attach -imagekey diskimage-class=CRawDiskImage -nomount radio.img
# output
/dev/disk2
hdiutil attach -imagekey diskimage-class=CRawDiskImage -nomount NON-HLOS.bin
# output
/dev/disk3
# The above command will output a result similar to `/dev/diskN`, and then use the result to execute respectively: 
hdiutil mount /dev/disk2 # hdiutil mount /dev/diskN
hdiutil mount /dev/disk3 # hdiutil mount /dev/diskN

Then:

sudo mkdir modem_pixel/modem_pr/mcfg/configs/mcfg_sw/generic/china
sudo cp -r modem_vivo/image/modem_pr/mcfg/configs/mcfg_sw/generic/china/ct modem_pixel/modem_pr/mcfg/configs/mcfg_sw/generic/china/
sudo vi modem_pixel/modem_pr/verinfo/ver_info.txt # Add 1 to the number in the file

sync
umount modem_pixel # MacOS uses disk tools to push out images directly
umount modem_vivo # MacOS uses disk tools to push out images directly

Last:

adb reboot bootloader
fastboot flash radio radio.img

This completes the migration.

I very much expect this image to support China Telecom, Thanks.

kdrag0n commented 3 years ago

On Pixels, modem configs are located in /vendor, not modem, and the fastboot radio image is different from modem. They're signed with Qualcomm test keys, but I'm not sure if the modem actually validates the signatures. The worst-case scenario is that you can flash them manually using EfsTools over USB diag.

Either way, I'm not yet convinced that the modem config is the problem. That might be the case for advanced functionality like VoLTE and Wi-Fi calling, but basic LTE and calling shouldn't depend on it.

Try adding an APN in Android with the following settings:

And this:

0x1af2aec8f957 commented 3 years ago

@kdrag0n Hello, I've tried this scheme already. It won't work. The mobile phone is now without the signal of China Telecom. According to the past experience, it is invalid to modify APN.

kdrag0n commented 3 years ago

Please try it once with these exact settings on this device in case it differs from your past experience. I can help you try other MBNs if it doesn't work.

0x1af2aec8f957 commented 3 years ago

@kdrag0n When I insert the SIM card of China Telecom. The APN in the system settings will automatically select ctnet, The configuration of this APN is the same as what you sent, so when I add the same APN configuration, It does not add a new APN configuration.

Based on the previous Google device (pixel, nexus) processing experience, In order to receive signals normally, MBNs configuration items need to be added. Of course, there are also ways to change the configuration after obtaining the root permission, but this method usually reduces the security of the device, and subsequent upgrades will be very inconvenient.

It is not easy to use Google equipment in mainland China.

cccClyde commented 3 years ago

Hello noteScript, I have a Magisk module which enables 5G connectivity on CUniq and CMCC. Although it's not completely working for China Telecom (mostly calling and MMS), I'm wondering if it can help with you somehow.

Contact me @cccClyde on Telegram or email johnson.hu95@gmail.com

0x1af2aec8f957 commented 3 years ago

I found a magisk module that would meet my needs, but it must now turn on the volte service to make phone calls and text messages normally (issue).

0x1af2aec8f957 commented 3 years ago

@kdrag0n

Can you add the original support for China Telecom here? I found the key code of LineageOS support for China Telecom: https://review.lineageos.org/c/LineageOS/android_device_oneplus_onyx/+/30283/1/init/init_onyx.cpp#62

kdrag0n commented 3 years ago

We're building a custom vendor image now so this is possible, but I've decided not to add any unofficial MBNs.

The reason is that MBNs are risky, and I've bricked my modem EFS before by flashing broken MBNs. There's no way to guarantee that unofficial MBNs will keep working; maybe a future modem firmware update will break it and possibly brick the EFS. I don't want to take that risk in ProtonAOSP, so I think custom MBNs are better kept as unofficial mods.