MacroDroid Helper APK

Mila_s

New member
Simply toggling the USB Debugging option off and on helped, when the device is plugged in, helped. No dialogue appeared, but I can see the device in an adb devices list now. Thanks!
 

Rainman67

New member
The same thing happens to me, mobile data is not activated or deactivated.
I have the same problem with my Xiaomi Mi 11 Lite 5G (Android 13). To disable mobile data works without problems, but to enable mobile date is not working. But I have an idea, what can be the reason for this problem. I had a look in the log-file of "MD Helper" (appending this posting). It has to do with "WiFi Hotspot" and I think it is a bug in the Xiaomi Firmware. In the second Screenshot you can see, that there is written "Mi 11 Lite 5g is active", but my hotspot in truth is disabled. This also explains the message in MD Helper "Cannot set when hotspot is enabled".

Maybe the developers of Macrodroid can find a way to fix this problem?

Sorry for my bad english! ;)
 

Attachments

  • MD_Helper_log.jpg
    MD_Helper_log.jpg
    193.5 KB · Views: 6
  • Screenshot_Hotspot.jpg
    Screenshot_Hotspot.jpg
    69.7 KB · Views: 7

Ppeinard

New member
In order to toggle Wifi (and a number of other features) on devices running Android 10+ a new helper file is now required. This helper file is built against an older target SDK allowing it to still invoke the Wifi functionality. It cannot appear on the Play Store since they no longer allow apps built against older SDKs to be uploaded.

The latest version of the MacroDroid Helper APK is attached to this post and can also be downloaded from the following link:

https://www.macrodroidforum.com/MacroDroidHelper_v1_7.apk

You may need to long press and click the download link above to get the file to download.

Note that you will have to allow installation of APKs from external sources in order to install this APK.

This APK replaces all functionality in the older Settings Helper available on the Play Store (so you may also uninstall). It also supports a new option in the system settings action as this may enable some settings which cannot be changed in the main app to be modified by the helper file.

After installation please launch the helper file and grant location permission and disable battery optimization (This is vital for everything to function reliably). You should be prompted for these at app launch but you can also do it via your phone's settings app.

Why is this needed?

In simple terms because Google is gradually crippling the functionality of Android over time. On Android 10 and above when your app is built to target Android 10 then the set wifi request simply will no longer function. Google thinks users are too dumb to cope with more permissions, so instead of providing an explicit permission for this that apps can request, they take a blanket approach of disabling features that have worked for 10 years on Android "to protect user privacy", breaking 1000s of apps in the process.

API spec is here: https://developer.android.com/reference ... d(boolean)

Bug report/request to remove this limitation is here: https://issuetracker.google.com/issues/128554616 (Please star the issue if you haven't already)

If you are confused how it used to work on Android 10 without the helper then the reason is because the app was previously built to target Android 9, so this restriction didn't apply at that stage. In order to publish updates on the Play Store now all apps must target Android 10.
Hi, I am using another way to toogle wifi and perhaps this 'helper apk' could work better ? but I am afraid to spoil my actual macro which has worked for years.
Here it is:
- take the simplest and lightest 'wifi on/off' apk on playstore (verify if it still works;-)
Mine is from 'Active Soft', weight as low as 80ko
- to be sûre it will toogle in right position, use a repeat boucle twice, e.g to 'disable wifi':
* boucle begin
* if wifi is disabled > exit boucle
* launch app: 'wifi on/off' (equivalent to one click on its button)
* wait 1 second (don't hurry system)
* repeat boucle a second time
So to enable wifi again, use once more this boucle and of course with the opposite word
 

Dimlos

Well-known member
Why don't you clone the macro and test it?
If it doesn't work, you can also use ADB Shell [Tasker Plugin] and operate it with ADB commands.
 

Ppeinard

New member
Why don't you clone the macro and test it?
If it doesn't work, you can also use ADB Shell [Tasker Plugin] and operate it with ADB commands.
Thanks for your advice...
I have created this 'custom wifi toogle addon' 2 or 3 years ago and at that time my brain works better... I am too old to get into headache again for something which still is working more than fine so far.
Reminder, the 'wifi on/off' apk from 'Active soft' weigh almost nothing ! 80ko !
 

dhj49er

Well-known member
Thanks for your advice...
I have created this 'custom wifi toogle addon' 2 or 3 years ago and at that time my brain works better... I am too old to get into headache again for something which still is working more than fine so far.
Reminder, the 'wifi on/off' apk from 'Active soft' weigh almost nothing ! 80ko !
This approach only works when the screen is on. I need to be able to toggle WiFi when the screen is off. Consequently I use the ADB shell commands.
 

Ppeinard

New member
This approach only works when the screen is on. I need to be able to toggle WiFi when the screen is off. Consequently I use the ADB shell commands.
'When screen is off' ? (Why do you need to do something when screen is sleeping ?). But 'when the screen turns to off', it works. I have created an Auto wifi on/off (there are a lot on Playstore, but none of them satisfy me). If I have time, I will load it in forum.
 

dhj49er

Well-known member
'When screen is off' ? (Why do you need to do something when screen is sleeping ?). But 'when the screen turns to off', it works. I have created an Auto wifi on/off (there are a lot on Playstore, but none of them satisfy me). If I have time, I will load it in forum.
Here is an example of doing something when the the screen is off. A very important something.
At home I have a poor mobile signal, so I use WiFi calling and turn on airplane mode to make sure WiFi calling is used and to save battery.
On leaving home, the phone is usually in a pocket with the screen off, when WiFi disconnects due to distance from the router.
A macro triggers on loss of wifi, turns off airplane mode, turns on mobile data and turns off WiFi, all with the screen off. Consequently I know my phone is ready to use while I'm away from home, importantly without any user intervention.
I have other macros that are designed to run only when the screen is off, to avoid user actions potentially interfering with the macros if run with the screen on.
 

Dm114

Well-known member
Here is an example of doing something when the the screen is off. A very important something.
At home I have a poor mobile signal, so I use WiFi calling and turn on airplane mode to make sure WiFi calling is used and to save battery.
On leaving home, the phone is usually in a pocket with the screen off, when WiFi disconnects due to distance from the router.
A macro triggers on loss of wifi, turns off airplane mode, turns on mobile data and turns off WiFi, all with the screen off. Consequently I know my phone is ready to use while I'm away from home, importantly without any user intervention.
I have other macros that are designed to run only when the screen is off, to avoid user actions potentially interfering with the macros if run with the screen on.
I have nearly the same macro (about wifi) for the same reasons as yours! 😉😀
 

Ppeinard

New member
Here is an example of doing something when the the screen is off. A very important something.
At home I have a poor mobile signal, so I use WiFi calling and turn on airplane mode to make sure WiFi calling is used and to save battery.
On leaving home, the phone is usually in a pocket with the screen off, when WiFi disconnects due to distance from the router.
A macro triggers on loss of wifi, turns off airplane mode, turns on mobile data and turns off WiFi, all with the screen off. Consequently I know my phone is ready to use while I'm away from home, importantly without any user intervention.
I have other macros that are designed to run only when the screen is off, to avoid user actions potentially interfering with the macros if run with the screen on.
I have created an 'auto wifi on off' (there are plenty on Playstore) I will upload mine soonly. Then for you,
Just unlock mobile > wifi turns on automatically...
- if you are at home it will reach whatever SSID, so just use it
- if you are out of home, samely, the wifi turning on will try to reach any wifi available and give up after 15 seconds (this can be done by checking connectivity, see below). Then just turn on 'automatically' data mobile to continue.
Unfortunately, nowaday (due to google) it is impossible to turn 'automatically' data, unless on rooted mobile or ADB commands proposed by Macroid (too hassle for me).

I think to understand your need. You want to still runs some Apk, like Gmail, WhatsApp, etc... through wifi if available if not by mobile data ?
Macroid can, trigglers are (put all together):
- screen on, screen off, power plugged, unplugged, all imaginable actions you do 50 times a Day
- perhaps also a timer for every hour, or 2 ?
Actions are:
- mobile data is actually off
- turn wifi on
- check connectivity, means sending a ping to whatever server (google.com)
- if returns True (means you are at home) then continue (and confirm mobile data stays off)
- if not (you are not at home), turn off wifi and turn on mobile data... but as said, impossible nowaday, unless by ADB.
One can improve by:
- stop wifi/data after 30minuts, time to load whatever informations needed to save battery (reminder: by timer macro will work again next hour)
- keep wifi if power is plugged

Is something like that you have created ?
 

dhj49er

Well-known member
Yes and more but you have missed an important aspect..my MD macros work without user intervention.

Your approach, using a third party app, requires you to unlock the phone. So it's not full automation.

I would suggest you look at just using Macrodroid as it can easily do what your play store app does and a lot more without unnecessary user intervention.
 

Ppeinard

New member
Yes and more but you have missed an important aspect..my MD macros work without user intervention.

Your approach, using a third party app, requires you to unlock the phone. So it's not full automation.

I would suggest you look at just using Macrodroid as it can easily do what your play store app does and a lot more without unnecessary user intervention.
Perhaps... let's say, whatever macro, functions on whatever programs (this one, automate, tasker, iftt, alexa, smart life, etc...) needs obligatory an 'event' for macro beginning to run. What kind of event can happen to a sleeping material ? Unless a timer awaking macro at regular definite period. What could be your else event ?
Anyway, I am using Macrodroid, for more than 2 years, running than 20 times a day. It has ability to active anything at definite events, so instead of activing an ADB function (requesting headache learning), why not start a toogle wifi app ( so, so easy, no headache).
Note as playstore 'data on/off' apk doesn't exist anymore, so perhaps in future I will lead to ADB function, but actually I don't need this function
 

dhj49er

Well-known member
Perhaps... let's say, whatever macro, functions on whatever programs (this one, automate, tasker, iftt, alexa, smart life, etc...) needs obligatory an 'event' for macro beginning to run. What kind of event can happen to a sleeping material ? Unless a timer awaking macro at regular definite period. What could be your else event ?
Anyway, I am using Macrodroid, for more than 2 years, running than 20 times a day. It has ability to active anything at definite events, so instead of activing an ADB function (requesting headache learning), why not start a toogle wifi app ( so, so easy, no headache).
Note as playstore 'data on/off' apk doesn't exist anymore, so perhaps in future I will lead to ADB function, but actually I don't need this function
I'm sorry but you don't appear to fully use Macrodroid.
There are numerous events that can happen when the phone is asleep.
I previously mentioned one - WiFi disconnects on leaving home with your phone in your pocket with the screen off.
Often that pocket is in my cycling jacket and I'm about to start a bike ride and definitely wouldn't want to mess with my phone to start a macro.
I started to use Macrodroid in 2014, prior to that I used Llama for many years until it was discontinued. So I have well over a decade of experience.
I have had numerous phones and enjoy setting up Macroroid on each new phone.
I had to learn how to use ADB shell last year and found the numerous threads on these forums to be extremely helpful.
 

olekoman

New member
Na tel. Redmi note 10s jsem vytvořil makro, když se zapne rádio v autě a poté se spojí s bluetooth s mob.tak by se mělo vypnout WiFi a naopak. Chtělo to pom.aplikaci tak jsem ji nainstaloval a vše povolil. Po připojení k rádiu mi vyskočí hláška a musím stejně potvrdit ručně. Co dělám špatně a poradí někdo jak to zprovoznit? Hlavně mi tu nepište proč vypínám WiFi😂
 

Attachments

  • Screenshot_2023-03-16-19-31-40-112-edit_com.miui.securitycenter.jpg
    Screenshot_2023-03-16-19-31-40-112-edit_com.miui.securitycenter.jpg
    121.6 KB · Views: 2

Dimlos

Well-known member
The problem with the confirmation dialog will be resolved in a new helper under development.
Please wait for the official release.
 
Top