dhj49er
Well-known member
If you are using Android 10 or 11 (quite possibly 12 as well but I'm on 11, so I can't check) and use face and or fingerprint to unlock the phone, then you will have come across a Google security feature that prompts for the PIN to unlock the phone every 72 hours. I think it's unnecessary.
Consequently, I developed the attached macro to automate inputting the PIN once in each 72 hour period. The macro runs 3 times a week in the early hours of the morning and executes in around 3 seconds. It does unlock the phone but only for a fraction of a second before the screen off action locks the phone again.
DO NOT USE THIS MACRO FOR UNLOCKING YOUR PHONE FOR REGULAR USE - as it would allow anybody to unlock the phone, defeating all the inbuilt security.
When the screen is turned on, the up gesture (on my phone) brings up the screen with the numeric keypad.
On my phone UI click on text (the numbers) do not work, but UI click on x,y position does.
So some preparation is required.
On the numeric keypad screen find the x and y values of each row and column, to derive the x & y values for each digit in your PIN.
I have a 6 digit PIN. In the attached macro I have replaced the correct X,y values with 1,1....6,6 with 1,1 the x,y values for the first digit in my PIN and 6,6 the last. Replace these with the values you derived above.
The wait for screen off is there in case the phone is in use (unlikely).
The LockScreenStatusBar variable acts as a flag. I use this variable to prevent the regular unlock and screen off macros from running - add the variable LockscreenStatusBar set to 0 as a constraint to these macros.
The next part is VERY IMPORTANT.
I password protect seeing and accessing the macro by storing it in the security category. I also disable logging for this macro. These measure make it virtually impossible for another person to know about the macro or access it.
I have been using the macro for about a month and haven't seen the 72 hours prompt once!
Consequently, I developed the attached macro to automate inputting the PIN once in each 72 hour period. The macro runs 3 times a week in the early hours of the morning and executes in around 3 seconds. It does unlock the phone but only for a fraction of a second before the screen off action locks the phone again.
DO NOT USE THIS MACRO FOR UNLOCKING YOUR PHONE FOR REGULAR USE - as it would allow anybody to unlock the phone, defeating all the inbuilt security.
When the screen is turned on, the up gesture (on my phone) brings up the screen with the numeric keypad.
On my phone UI click on text (the numbers) do not work, but UI click on x,y position does.
So some preparation is required.
On the numeric keypad screen find the x and y values of each row and column, to derive the x & y values for each digit in your PIN.
I have a 6 digit PIN. In the attached macro I have replaced the correct X,y values with 1,1....6,6 with 1,1 the x,y values for the first digit in my PIN and 6,6 the last. Replace these with the values you derived above.
The wait for screen off is there in case the phone is in use (unlikely).
The LockScreenStatusBar variable acts as a flag. I use this variable to prevent the regular unlock and screen off macros from running - add the variable LockscreenStatusBar set to 0 as a constraint to these macros.
The next part is VERY IMPORTANT.
I password protect seeing and accessing the macro by storing it in the security category. I also disable logging for this macro. These measure make it virtually impossible for another person to know about the macro or access it.
I have been using the macro for about a month and haven't seen the 72 hours prompt once!
Attachments
Last edited: