Android 11 - WLAN is no longer switched on and off despite Helper APK and ADB Hack

meute

New member
Hello,

Android 11 has recently been installed on my Samsung A41.
Now I have found that WLAN can no longer be switched off and on.

I have now installed the MacroDroid Helper APK 1.5. Had the 1.4 on it so far.
I ran the ADB hack again.

But unfortunately WiFi still won't turn off and on.
Does anyone have any idea where the problem could be?

LG
 

FrameXX

Well-known member
There's a dedicated toggle in Android settings to allow or disallow apps to control Wi-Fi, but it should be allowed by default. Settings > Apps & notifications > Special app access > Wi-Fi control - check it there. If this is ok, then I have no clue whta could be happening. You tested the action directly and it doesn't work?
 

dhj49er

Active member
Also check that location is ON.
Google introduced a change in 11 that requires Location to be ON to control WiFi. If Location is OFF, no app can control WiFi, even with special access enabled, but manually toggling the WiFi icon in the status Bar still works. So blame Google for this change which I understand they introduced to improve device security. Beats me how this improves device security. I think it's Google making sure Location is ON to aid their tracking your phone. So make sure all Google tracking options are off in Location settings, if you don't want to be tracked.
 

FrameXX

Well-known member
Also check that location is ON.
Google introduced a change in 11 that requires Location to be ON to control WiFi. If Location is OFF, no app can control WiFi, even with special access enabled, but manually toggling the WiFi icon in the status Bar still works. So blame Google for this change which I understand they introduced to improve device security. Beats me how this improves device security. I think it's Google making sure Location is ON to aid their tracking your phone. So make sure all Google tracking options are off in Location settings, if you don't want to be tracked.

Thanks for informing. I recently felt like I can stand Google again and there's has been some good things made, but this information pissed me off again! I will never learn from this!

At least you can make it easy by turning location ON and back OFF when MacroDroid operates, but why this needs to be a thing? 😭😥

but manually toggling the WiFi icon in the status Bar still works

At least! I thought we would need Google's blessing everytime we dare to turn that Wi-Fi OFF!
 
Last edited:

dhj49er

Active member
At least you can make it easy by turning location ON and back OFF when MacroDroid operates, but why this needs to be a thing? 😭😥
That's what I do at night, if I need to use WiFi. At night a macro puts the phone into power save mode - airplane mode on, WiFi off,BT off, location off. Anything that I don't need when I'm asleep is turned off! In the morning another macro returns the phone to a usable mode, by turning everything on. In 8 hours of power save, battery consumption is ~1%
The rest of the time I leave location on, but deny Google history & tracking access via location settings.
What would we do without Macrodroid!!
 

meute

New member
There's a dedicated toggle in Android settings to allow or disallow apps to control Wi-Fi, but it should be allowed by default. Settings > Apps & notifications > Special app access > Wi-Fi control - check it there. If this is ok, then I have no clue whta could be happening. You tested the action directly and it doesn't work?
Yes, I tested the action directly and it doesn't work.
MacroDroid and MD Helper is allowed to toggle WLAN.

Also check that location is ON.
Yes, location ist on.
 

dhj49er

Active member
Have you tried using the Global setting wifi_on to control WiFi?
If that doesn't work, it looks like the update has caused the issue. I have had several Samsung phones all running Android 11 and none of them had this issue.
You could try clearing cache, but I think the only way to eliminate and confirm the update as the cause is to do a factory reset.
If you don't want to do a factory reset, then the UI method should work, but only with the screen on.
Use quick setting shortcut or expand status bar, then click on the X,y coordinates of the WiFi icon.
 

Jacob L

Moderator
Maybe backup your macros and uninstall MacroDroid and install it again, import saved macros and grant permissions again
 

meute

New member
Maybe backup your macros and uninstall MacroDroid and install it again, import saved macros and grant permissions again
That was the solution.

MacroDroid can now switch WiFi again.
What have I done?
- Macros exported.
- MacroDroid uninstalled. (MacroDroid Helper APK was NOT uninstalled)
- MacroDroid reinstalled.
- Macros imported again.
- ADB hack again

Thanks for your tips.
 
Last edited:

villain222

New member
hey all. I'm on a rooted oneplus6 and I found something that might help working around these issues. The problem is, it is not consistent. So there is an ADB hack to remove wifi from the radios that get turned off in Airplane mode. I've done it a couple times and after you restart then the wifi on and off actions will work in airplane mode. However if you restart again, it breaks. To get it going again, you have to set the radios back to what they were, restart, remove wifi again. Then restart to get it going again. Sucks, but there might be a path to make it work more consistently.
 

dhj49er

Active member
hey all. I'm on a rooted oneplus6 and I found something that might help working around these issues. The problem is, it is not consistent. So there is an ADB hack to remove wifi from the radios that get turned off in Airplane mode. I've done it a couple times and after you restart then the wifi on and off actions will work in airplane mode. However if you restart again, it breaks. To get it going again, you have to set the radios back to what they were, restart, remove wifi again. Then restart to get it going again. Sucks, but there might be a path to make it work more consistently.
I haven't rooted my phone.
I have a simple macro that toggles WiFi on and off when In Airplane mode.
T empty or whatever trigger you decide to use.
A screen on: constraint screen off
A wait 200 ms
A expand status bar
A wait 200 ms
A UI integration - click on X,Y values for centre of WiFi icon.
A wait 200 ms
A Collapse status bar
A screen off (if the macro has turned it on)
This works with the screen on or off. For the latter you will need to enable status bar on lock screen in phone settings.
Works every time to toggle WiFi setting, make sure location is on before the macro is executed.
 

pr3jker

Member
So, are the guys who refuse to be tracked by google location the same that use their credit card at Starbucks or MacDo?
 

D95gas

New member
That's what I do at night, if I need to use WiFi. At night a macro puts the phone into power save mode - airplane mode on, WiFi off,BT off, location off. Anything that I don't need when I'm asleep is turned off! In the morning another macro returns the phone to a usable mode, by turning everything on. In 8 hours of power save, battery consumption is ~1%
The rest of the time I leave location on, but deny Google history & tracking access via location settings.
What would we do without Macrodroid!!
Would be very interested in the macro you use for night. That was the sort of thing that put me onto MacroDroid in the first place. I did purchase TASKER but its not that easy to use....... Well I didn't feel so, where as this app is a lot easier.... Hats off to the Dev's.
 

Purrbox

New member
Did you ever get this working?

Please could you share your macro with me. I'm trying to do exactly the same thing and having trouble
 

Purrbox

New member
I haven't rooted my phone.
I have a simple macro that toggles WiFi on and off when In Airplane mode.
T empty or whatever trigger you decide to use.
A screen on: constraint screen off
A wait 200 ms
A expand status bar
A wait 200 ms
A UI integration - click on X,Y values for centre of WiFi icon.
A wait 200 ms
A Collapse status bar
A screen off (if the macro has turned it on)
This works with the screen on or off. For the latter you will need to enable status bar on lock screen in phone settings.
Works every time to toggle WiFi setting, make sure location is on before the macro is executed.
This is how I did it. But for some reason, it still wouldn't sometimes work, all the other clicks would work except the WiFi button.

The script kept growing in complexity with all these different workarounds, changing refresh rate, disabling battery saving. In the end, I just gave up and accepted that when I get home, switching on airplane mode and then wifi is something I'll have to do manually. I'm used to it now and I just do it naturally as part of my routine.
 

dhj49er

Active member
This is how I did it. But for some reason, it still wouldn't sometimes work, all the other clicks would work except the WiFi button.

The script kept growing in complexity with all these different workarounds, changing refresh rate, disabling battery saving. In the end, I just gave up and accepted that when I get home, switching on airplane mode and then wifi is something I'll have to do manually. I'm used to it now and I just do it naturally as part of my routine.
That does look complex....are you turning on airplane mode, battery saving and changing the refresh rate when leaving home?
Fortunately Macrodroid can do all that without needing to use UI actions, if your phone has system settings for refresh rate.
I develop complex macros in stages...starting with 1 action and only adding more after thoroughly testing the macro.
For example you could start with turning airplane mode on and off when you leave and return home. Have you set Macrodroid as the default digital assistant app? This allows airplane on off actions to work.
A simple macro would be

T WiFi Connected (to home ssid)
T WiFi Disconnected (to home ssid)
A if WiFi Connected triggered
A Airplane Mode OFF
A End If
A if WiFi disconnected triggered
A Airplane Mode ON
A End if

You will need a macro that turns on WiFi.
I use a macro triggered by screen on to do that.
 
Top