Clash Android App Guide: VpnService Permission and Battery Whitelist Setup

The Android version of Clash doesn't intercept traffic through traditional root access. Instead, it relies on the system's VpnService interface to create a virtual network adapter. Understanding how this authorization flow and system-level restrictions work — and then configuring battery whitelists and autostart permissions for your specific device manufacturer — is key to avoiding random disconnects caused by the OS killing the app in the background.

1. What VpnService Is and Why Clash Uses It

Regular Android apps have no permission to modify the system routing table or intercept another app's network traffic directly. To solve this, Google exposes an official interface called VpnService, which lets an app create a virtual network interface (usually named tun0) once the user grants a one-time authorization, and declare that it wants to handle all or part of the device's traffic. The system then forwards matching packets to this virtual interface, where the authorized app reads, processes, and re-routes them.

Clash and its core, Clash Meta (mihomo), use exactly this mechanism to implement system-wide proxying on Android: once the app successfully requests VpnService permission, a "VPN connected" icon appears in the system status bar. This doesn't mean traffic is actually routed through a traditional VPN server — it means Clash is redistributing traffic that matches your rules to configured proxy nodes locally, while traffic that doesn't match the rules passes through directly. This is the only sanctioned way to achieve TUN-mode-style, system-wide traffic handling on mobile without root access.

Note

The virtual adapter created by VpnService shows up at the system level as "VPN connected," but where the traffic actually goes is entirely determined by your local configuration file. Whether traffic gets proxied, and which node it's routed to, depends on your rules and proxy groups — this is fundamentally different from connecting to a single remote VPN server that handles all traffic.

2. First-Time Authorization and Connecting

The first time you launch Clash on Android and tap "Start" (or a similarly labeled button), the system shows an official permission dialog along the lines of "This app wants to set up a VPN connection. Do you trust this application?" This is a standard OS-level security prompt that every app using VpnService triggers on first launch — it's expected behavior, not an error.

  1. Open the app and confirm your subscription or local config file has been imported, with proxy groups and rules loading without errors.
  2. Tap the start button. When the system authorization dialog appears, tap "OK" or "Allow" to grant trust.
  3. Once authorized, a key-shaped icon appears in the status bar, and pulling down the notification shade shows a persistent "Connected" or "VPN active" notification.
  4. Open any browser or app to confirm you're online, then check the traffic stats inside the client to make sure data is actually flowing — this confirms the proxy chain is working.

If no system dialog appears after tapping to authorize, or if the app immediately reverts to a disconnected state after tapping "OK," another VPN app is usually already active on the device (this includes other proxy tools or an enterprise MDM policy). Android only allows one active VpnService at a time, so you'll need to disable the conflicting app before retrying.

3. Why the Persistent Notification and Background Keep-Alive Matter

A VpnService connection depends on a foreground service to stay alive, and Android requires any service that holds network resources long-term to display a persistent notification — that's why you'll always see an undismissable notification while connected. This isn't an ad or clutter; it's proof of an active foreground service required by the system. If a third-party cleaner force-dismisses that notification or kills the process, the virtual adapter is torn down immediately and the proxy connection drops.

Some users routinely use their phone's built-in "one-tap cleanup" or a third-party security app to clear background processes, and this often wipes out the Clash process along with its notification. It's best to remove the app from the "clearable background apps" list in system settings, or add it to the trusted list in your cleaner app, to avoid unexpected disconnects.

Heads up

Seeing the persistent notification stick around is normal — it means the service is still running in the foreground and the proxy connection is stable. If you force-swipe the notification away, the virtual adapter gets torn down by the system, and you'll need to reopen the app and re-authorize to reconnect.

4. Manufacturer Battery Policies and Whitelist Settings

Chinese phone manufacturers layer more aggressive battery management on top of stock Android to extend battery life, at the cost of aggressively freezing, throttling, or killing background processes flagged as "inactive." This is the main reason Clash can suddenly disconnect after sitting idle for a while on certain devices. Below are troubleshooting steps for a few common manufacturers — exact menu wording may vary by OS version, but the underlying settings logic is consistent.

Huawei / Honor (EMUI / HarmonyOS)

  • Go to Settings → Battery → More Battery Settings → App Launch, find Clash, turn off the automatic management toggle, and manually enable "Auto-launch," "Secondary launch," and "Run in background."
  • Go to Settings → Apps → App Launch Management and double-check the app isn't restricted.
  • Long-press the app card in the recent tasks view and select "Lock" to prevent it from being cleared by the system.

Xiaomi (MIUI / HyperOS)

  • Go to Settings → Apps → Manage Apps, find Clash, and turn on the "Autostart" toggle.
  • Go to Settings → Battery & Performance → App Battery Saver → select the app, then change the power-saving policy from "Smart battery saver" to "No restrictions."
  • In the recent tasks view, pull down on the app card and tap the lock icon to pin it, preventing it from being killed by one-tap cleanup.

OPPO (ColorOS) and vivo (OriginOS / Funtouch OS)

  • Go to Settings → Battery → App Battery Usage (or Background Power Management) and set Clash to "Allow background activity" or "No restrictions."
  • Go to Settings → App Management → Permissions → Autostart and manually enable the toggle for the app.
  • On some devices, you'll also need to confirm this again in Security Center → Permissions & Privacy → Autostart Management.

Samsung (One UI)

  • Go to Settings → Battery → Background Usage Limits and make sure Clash isn't listed under "Sleeping apps" or "Deep sleeping apps."
  • If it's already been added automatically, tap the app name to remove the restriction, then go to Settings → Apps → Clash → Battery and select "Unrestricted."

Regardless of the brand, the core approach is the same: find the three settings areas — battery optimization, background app management, and autostart — and whitelist or unrestrict Clash in each one. Stock Android (like Pixel devices) is comparatively lenient, and usually only requires setting the app to "Don't optimize" under Settings → Apps → Special app access → Battery optimization.

5. Autostart Settings and Boot Behavior

If you want the proxy to automatically resume after a reboot, you'll need more than just the system-level autostart toggle covered above — check whether the client itself has an option like "Launch on system startup" or "Auto-connect on boot" enabled (exact wording varies by app). With this enabled, the client tries to relaunch itself and re-establish the VpnService connection when the system broadcasts the "boot completed" event — but only if system-level autostart permission has already been granted. Otherwise the app process can't even be woken up, and the in-app setting does nothing.

It's also worth noting that some manufacturer OS builds separately manage "background pop-up windows" and "autostart." Even with autostart enabled, the system may still block the app from showing an authorization dialog on its own in the background. In that case, you'll need to manually open the app once after booting to complete a silent reconnect before the connection stabilizes.

6. Troubleshooting Common Disconnect Scenarios

If the proxy keeps dropping a while after the screen locks, work through these steps in order:

  1. Check whether the persistent notification is still showing. If it's gone, the service has been killed by the system — go back through section 4 and verify your battery and autostart settings one by one.
  2. Check the connection logs or traffic stats inside the app to see whether the disconnect lines up with system events like screen lock, toggling airplane mode, or switching between Wi-Fi and mobile data — these network changes can sometimes cause the system to briefly tear down and rebuild the VpnService.
  3. Make sure no other app using VpnService is running at the same time, since only one can hold the single available VPN channel.
  4. If you're using dual SIM or frequently switching networks, try enabling an "auto-reconnect on network change" option in the client settings (if available) to reduce the need for manual intervention.
  5. Confirm the system itself doesn't have "Battery saver" or "Ultra battery saver" mode enabled — these global modes tend to override per-app whitelist settings and take priority over them.
Tip

Once you've set up the battery whitelist, autostart permission, and background lock all at once, most devices can keep the proxy running stably for long periods without needing to redo these steps every time you restart your phone.

Download Client