One Tap Network Reset — research
A small Kotlin Android app with two jobs: (1) one tap resets a stuck mobile connection, the way airplane mode does, but without airplane mode or the mobile data switch; (2) a notification that says “SIM n: 5G Unlimited activated” when that SIM is on high-band 5G.
Code: github.com/R-Dilipkumar/one-tap-network-reset · Download APK
1. Why airplane mode makes the internet fast again
Turning airplane mode on and off makes the modem fully leave the mobile network and join again. On the way back it:
- picks the best tower and band again, instead of staying stuck on a busy or weak one;
- opens a fresh data session (often a new IP address and a new route through the carrier);
- re-adds the 5G part of the link (in NSA 5G, the 5G carrier rides on top of a 4G anchor and can get stuck “off”).
The downside: airplane mode also turns off Wi‑Fi and Bluetooth (on most phones) and needs several taps. Restarting only the cellular radio gives the same effect without that.
2. What Android lets an app do
| Action | Normal app | Shizuku (shell) | Root |
|---|---|---|---|
| Toggle airplane mode | No (system only since Android 4.2) | Yes | Yes |
| Toggle mobile data | No (needs MODIFY_PHONE_STATE since Android 5) | Yes | Yes |
| Cellular radio off/on per SIM | No | Yes | Yes |
| Change allowed network types (e.g. drop 5G for a moment) | No | Yes (Android 12+ API) | Yes |
| Tell Android “this network is bad, re-check it” | Yes | Yes | Yes |
Why Shizuku works: the shell user's manifest in Android's source grants MODIFY_PHONE_STATE, READ_PRIVILEGED_PHONE_STATE and WRITE_SECURE_SETTINGS. Shizuku runs a small server as that user and lets an approved app make system calls through it.
Things that look useful but are not
cmd phone restart-modem— only works as root and on debug (non-retail) builds.service call phone <number>— the numbers change between Android versions and phone makers, so it breaks easily. The app instead asks the phone's ownITelephonyclass for the method by name.- Settings “Internet” panel (Android 10+) — works without rights, but it is a screen, and the goal is no UI.
3. How the one-tap reset works
Three ways to tap: the app icon (no screen opens), the Quick Settings tile “Net Reset”, or the Reset network button on the 5G notification. Each tap runs:
- Shizuku running and allowed? → call
ITelephony.setRadioForSubscriber(subId, false)for each SIM, wait 2.5 s, then…(subId, true). - Otherwise root available? → run the same code as root:
su -c "CLASSPATH=<app apk> app_process /system/bin …RootMain cycle <SIM ids>". - If the radio call is refused → 5G nudge (Android 12+): remove 5G from the allowed network types for 3 s, then put back the exact old setting. The modem drops and re-adds 5G.
- Neither Shizuku nor root → soft refresh:
ConnectivityManager.reportNetworkConnectivity(network, false), which makes Android re-check the network. Weak, but needs no rights. A message says so.
Afterwards the app waits (up to 20 s) for mobile data to reconnect and shows “Mobile network reset ✓”.
// Shared by the Shizuku and root paths (PrivOps.kt, simplified)
val telephony = ITelephony.Stub.asInterface(phoneBinder) // by reflection
try {
for (sub in sims) telephony.setRadioForSubscriber(sub, false)
Thread.sleep(2500)
} finally {
for (sub in sims) telephony.setRadioForSubscriber(sub, true) // always back on
}
4. What runs on which Android version
| Android | Reset with Shizuku / root | Getting Shizuku started | 5G status listener |
|---|---|---|---|
| 10 | Radio off/on | Needs a PC (adb) once after each reboot | PhoneStateListener |
| 11 | Radio off/on | Wireless debugging on the phone itself, no PC | PhoneStateListener |
| 12 – 13 | Radio off/on, fallback 5G nudge | Wireless debugging | TelephonyCallback |
| 14 – 16+ | Same (radio power goes through Android's “user” reason internally) | Wireless debugging | TelephonyCallback; notification uses foreground type specialUse |
With root, Shizuku is not needed at all and nothing has to be started after a reboot.
5. The 5G Unlimited notification
Where *#*#4636#*#* gets its values
The “Phone info” screen reads two hidden methods of android.telephony.ServiceState:
| 4636 label | Method | Values |
|---|---|---|
| NR State (NSA) | getNrState() | 0 NONE · 1 RESTRICTED · 2 NOT_RESTRICTED · 3 CONNECTED |
| NR Frequency | getNrFrequencyRange() | 0 UNKNOWN · 1 LOW (<1 GHz) · 2 MID (1–3 GHz) · 3 HIGH (3–6 GHz) · 4 MMWAVE (>6 GHz) |
Rule used: NR State = CONNECTED and NR Frequency = HIGH → “SIM n: 5G Unlimited activated”. SIMs that don't match are left out of the notification.
How the app reads them
- One listener per active SIM (
TelephonyManager.createForSubscriptionId). It re-registers when SIMs change. - On current Android,
ServiceState.toString()hides both values on retail phones (prints****/ UNKNOWN), so reading the text does not work. The app calls the two hidden methods directly by reflection, after lifting Android's hidden-API block with the open-source HiddenApiBypass library. - Android removes only cell location from the service state it sends to apps. NR state and NR frequency stay, so no location permission is needed. Only “Phone” permission (to list SIMs) and notifications.
Limits
- Second SIM: with two SIMs, usually only the mobile-data SIM carries 5G data, so the other SIM rarely shows CONNECTED.
- 5G SA (standalone): “NR State (NSA)” is about non-standalone 5G. On SA networks it can stay NONE even when you are on 5G, so the rule would not match. If your carrier uses SA, the rule can be extended.
- Some phones never fill NR Frequency (4636 shows UNKNOWN too). Then the rule cannot match on that phone.
- The public, no-reflection signal is
TelephonyDisplayInfo(the “5G” / “5G+” icon), but it does not tell the band, so it cannot check “HIGH”.
6. Setup
- Install the APK (
adb install -r app-debug.apk) and tap the icon once. Allow Phone and Notifications. The 5G notification appears. - Install Shizuku. In it, follow “Start via Wireless debugging” (Developer options → Wireless debugging → pair). Android 10 needs a PC instead.
- Tap the Net One Tap icon again and allow it in Shizuku's dialog.
- Optional: pull down Quick Settings → edit → add the “Net Reset” tile.
- After a phone restart, open Shizuku and tap Start again (not needed with root).
7. Safety and limits
- The radio is always switched back on, even if something fails in between.
- The reset is skipped during a phone call.
- Airplane mode, Wi‑Fi, Bluetooth and the mobile data switch are never changed.
- If signal ever does not come back, toggle airplane mode once or restart the phone.
- A reset only helps when the problem is on the phone ↔ tower link. It can't fix a slow carrier network or a busy website.
8. Sources
- AOSP: Shell app manifest (shell permissions)
- AOSP: ITelephony.aidl (setRadioForSubscriber, setAllowedNetworkTypesForReason)
- AOSP: TelephonyShellCommand (
cmd phone, restart-modem rules) - AOSP: ServiceState (getNrFrequencyRange, masked toString)
- AOSP: NetworkRegistrationInfo (NR state values)
- AOSP: TelephonyRegistry (what apps receive, permissions)
- Android: 5G detection with TelephonyDisplayInfo
- Android: ConnectivityManager.reportNetworkConnectivity
- Shizuku API (ShizukuBinderWrapper)
- AndroidHiddenApiBypass