How to unlock screen?

chaoscreater

Active member
I'm using an Oppo R17 Pro running Android 10, unrooted.

ADB hacks applied for Macrodroid. Macrodroid has device admin enabled.

I can't seem to get the "Screen lock off" setting to do anything. It doesn't unlock my screen at all.

I've looked for macros in the community marketplace (or whatever it's called) and none of them helped.

I'm using a swipe pattern for my lockscreen.

The closest solution I got to is using UI interaction to swipe the screen, but it still doesn't work because pattern unlock requires continous motion of the gesture. Let's say the screen unlock pattern is like an L shape. I can make the UI interaction to do exactly that. The first UI interaction moves from top to bottom and the 2nd UI interaction moves from left to right. However, it is not a continous gesture motion. There is no sleep in between the UI interactions and the whole animation looks smooth, but the problem is that the UI interactions will only move from X to Y and then stops. The first UI interaction stops at the bottom of where the 2nd UI interaction starts. It essentially releases the tap at that point. No matter how quickly you connect the 2 UI interactions together, they are not continous.

If you enable the pointer location setting in Developer Options, you can see where your cursor/taps are moving. When the UI interaction runs, it looks continous and that is because of how fast it runs, but it's actually not a continuous motion. I've tried adjusting the duration of the UI interaction, but it doesn't help.

The ONLY other workaround I have is to set the unlock to use pin code. Doing this will only require individual taps/clicks and using UI interaction to achieve this worked. However, this also means when I'm unlocking the phone regularly, I would have to use pin code and I don't like that.

Is there any other way to unlock the screen using perhaps some sort of ADB command or some other feature in MacroDroid?
 
Last edited:

dhj49er

Well-known member
Are you trying to automate the screen unlocking after you turn on the screen, so you don't have to manually unlock the phone?
Google have made this almost impossible to do, due to the lack of security resulting from automatically unlocking the phone.
However, there are ways around this!
The oppo R17 pro has both face unlock and fingerprint unlock, but you don't appear to be using either.
I had an oppo find X2 Neo and enabled both methods. The fingerprint unlock was fast but the face unlock was even faster, even in dim lighting. I also enabled lift to wake. Picking up the phone and raising it to use it and the phone was already unlocked. In order to dismiss the unlocked screen I preferred a third party solution, Autotools (paid with free trial), which has a feature called dismiss keyguard. Enabling this dismisses the unlocked screen. An alternative method is to use Macrodroid to perform a swipe up gesture when the phone is unlocked.
I also use Android secure unlock feature. I have a trusted place and I wear a Bluetooth enabled smart watch. This with keyguard dismiss fully automates the phone unlocking - no manual intervention required - yet provides a good level of security. Once the watch drops out of Bluetooth range, Android automatically locks the phone, as would be the case if I lost my phone.
I realise that you may not want to use face or fingerprint unlock and don't have a smart watch, but I believe using one or more of these may provide the solution you are looking for.
 

FrameXX

Well-known member
I'm using an Oppo R17 Pro running Android 10, unrooted.

ADB hacks applied for Macrodroid. Macrodroid has device admin enabled.

I can't seem to get the "Screen lock off" setting to do anything. It doesn't unlock my screen at all.

I've looked for macros in the community marketplace (or whatever it's called) and none of them helped.

I'm using a swipe pattern for my lockscreen.

The closest solution I got to is using UI interaction to swipe the screen, but it still doesn't work because pattern unlock requires continous motion of the gesture. Let's say the screen unlock pattern is like an L shape. I can make the UI interaction to do exactly that. The first UI interaction moves from top to bottom and the 2nd UI interaction moves from left to right. However, it is not a continous gesture motion. There is no sleep in between the UI interactions and the whole animation looks smooth, but the problem is that the UI interactions will only move from X to Y and then stops. The first UI interaction stops at the bottom of where the 2nd UI interaction starts. It essentially releases the tap at that point. No matter how quickly you connect the 2 UI interactions together, they are not continous.

If you enable the pointer location setting in Developer Options, you can see where your cursor/taps are moving. When the UI interaction runs, it looks continous and that is because of how fast it runs, but it's actually not a continuous motion. I've tried adjusting the duration of the UI interaction, but it doesn't help.

The ONLY other workaround I have is to set the unlock to use pin code. Doing this will only require individual taps/clicks and using UI interaction to achieve this worked. However, this also means when I'm unlocking the phone regularly, I would have to use pin code and I don't like that.

Is there any other way to unlock the screen using perhaps some sort of ADB command or some other feature in MacroDroid?

Unfortunately on some devices action to unlock screen doesn't work at all. I am rooted and it still doesn't work for me. Few days ago I tryed Automagic (another app) to unlock my screen when I launch it as shortcut from MacroDroid and it worked, BUT it wasn't able to set lock again. It did not worked even manually and nothing helped so I needed to factory reset my device :LOL:.
 

chaoscreater

Active member
Thanks for the replies.

Just to clarify, I'm trying to make Macrodroid unlock my phone automatically, without any input from me at all.

For example, if I create a simple time-based trigger, then when it triggers, Macrodroid will turn on the screen and unlock the phone.

I can get this working using UI interaction. It would swipe up my screen and click the pin numbers to unlock. However, if my lock password is set to lock pattern instead, then UI interaction will not work, as a lock pattern requires continous non-stop swiping motion from start to end. Hope this makes sense.
 

FrameXX

Well-known member
UN
Thanks for the replies.

Just to clarify, I'm trying to make Macrodroid unlock my phone automatically, without any input from me at all.

For example, if I create a simple time-based trigger, then when it triggers, Macrodroid will turn on the screen and unlock the phone.

I can get this working using UI interaction. It would swipe up my screen and click the pin numbers to unlock. However, if my lock password is set to lock pattern instead, then UI interaction will not work, as a lock pattern requires continous non-stop swiping motion from start to end. Hope this makes sense.

Understand. I changed from pattern to pin because of this. Just use pin and smart lock for your home (or elsewhere you can) so writing pin would not bother you too much. This is the way.
 

dhj49er

Well-known member
Thanks for the replies.

Just to clarify, I'm trying to make Macrodroid unlock my phone automatically, without any input from me at all.

For example, if I create a simple time-based trigger, then when it triggers, Macrodroid will turn on the screen and unlock the phone.

I can get this working using UI interaction. It would swipe up my screen and click the pin numbers to unlock. However, if my lock password is set to lock pattern instead, then UI interaction will not work, as a lock pattern requires continous non-stop swiping motion from start to end. Hope this makes sense.
I had the same need a while back. I had a macro to enable airplane mode that could only be done with UI integration actions which required the screen to be on.
I achieved this by using the screen on action and letting secure lock unlock the phone and autoinput dismiss keyguard to clear the unlocked screen. The macro would run with no manual input needed from me. This worked fine until Google modified the way secure lock works - depending on Android version it required occasional manual unlocking, which it it occurred when the macro turned on the screen, stopped further processing of the macro.
Now, I don't need to unlock the phone for any of my macros to run. I still have the macro that enables airplane mode, but does it with the screen off. The Macrodroid developer worked out how to do this by setting up Macrodroid as the Assistant App. A really useful feature.
Screen on with secure lock still works but not necessarily everytime due to the need to occasional unlock manually.
Storing the pin in a macro is a security risk, as the pin is stored unencrypted.
I much prefer to use fingerprint unlock and secure lock. Whenever the secure lock trusted conditions are met, the phone unlocks automatically and when the trusted conditions are lost, the phone automatically reverts to fingerprint unlocking.
I stopped using pattern unlock when fingerprint unlocking was introduced, as I preferred the simpler, faster and more secure fingerprint unlocking. Consequently I don't have any experience of automatically unlocking a pattern.
 

chaoscreater

Active member
I had the same need a while back. I had a macro to enable airplane mode that could only be done with UI integration actions which required the screen to be on.
I achieved this by using the screen on action and letting secure lock unlock the phone and autoinput dismiss keyguard to clear the unlocked screen. The macro would run with no manual input needed from me. This worked fine until Google modified the way secure lock works - depending on Android version it required occasional manual unlocking, which it it occurred when the macro turned on the screen, stopped further processing of the macro.
Now, I don't need to unlock the phone for any of my macros to run. I still have the macro that enables airplane mode, but does it with the screen off. The Macrodroid developer worked out how to do this by setting up Macrodroid as the Assistant App. A really useful feature.
Screen on with secure lock still works but not necessarily everytime due to the need to occasional unlock manually.
Storing the pin in a macro is a security risk, as the pin is stored unencrypted.
I much prefer to use fingerprint unlock and secure lock. Whenever the secure lock trusted conditions are met, the phone unlocks automatically and when the trusted conditions are lost, the phone automatically reverts to fingerprint unlocking.
I stopped using pattern unlock when fingerprint unlocking was introduced, as I preferred the simpler, faster and more secure fingerprint unlocking. Consequently I don't have any experience of automatically unlocking a pattern.

How are you using MacroDroid to do fingerprint unlock? I already have fingerprint and face unlock configured, but this is only for manually unlocking my phone. I need Macrodroid to do this automatically for me, without user interaction.
 

dhj49er

Well-known member
I don't use Macrodroid for unlocking my phone.
I don't have any macros that require the phone to be unlocked.
I use fingerprint unlock and like the phone to resume from a power on (button or double tap) without having to touch the fingerprint scanner everytime.
I achieve this by using Android secure lock and setup 1 Bluetooth device (my smart watch) as a trusted device. This will automatically unlock the phone from a power on. The next step is to clear the unlock screen. For this I use dismiss keyguard feature in Autoinput - paid app with free trial. I could use a macro to swipe the screen up instead. However, secure lock only unlocks if the trust has not been broken. For example if I put my phone down and move out of Bluetooth range, my smart watch drops it's connection and secure lock trust is broken. The next time I use my phone I have to use fingerprint. Now I don't want a swipe & is the reason I don't use a macro. Dismiss keyguard only works when the unlock screen is displayed.
The smartwatch sutomatically reconnects and secure lock trust is re-established. All seamlessly and without any user interaction.
I find this arrangement to be very convenient, especially when I'm at home and keep the phone with me, has as been the case during the lockdowns.
Also I know that if I loose my phone, secure lock trust will be broken and the phone automatically reverts to fingerprint.
So it's not only convenient, but it provides a high level of security.
Be aware that how secure lock works has been changed by Google in Android 9, 10 and 11. Unfortunately, it's functionality is slowly being crippled. Also the phone manufacture may have also modified the way it works.
My S20 FE is on Android 11...so secure lock is still very useful.
 

dhj49er

Well-known member
What I forgot to say.
If I have a screen on action in a macro that runs when the screen is off, the following will happen.
The screen will come on and if the secure lock trust is present, the phone will unlock and show the unlock screen. Now dismiss keyguard will clear that screen.
From here futher macro actions including UI integration will work.
Is that what you are trying to achieve?
 

dhj49er

Well-known member
Finally, if you haven't got a smart watch or other Bluetooth device to use as a trusted device, secure lock has the option to use trusted location(s).
You could setup home as a trusted location.
Not as convenient as a smartwatch, but useful if the macros you want to run are when you are at home.
 

chaoscreater

Active member
I don't like to keep my bluetooth connected 24/7 just to use smart lock. It drains the battery of my devices.

It's OK, I'll stick to the solution that I mentioned in a previous post already.
 

dhj49er

Well-known member
That's fine.
I don't keep Bluetooth on 24/7, only during the daytime, not when I'm asleep.
Bluetooth doesn't drain the phone battery, especially if it's a BLE device.
I get over 11 hours SOT and that's with Bluetooth on 16 hours a day.
 

pr3jker

Member
I use my home Wi-Fi to unlock my screen as soon as I'm Home.
And I use home Wi-Fi disconnect to lock the screen.
Each case with a different macro, triggers being the Wi-Fi connection
 

dhj49er

Well-known member
I use my home Wi-Fi to unlock my screen as soon as I'm Home.
And I use home Wi-Fi disconnect to lock the screen.
Each case with a different macro, triggers being the Wi-Fi connection
Thats interesting.
Which locking method do you use?
 

pr3jker

Member
Thats interesting.
Which locking method do you use?
I use PIN lock.
When I leave home, MD sets my lock to on (I use Autotools)
Then, at home, my MD macro just types the pin once Wi-Fi home is on, and Autotools just sets the lock to off
 

dhj49er

Well-known member
I don't used PIN lock, as I prefer fingerprint, as it is easier, faster & more secure. Also I have many apps that support opening using fingerprint, which I find very convenient, especially for banking apps.
 
Top