Skip to content

bug: Manager API Failure (Unable to resolve host) caused by unhandled SecurityException (ACCESS_NETWORK_STATE) #3376

@bombz88

Description

@bombz88

Bug description

On hardened environments (Android 16 base), ReVanced Manager fails to connect to the API, displaying an APIFailure: Unable to resolve host "api.revanced.app" toast and an "API service is currently down" banner.

Initially, this appears to be a DNS or carrier routing block. However, after isolating the network (successful ping/curl from Termux on the same device/connection) and capturing a Trace-level logcat, the root cause is actually an unhandled SecurityException crashing the update checker thread prior to the API request.

Because the OS strictly enforces network state permissions, when the Manager calls NetworkInfo.isUnmetered(), the OS denies getActiveNetwork() and throws a fatal exception. Because this exception is not caught, it crashes the coroutine, cascading into the subsequent UnknownHostException for the API.

Image Image Image

Patch logs

N/A

Debug logs

05-24 15:15:13.739 E ReVanced Manager: Got exception while executing Update check
05-24 15:15:13.739 E ReVanced Manager: java.lang.SecurityException: ConnectivityService: Neither user 10155 nor current process has android.permission.ACCESS_NETWORK_STATE.
05-24 15:15:13.739 E ReVanced Manager: at android.net.IConnectivityManager$Stub$Proxy.getActiveNetwork(IConnectivityManager.java:1769)
05-24 15:15:13.739 E ReVanced Manager: at android.net.ConnectivityManager.getActiveNetwork(ConnectivityManager.java:1553)
05-24 15:15:13.739 E ReVanced Manager: at app.revanced.manager.data.platform.NetworkInfo.getCapabilities(NetworkInfo.kt:11)
05-24 15:15:13.739 E ReVanced Manager: at app.revanced.manager.data.platform.NetworkInfo.isUnmetered(NetworkInfo.kt:12)
...
05-24 15:15:13.976 D API : Requesting: https://api.revanced.app/v5/manager
05-24 15:15:14.010 E ReVanced Manager: Failed to fetch: error: java.net.UnknownHostException: Unable to resolve host "api.revanced.app": No address associated with hostname, body: null

Proposed Solution:
Wrap isUnmetered() and getCapabilities() in app.revanced.manager.data.platform.NetworkInfo with a try/catch block. If a SecurityException is caught, safely default the return to false (metered connection). This will allow the app to gracefully continue its API fetch instead of crashing the thread on strict Android environments.

Steps to reproduce

Install ReVanced Manager 2.6.0 on an environment with strict permission enforcement where ACCESS_NETWORK_STATE is implicitly denied.
Ensure the device is on a cellular network (or network state is restricted).
Open ReVanced Manager.
Observe the "API service is currently down" banner and "Unable to resolve host" UI error.

Acknowledgements

  • I have checked all open and closed bug reports and this is not a duplicate.
  • I have chosen an appropriate title.
  • All requested information has been provided properly.
  • The bug is only related to ReVanced Manager.

Metadata

Metadata

Assignees

Labels

Bug reportSomething isn't working

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions