Automating PIN unlock or Password unlock?

HippoMan

New member
I always prefer to use Swipe-Lock. However, in order to prevent Google from automatically deleting payment methods from my Android-11 device, Swipe-Lock cannot be enabled. I have to keep PIN-Lock, Password-Lock, or some other locking method active at all times on my device.

I'm wondering: is there some way in Macrodroid to detect when the PIN-Unlock dialog or Password-Unlock dialog pops up and then to automatically feed the PIN or Password to it?

Or alternatively, is there a way for Macrodroid to detect an attempted swipe, so that when the PIN-Unlock dialog or Password-Unlock is active, I can then swipe, Macrodroid could then detect the swipe, and then Macrodroid could feed the PIN or Password to the unlock dialog? This would give me the ability to unlock via swipe, even if PIN locking or Password locking is enabled.

If either of these options (or something similar) are available, I could then keep device locking enabled in order to preserve my payment methods, but not have to manually enter a PIN or Password in order to unlock the device.

Thanks in advance for any thoughts and suggestions.
 

Endercraft

Moderator (& bug finder :D)
I always prefer to use Swipe-Lock. However, in order to prevent Google from automatically deleting payment methods from my Android-11 device, Swipe-Lock cannot be enabled. I have to keep PIN-Lock, Password-Lock, or some other locking method active at all times on my device.

I'm wondering: is there some way in Macrodroid to detect when the PIN-Unlock dialog or Password-Unlock dialog pops up and then to automatically feed the PIN or Password to it?

Or alternatively, is there a way for Macrodroid to detect an attempted swipe, so that when the PIN-Unlock dialog or Password-Unlock is active, I can then swipe, Macrodroid could then detect the swipe, and then Macrodroid could feed the PIN or Password to the unlock dialog? This would give me the ability to unlock via swipe, even if PIN locking or Password locking is enabled.

If either of these options (or something similar) are available, I could then keep device locking enabled in order to preserve my payment methods, but not have to manually enter a PIN or Password in order to unlock the device.

Thanks in advance for any thoughts and suggestions.
You could use login attempt failed as a trigger. Then UI Interaction to swipe or click the buttons for the PIN.
 

HippoMan

New member
You could use login attempt failed as a trigger. Then UI Interaction to swipe or click the buttons for the PIN.
Thank you. However, this doesn't work for me.

I set all the possible requested permissions for Macrodroid on my rooted Android-11 device, including setting Macrodroid up as an admin app.

I set up a "UI interaction" macro to enter the Password, and I set it up to be triggered by "login attempt failed".

I then set up a Password lock, and I locked the screen and attempted to open the screen. The password dialog came up, and so I entered a bad Password. The macro didn't get triggered.

I then did the same thing with macro set to enter a PIN, and to be triggered by "login attempt failed".

I then set up a PIN lock, and I locked the screen and attempted to open the screen. the PIN dialog came up, so I entered a bad PIN. The macro didn't get triggered.

I'm guessing that when a screen lock is in effect, these macros are somehow blocked from being triggered. Could that be the case?
 

HippoMan

New member
Ah ... I figured it out. In order for something to look like a "failed" login attempt, I have to try to unlock once by entering at least 4 characters of an incorrect password or PIN. Then, the macro will indeed be triggered.

So, no matter what I do, it appears that I will always have to enter multiple characters in order to unlock my device.

I am trying to avoid entering characters like that, but maybe I have no alternative.

Can anyone think of a way around this limitation?
 
Last edited:

Endercraft

Moderator (& bug finder :D)
In order for something to look like a "failed" login attempt, I have to try to unlock once by entering at least 4 characters of an incorrect password or PIN.
That is correct. If the PIN or password is less than 4 it is counted as invalid and not failed. You can also see that if you unlock a SIM : it tells you that the PIN must be at least 4 numbers.
I am trying to avoid entering characters like that, but maybe I have no alternative.

Can anyone think of a way around this limitation?
Can you use the floating button trigger (with show on lock screen) ?
 

HippoMan

New member
Can you use the floating button trigger (with show on lock screen) ?
Thank you again.

But sadly, that doesn't work, either. The floating button is not visible when the PIN-entry or Password-entry screen comes up to unlock the device.

I think I'm just out of luck with this. The purpose of locking a device is to prevent things like this from working, and apparently, Google did a good job with their device-locking implementation.
 

dhj49er

Well-known member
I have used Macrodroid to input a y digit pin on the lockdcreen.

The macro uses UI actions to input the pin.


I expect this is what you have tried.

what I did find is that not all phones accept click on the numbers and require click on the x,y coordinates for each digit.

If you are using click on digit have you verified the correct digit is briefly shown?
 

HippoMan

New member
Thank you. My issue is not with entering the text or the digits or the button clicks on the unlock screen. I can do all of that with MacroDroid.

My issue is with triggering MacroDroid to begin to enter the text or digits or button clicks in the first place. Most MacroDroid triggers are not active on the unlock screen. The only exception I know of is the "failed login attempt" trigger, and that only gets invoked if I enter at least 4 characters, 4 digits, or 4 button clicks.

My goal here is to not have to enter four of anything in order to trigger this, but rather, to enter at most only one single item (character, digit, button click, or gesture) when the unlock screen is showing in order to trigger the automated entry of my unlock sequence.

And actually, ideally, I would prefer to enter NOTHING at that point, and for the mere fact that the unlock screen appears to trigger the entry of my unlock sequence (characters, digits, or button clicks).

But unfortunately, that seems to be impossible in Android.

I would prefer to simply use Swipe Lock, but if I do so, Google remotely detects that my device is no longer screen-locked, and Google then tries to "help" me (ha ha!) by deleting all my previously saved payment methods from Google Pay and Google Wallet.

So ... I'm looking for a way to permanently maintain a screen lock on my device, and to somehow set up an automated unlocking mechanism to make my device *behave* as if I have Swipe Lock enabled.

And again, I think I'm totally out of luck regarding this wish of mine.
 

dhj49er

Well-known member
Do you want a macro to unlock the phone AFTER you have pressed power on?

I suggest you try the following.

Change the pin unlock to fingerprint unlock

Then when the phone is switched on, it will be on the lock screen with fingerprint scanner shown (assuming it's under the display).
At this point most phones allow a swipe up (or down) gesture to show the password/pin input screen with keypad. Use MD to input the password/pin

The macro to unlock would be something like the following

T Screen on
A wait 100ms - will depend on phone
A UI action swipe up - specify x,y values to start near the centre bottom third, up 500 for duration of 250ms
A run unlock macro - the macro that enters the pin. I always password protect this macro and disable logging, to provide some security.
C device locked

On some phones the fp scanner is enabled before the power switch is pressed. Unlocking this way and the macro doesn't run due to the constraint.
 
Last edited:

HippoMan

New member
This looks like a good idea!

And I'm looking for a macro to unlock the screen *any* time I want to unlock it, both right after power-on, and also any time later that the screen becomes locked.

Unfortunately, I'm busy and can't test your suggestion for several days, but I just want to let you know that I very much appreciate your suggestion, which indeed looks promising, and I'll definitely try it when I have time ... and I'll then report my results here.
 

HippoMan

New member
Do you want a macro to unlock the phone AFTER you have pressed power on?

I suggest you try the following.

Change the pin unlock to fingerprint unlock

Then when the phone is switched on, it will be on the lock screen with fingerprint scanner shown (assuming it's under the display).
At this point most phones allow a swipe up (or down) gesture to show the password/pin input screen with keypad. Use MD to input the password/pin

The macro to unlock would be something like the following

T Screen on
A wait 100ms - will depend on phone
A UI action swipe up - specify x,y values to start near the centre bottom third, up 500 for duration of 250ms
A run unlock macro - the macro that enters the pin. I always password protect this macro and disable logging, to provide some security.
C device locked

On some phones the fp scanner is enabled before the power switch is pressed. Unlocking this way and the macro doesn't run due to the constraint.
I was traveling, and I finally have time to test this.

This works!

I previously tried this with simple password unlock, but it didn't work, because the unlock macro wouldn't send the pin on a locked screen. However, fingerprint lock is what's needed, because the device will indeed accept the output of the unlock macro when the screen is locked in fingerprint mode and the password screen is showing.

Thank you very much!
 
Top