[Samsung Galaxy S8+ Questions & Answers] billa:
Unfortunately starting with Android v8.x.x (Oreo), test codes sent to the RilServiceModeApp via android_secret_code://<code> even by root are being denied.

If the test menu *#2263# or *#2683662# or *#2766338378# doesn't work with your current sim card, then try the following.

Find a couple of other active or inactive sim cards (can be another local carrier or from abroad), let the phone reboot and reconfigure its CSC while on the blue bootup screen, then try the code again, since test codes are CSC specific. It's a hit and miss affair, so be persistent.

If your phone is rooted, you can try these methods one at a time.

After each step, reboot the phone and try the test codes *#2263# or *#2683662# or *#2766338378#.

1. Using Shortcut Master (free version) from the PlayStore, tap on the menu, Secret Code Explorer, scroll down to 2263 or 2683662 or 2766338378 (or Menu > Search for "band"), tap on Launch0.

2. On combination firmware edit the file /efs/carrier/HiddenMenu and /efs/FactoryApp/keystr to be "ON", which will persists even after flashing back to stock firmware.

3. Copy the <CSC>_keystrings.dat from system/etc to root/etc and set permissions to 0744.

4. Try replacing the /system/priv-app/ModemServiceMode/ModemServiceMode.apk=com.sec.android.RilServiceModeApp from a previous Android version which had the codes working, and set the permissions to 0744.

5. Flash an earlier radio (CP) which had the codes working, if the current bootloader allows it to be downgraded.

This last method works on all Samsung models/firmwares without root, but requires a special test cable, which is only available for micro-USB ports at this time.

If you can find a similar cable with a USB-C connector, then it should work just fine. By the way, using an micro to C adapter does not work.

The following is only for phones with a micro-USB port, nonetheless it makes an interesting way to enable the hidden test menus.

You can actually enable most test codes (including RIL test codes which fail to execute on Oreo of newer even while rooted, such as *#2263# band change, *#2683662 lab test mode, and *#2766338378# engineering test menu, etc) on pretty much any model/firmware/region by simply plugging in a test cable into the phone (the other end doesn't have to be plugged in anywhere, it's just the built in resistor which enables test mode/FactoryMode).

It's important to follow the next steps exactly in this order: Open the dialer, exit the dialer with the Back key (not the Home button!), reopen the dialer and now it should accept most test codes.

These cheap test cables can be found on Ebay or AliExpress, just search for "Samsung 523K uart cable" or "Samsung 619K uart cable". Some come as a combo where you can simply switch the resistor values via a switch, but you must try both values, since only one or the other will work on certain models/firmwares/regions.

I've been using this method successfully for many years (currently on my Samsung S7 with the latest 2019 firmware), unfortunately these test cables are only available for micro-USB connectors, so it won't work on the newer USB-C phones even with an adapter (because it doesn't extend the resistor lines, only the data lines). If anyone finds a solution for USB-C, please post a message here.