Macro to unblock smartphone ? Doesn´t work !

dihelson

New member
Samsung S20 FE:
Google assistant works even when the screen is blocked. I created a macro on macrodroid to unblock the screen, but when I call it using google assistant, say: "Ok, google, run youtube", it says: "Ok, but you need to unblock the phone first", So I say: "Run unblock macro in macrodroid" or the trigger to it. It answers: "Ok, but you need to unblock the screen first". No solution ?
 

FrameXX

Well-known member
It is just possible that unblock action doesn't work. Did you tryed if it actually works? From what I know 'Set Screen Lock' action doesn't work on most of the devices. How are you 'unblocking' the screen? You mean unlocking?

Also, even if the 'Set Screen Lock' action actually works you still may need to swipe up to really unlock the phone.
 

dhj49er

Well-known member
Samsung S20 FE:
Google assistant works even when the screen is blocked. I created a macro on macrodroid to unblock the screen, but when I call it using google assistant, say: "Ok, google, run youtube", it says: "Ok, but you need to unblock the phone first", So I say: "Run unblock macro in macrodroid" or the trigger to it. It answers: "Ok, but you need to unblock the screen first". No solution ?
Unfortunately, Google have changed how lock and unlock work in later versions of Android. In these, no app is allowed to unlock a phone that uses fingerprint or face unlock. So it's not Macrodroid but Google who is the cause of the problem.
There are workarounds, involving using different unlock methods such as PIN. Then use a macro to input the pin using UI actions. This is not a good solution as it poses a security risk.
Another workaround is to use Google Smart Lock. Typically a wearable could be your trusted device.
Then the phone will unlock when the screen turns on, providing the wearable remains connected to your phone. A gesture may be required to dismiss the lock screen. This is phone dependent.
I used to use Smart Lock when I had phones with poor fingerprint and face unlock performance such as Samsung and OnePlus phones. However, I stopped using it when I moved to Oppo phones. The fingerprint and face unlock are extremely fast and always work and don't require a macro to remove the lock screen.
In addition, I don't now have any macros that require the screen to be auto unlocked. On Oppo I have a system setting to enable the status bar on the lock screen. I use it in macros to toggle WiFi and data when the screen is off and the phone is locked. A really useful feature.
 

MacroDroidDev

Administrator
Staff member
As stated Google have locked down phones pretty tightly now to ensure apps cannot unlock the device. The only way I know of is to use the UI interaction to auto enter pin values if you have a pin entry enabled.
 

Khaoz

New member
Is macrodroid having any problems with the UI interaction feature? I only ask because I'm trying to use it I have a Samsung Galaxy s22 and it's not working it works the first time I test it when I create the macro for it when I go to test it again after that it doesn't work anymore what is going on am I doing something wrong???
 

MacroDroidDev

Administrator
Staff member
Have you disabled battery optimization for MacroDroid and configured your device as described at dontkillmyapp.com?
 

Khaoz

New member
Yes I have done that but for some reason the Samsung Galaxy s22 is not working properly or something I'm not really sure. Cuz when I try to create a macro it creates it and it works the first time but after that it just stops working like my Samsung Galaxy s22 is preventing it from working or something and I'm not really sure what to do and on the site you told me to go to I went there but I'm a little confused on how to handle that situation on that site I got to know which one would really apply in my situation. Any help would be much appreciated even if you can direct me to exactly what I need to look up and fix and do what I need to do to get my phone working with this macrodroid because I just purchased it to support your team. But I can't even use it because of this situation and it's a bit frustrating cuz nobody wants to help me.
 

Endercraft

Moderator (& bug finder :D)
Yes I have done that but for some reason the Samsung Galaxy s22 is not working properly
From dontkillmyapp.com :
Even disabling the system battery restrictions does not save the app from being killed.

in Android 11 Samsung has introduced a new severe (default ON) restriction. Apps can no longer hold wake lock in foreground services.

After 3 days any unused app will not be able to start from background (e.g. alarms will not work anymore).

We strongly suggest to turn off Adaptive battery and Put apps to sleep options per instructions below.

Find the instructions by using this link : https://dontkillmyapp.com/samsung#android-11
 

dhj49er

Well-known member
Yes I have done that but for some reason the Samsung Galaxy s22 is not working properly or something I'm not really sure. Cuz when I try to create a macro it creates it and it works the first time but after that it just stops working like my Samsung Galaxy s22 is preventing it from working or something and I'm not really sure what to do and on the site you told me to go to I went there but I'm a little confused on how to handle that situation on that site I got to know which one would really apply in my situation. Any help would be much appreciated even if you can direct me to exactly what I need to look up and fix and do what I need to do to get my phone working with this macrodroid because I just purchased it to support your team. But I can't even use it because of this situation and it's a bit frustrating cuz nobody wants to help me.
I have a Samsung S22, the Plus version and Macrodroid is working fine.
Here are a few things to check/try
1. Select settings. Select Apps. Select Macrodroid. Select Battery. Select Unrestricted.
2. Select settings. Select Battery & Device care. Touch the 3 vertical dots (top right hand corner). Select Automation. Disable all 3 options.
3. Launch Macrodroid. Exit Macrodroid. Select recent. Find Macrodroid and touch the icon. Select Lock this app. S22 allows 1 app to be locked in memory for fast startup and importantly never being put to sleep.
Try the above and see if Macrodroid works - it should!
 

Khaoz

New member
Yes I have done that but for some reason the Samsung Galaxy s22 is not working properly or something I'm not really sure. Cuz when I try to create a macro it creates it and it works the first time but after that it just stops working like my Samsung Galaxy s22 is preventing it from working or something and I'm not really sure what to do and on the site you told me to go to I went there but I'm a little confused on how to handle that situation on that site I got to know which one would really apply in my situation. Any help would be much appreciated even if you can direct me to exactly what I need to look up and fix and do what I need to do to get my phone working with this macrodroid because I just purchased it to support your team. But I can't even use it because of this situation and it's a bit frustrating cuz nobody wants to help me.
I have a Samsung S22, the Plus version and Macrodroid is working fine.
Here are a few things to check/try
1. Select settings. Select Apps. Select Macrodroid. Select Battery. Select Unrestricted.
2. Select settings. Select Battery & Device care. Touch the 3 vertical dots (top right hand corner). Select Automation. Disable all 3 options.
3. Launch Macrodroid. Exit Macrodroid. Select recent. Find Macrodroid and touch the icon. Select Lock this app. S22 allows 1 app to be locked in memory for fast startup and importantly never being put to sleep.
Try the above and see if Macrodroid works - it should!
I will try all of this thank you very much hope it works fingers crossed. I will keep you up to date.
 

Khaoz

New member
I have a Samsung S22, the Plus version and Macrodroid is working fine.
Here are a few things to check/try
1. Select settings. Select Apps. Select Macrodroid. Select Battery. Select Unrestricted.
2. Select settings. Select Battery & Device care. Touch the 3 vertical dots (top right hand corner). Select Automation. Disable all 3 options.
3. Launch Macrodroid. Exit Macrodroid. Select recent. Find Macrodroid and touch the icon. Select Lock this app. S22 allows 1 app to be locked in memory for fast startup and importantly never being put to sleep.
Try the above and see if Macrodroid works - it should!
So every time I go to test the macro that I created it won't test right is that because I have it for geofence exit? For example I sent you a screenshot of how I created the macro and what I'm wanting it to do is when I leave my home it triggers with the UI interaction to arm my cameras in my home. Here is the screenshot
 

Attachments

  • Screenshot_20221025-081936_MacroDroid.jpg
    Screenshot_20221025-081936_MacroDroid.jpg
    408.7 KB · Views: 6

Endercraft

Moderator (& bug finder :D)
I am 99% sure it does not work because there is no wait action between the launch and the UI Interaction ! Meaning no time for the app to load.
 

Khaoz

New member
I am 99% sure it does not work because there is no wait action between the launch and the UI Interaction ! Meaning no time for the app to load.
So how do I fix it any ideas please you would be helping me out it's been driving me crazy lol
 

Endercraft

Moderator (& bug finder :D)
Add a wait before next action action (in MD specific) between your 2 actions and enter the time in seconds that your app generally takes to load (+3 to 5 seconds just to be safe).
(sorry for the wait)
 

dhj49er

Well-known member
So how do I fix it any ideas please you would be helping me out it's been driving me crazy lol
The macro as written will not work as you expect.
As Endercraft has suggested you need a Wait after the launch, to give time for the phone to load the app. I would try a 2 sec wait initially and see if it works. If you don't know the wait action use the search function.
Have you looked at the system log?
This contains a mine of useful information, not only to confirm a macro has run successfully, but also to show you why a macro hasn't worked.
The geofence trigger - is that in the system log?
Geofence triggers are polled every 3 minutes - this can be changed in MD settings, but making it significantly less is likely to increase battery consumption.
Bear in mind that when you leave home it could take up to 3 minutes before the exit home is triggered.
 

Khaoz

New member
Add a wait before next action action (in MD specific) between your 2 actions and enter the time in seconds that your app generally takes to load (+3 to 5 seconds just to be safe).
(sorry for the wait)
You're awesome it worked! I'm kind of new to all of this so thank you so much for your help I really appreciate it you have no idea how much I've been struggling trying to get this to work lol but now I'm testing it with the macro working perfect! Thank you again for your assistance.
 

Khaoz

New member
The macro as written will not work as you expect.
As Endercraft has suggested you need a Wait after the launch, to give time for the phone to load the app. I would try a 2 sec wait initially and see if it works. If you don't know the wait action use the search function.
Have you looked at the system log?
This contains a mine of useful information, not only to confirm a macro has run successfully, but also to show you why a macro hasn't worked.
The geofence trigger - is that in the system log?
Geofence triggers are polled every 3 minutes - this can be changed in MD settings, but making it significantly less is likely to increase battery consumption.
Bear in mind that when you leave home it could take up to 3 minutes before the exit home is triggered.
Yeah I'm fine with that and both of you help me out quite a bit so thank you so much for all of your guys' assistants once again I appreciate it you have no idea. One question I wanted to ask and I'm hoping somebody knows I don't know what all these components do and I'm trying to learn but I can't find any kind of like PDF file or template that explains each component and what it does does anybody know of one that I can use as reference possibly?
 

Endercraft

Moderator (& bug finder :D)
Yeah I'm fine with that and both of you help me out quite a bit so thank you so much for all of your guys' assistants once again I appreciate it you have no idea. One question I wanted to ask and I'm hoping somebody knows I don't know what all these components do and I'm trying to learn but I can't find any kind of like PDF file or template that explains each component and what it does does anybody know of one that I can use as reference possibly?
Go to the MacroDroid Wiki, you can access it in the home page of the app or the forum.
 
Top