Closed TPS closed 2 years ago
@TPS Hello. Our developers will take a look at this issue although it doesn't seem like an urgent one. Not sure how much time it will take though. We'll let you know once we get any update.
Hi, I'm the developer of the "FFUpdater" app.
The main problem is, that I was unable to check if my app has internet access or not. Only when I have internet, I want to try to download data from the internet.
With this code I could successfully test if internet is available:
private fun isInternetAvailableNewWay(cm: ConnectivityManager): Boolean {
val activeNetwork = cm.activeNetwork ?: return false
val capabilities = cm.getNetworkCapabilities(activeNetwork) ?: return false
return capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET) &&
capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED)
}
But this does no longer work when the VPN from Adguard is active. Even if the smartphone is in airplane mode, my code returns that there is an internet connection. Is this a bug in Adguard or a limitation of the operating system?
I have solved the problem in my app for now by checking if the IP address of api.github.com can be resolved (DNS). This is not perfect, but should be enough for my purposes.
@Tobi823 It still behaves identically in FfU v74.4.3 & AgA v4.0n24(65). 🤷🏾♂️
This issue can be closed. I confused the bug from @TPS with another bug.
The real bug is, that his smartphone evaluate capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
to false
although it has Internet access.
As far as I can tell, the bug is not related to AdguardForAndroid.
It may not be specific to AGA (e.g., might be w/ any VPN), but it did manifest w/ it on FFU versions < 74.4.5, so it might be worth investigating. @Tobi823 has graciously made a workaround for higher FFU versions, so it might be moot, though.
This is back in FFUpdater under https://github.com/AdguardTeam/AdguardForAndroid/issues/4047's conditions.
Since most recent AG update (v4.0n31), this problem has recurred on all my devices — 32- & 64-bit.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I think this has been solved, so I'm good w/ closing. If it recurs, I'll repost.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Issue Details
Behavior
As shown below, FFUpdater says "No Network Connection" on my Android 8.1.0 32-bit Moto G5+, but updates actually download & install when available. On my Android 11 64-bit TCL 10L, everything shows & works as expected (i.e., shows version number instead of errors).
N.B.: Originally filed @ https://github.com/Tobi823/ffupdater/issues/55, but per dev's notes below, it seems to be an AG glitch, since disabling it solves the problem.
Screenshots
Screenshot:
![Screenshot_20210708-072430.png](https://user-images.githubusercontent.com/185902/125164399-04e29400-e160-11eb-8893-945ae9a926d7.png)Additional Information
Per FFUpdater's dev: