Architecture
A short tour of how one tap becomes a network mode change.
Switching engines
Every switch goes through one class, NetworkModeManager. It takes a mode (NR_ONLY, NR_LTE or LTE_ONLY) and an optional SIM subscription ID. The activation method in Settings decides which engine runs:
- Auto and Direct ADB: try Shizuku, then root, then open RadioInfo. Direct ADB mainly helps you start Shizuku: the app copies the command for you.
- Shizuku: only the Shizuku service. Fails clearly if it is not running or not authorized.
- Root: runs the switch through
su. Includes carrier-specific network types and keeps the allowed-types mask wide, so 2G, 3G and LTE stay available alongside 5G. - RadioInfo: opens the phone’s hidden testing screen so you can choose the type yourself. The app looks for the AOSP, Qualcomm, MediaTek and Samsung variants.
The Shizuku user service
Changing the network type needs a permission normal apps do not have. Shizuku can start a small process for us that runs as the shell user, which does have it. That process is NetworkModeUserService, and the app talks to it through an AIDL interface with four calls:
interface IUserService {
String setNetworkMode(int subId, String mode); // "OK:" prefix means success
int getDefaultDataSubId(); // -1 if unknown
int[] getAvailableSubIds(); // active SIMs
void destroy();
}The service calls the telephony API with fallbacks for phones that restrict it, including Samsung One UI. The app binds to the service when needed and unbinds when done.
Quick Settings tiles and the widget
- Tap. The tile or widget button receives the tap.
- Choose the engine. It uses your saved activation method if that engine is ready. Otherwise it picks Shizuku, then root.
- Switch off the main thread. The work runs in a coroutine, and the tile shows “Switching…” while it waits.
- Report back. The tile updates its label (SA, NSA or LTE) and a short message appears. On failure the old state returns.
There are four tiles: a Power Switcher that cycles SA, NSA and LTE on each tap, a 2-mode toggle between two modes you choose, a Root tile and a Manual 5G Settings tile that opens RadioInfo. The widget has one button per mode and never opens a screen.
Preferences
Settings live in SharedPreferences on the phone. They include the activation method, default mode, the two toggle-tile modes, theme mode, AMOLED, palette, color style, font, auto-scan SIMs, auto-check updates, animations, predictive back and depth blur. Settings can be exported to and imported from a JSON backup file. Nothing is uploaded.