3

At some point in the last year I noticed that my Android device (HTC 10, Android 8.0.0) WiFi would turn on even when I had it turned off. I found out there is a permission called CHANGE_WIFI_STATE, which allows apps to enable/disable WiFi on my device.

I don't want this to happen. I want to be in full control of the WiFi state, for several reasons including the desire to avoid using bad WiFi without forgetting the access point name and key.

Is there any way I can achieve this without uninstalling the guilty apps? Ideally, I'd like to revoke access to the CHANGE_WIFI_STATE permission for all apps present and future, but I would be OK with doing it per-app too.

12
  • Easiest way would be to use a Firewall. See Firewall tag android.stackexchange.com/questions/tagged/firewall
    – beeshyams
    Nov 1, 2018 at 13:37
  • @beeshyams I don't see how a firewall could apply. Can you explain what you mean? Nov 1, 2018 at 14:52
  • Using a firewall, configure it to permit wifi access to apps of your choice. Access /denial will be firewall rules based making it irrelevant whether the app changes the state of wifi
    – beeshyams
    Nov 1, 2018 at 14:57
  • @beeshyams The WiFi state is still relevant because all other apps can use it when it's enabled. Unless I keep changing the firewall rules for all apps whenever I want to enable/disable WiFi. So that doesn't answer the question unfortunately. Nov 1, 2018 at 15:25
  • You set the rules once to allow /deny app wise. If you want to change on need base you do it manually over riding the rules through firewall. For example app A never gets permissible to use Wifi ; app B always is permitted and so on. That's the firewall rule. You want to permit app A to use, change the Firewall settings. If this usage is not what you want, probably you should clarify more in your question
    – beeshyams
    Nov 1, 2018 at 15:33

4 Answers 4

1

You can use Android's native permission manager (appops) to debar apps from using that permission. While you can use appops command using adb, it can become a pain because you need a PC to get that job done, unless you have root access. As an alternative, there are third-party GUI frontends for appops in Play Store, of which, I use App Ops - Permission Manager. It can work with both rooted and non-rooted phone, although, it would still be relatively painful in non-rooted mode.

The app shows tutorial at initial startup, to setup the mode to grant it the requisite privilege. After that, you just find your app in the list, and toggle that permission listed with the title "Connect and Disconnect from Wi-Fi".

Under App Ops app's settings, you can setup a template (allowing or debarring a permission) which would apply on all the newly installed apps.

3
  • OK I figured out how to do all that but unfortunately CHANGE_WIFI_STATE doesn't appear in the list of permissions in App Ops, even for apps that I know have the permission. This seemed so promising but it didn't solve the problem. Thanks anyway. Nov 4, 2018 at 11:04
  • @TheQuickBrownFox The permission is listed with the label "Connect and Disconnect from Wi-Fi". It is hard to believe that the permission cannot be found because I have attached a screenshot in the answer actually. If you have a particular app bothering you, let me know as I would try to test it and then modify my answer accordingly.
    – Firelord
    Nov 4, 2018 at 14:41
  • "Connect and Disconnect from Wi-Fi" isn't there. It's not listed in the "All permissions" section of the app which lets you "View all permissions supported by your system", so I suppose it's not available at all. My phone is not rooted, by the way. Nov 4, 2018 at 15:36
1

The possible problem might be that the protection level of permission became lower. The category of CHANGE_WIFI_STATE permission moved from "Dangerous" to "Normal". The link for Google Git. This means that permission to change the state of WIFI is granted automatically to application, and app doesn't need to ask for permission during running time to turn it on or off.

0

Go to settings -> permissions -> modify system settings and disable all apps' access to the same.

In your device you might find this setting at slightly different location.

0

Although you mentioned using Android 8 (You can get unofficial LineageOS on your HTC 10 device - at the expensive cost of failing SafetyNet verification - so you can choose android 9, 10 and even 11), the following applies on Android 9 and up:

Since Android 9, the setting for allowing or denying apps access to change wifi state is found under: Settings > Apps & Notifications > Special app access > Wi-Fi control.

You would have to deny access one by one, manually.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .