This is what I did. Works with Xiaomi MIUI14 and Oxygen OS 11. No root needed
1. Extract firmware.jar from your phone. Use adb pull /system/framework/framework.jar
2. Download jadx from here
https://github.com/skylot/jadx/releases/tag/v1.4.7 and open the firmware.jar with it
3. Now the hardest part. Search for the call number.
It varies with every manufacturer. You have to search for it.
In MIUI it is stored in android.app.wearsettings.WearSettingsEnums.
Search for CELLULAR_SIM_STATUS_NETWORK_TYPE and remember the number shown next to it or note it down somewhere.
In Oxygen Os 11 or probably other AOSPs it is stored in com.android.internal.telephony.ITelephony. Search for TRANSACTION_setPreferredNetworkType. Remember or note down the number.
I don't know about other brands. Maybe with trial and error this list can be expanded.
4. Catch the setting change when you change network type. It's change in preferred_network_mode in global settings. You can catch that using this macro.
https://www.macrodroidlink.com/macrostore?id=18375
Or else if you know what needs to be changed you don't need to use the macro.
5. Change the global settings as per your need using adb shell or Macrodroid settings change
6. Now the other tricky part. To call the setting change you need ADB WiFi on.
adb shell service call phone "number you saved without quotes" i32 "network type code without quotes"
if it's a dual sim you include sim 2 next to first sim.
Eg
adb shell service call phone 247 i32 6
(This changes to EVDO if phone only allows one sim network change)
adb shell service call phone 247 i32 6 i32 6
(This changes to EVDO in SIM 1 and SIM 2 if phone allows both SIM 1 and SIM 2)
The call has to match the setting change otherwise it will not work.
This is a list of network type codes to use in the command :
I'll be free to help when I can
0 = GSM/WCDMA preferred
1 = GSM only
2 = WCDMA only
3 = GSM/WCDMA auto (PRL)
4 = CDMA/EvDo auto (PRL)
5 = CDMA only
6 = EvDo only
7 = CDMA/EvDo/GSM/WCDMA (PRL)
8 = CDMA + LTE/EvDo (PRL)
9 = GSM/WCDMA/LTE (PRL)
10 = LTE/CDMA/EvDo/GSM/WCDMA (PRL)
11 = LTE only
12 = LTE/WCDMA
13 = TDSCDMA only
14 = TDSCDMA/WCDMA
15 = LTE/TDSCDMA
16 = TDSCDMA/GSM
17 = LTE/TDSCDMA/GSM
18 = TDSCDMA/GSM/WCDMA
19 = LTE/TDSCDMA/WCDMA
20 = LTE/TDSCDMA/GSM/WCDMA
21 = TDSCDMA/CDMA/EvDo/GSM/WCDMA
22 = LTE/TDSCDMA/CDMA/EvDo/GSM/WCDMA
23 = NR only
24 = NR/LTE
25 = NR/LTE/CDMA/EvDo
26 = NR/LTE/GSM/WCDMA
27 = NR/LTE/CDMA/EvDo/GSM/WCDMA
28 = NR/LTE/WCDMA
29 = NR/LTE/TDSCDMA
30 = NR/LTE/TDSCDMA/GSM
31 = NR/LTE/TDSCDMA/WCDMA
32 = NR/LTE/TDSCDMA/GSM/WCDMA
33 = NR/LTE/TDSCDMA/CDMA/EvDo/GSM/WCDMA
34 = Unknown