Shadowrocket for Android may work perfectly while the screen is on, then stop routing traffic after the phone is locked, the network changes, or battery saver starts. This is often an Android background management problem rather than a pure node problem.
Quick answer
Shadowrocket for Android relies on Android VpnService to build a local tunnel. If the system restricts background execution, kills the process, pauses network access, or fails to rebuild routes after a network change, the proxy path can become unstable even though the app still appears active.
What VpnService does
VpnService lets an app create a local virtual network interface and route traffic through it. Many proxy clients use this Android API. It does not necessarily mean a traditional VPN provider is being used, but Android manages the tunnel through the system VPN framework.
Why it disconnects in the background
- Battery optimization limits background networking.
- The phone vendor cleanup system stops the app process.
- Wi-Fi sleeps after the screen is locked.
- Battery saver restricts timers and reconnect logic.
- Routes are not rebuilt cleanly after Wi-Fi/mobile network switching.
Settings to check
Disable battery optimization for Shadowrocket for Android, allow background activity, allow auto-start where available, keep the app locked in recent tasks, and check Android VPN settings for always-on VPN behavior. The exact names vary by device brand, but the goal is to keep the tunnel process and network access alive.
How to test network switching
If the issue appears only after switching from Wi-Fi to mobile data or back, open the log immediately after switching. Look for route rebuilds, DNS re-resolution, reconnect attempts, timeout messages, or network changed events.
Relation to mobile VPN disconnects
General mobile VPN disconnects and proxy-client tunnel failures overlap, but Shadowrocket for Android also has routing rules, DNS behavior, node configuration, and local tunnel state. Compare this with the mobile VPN disconnecting on Android or iPhone guide.
What not to do
- Do not run multiple VpnService-based clients at the same time.
- Do not judge node quality while battery saver is changing network behavior.
- Do not rely only on the status icon; verify IP, DNS, or logs.
- Do not assume every background disconnect means the subscription expired.
FAQ
Can the status icon remain while traffic is not proxied?
Yes. Rules, DNS, network switching, or local routing may still send traffic outside the expected path.
Should always-on VPN be enabled?
It can improve persistence, but it may affect local network access or captive portals. Test it with your normal workflow.
Is background disconnect always a server problem?
No. Android power management and network switching should be checked first.