Device Unlock Once Every 72 Hours

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!
 

Attachments

  • Device_Unlock.macro
    8.6 KB · Views: 59
Last edited:

Snurre

Well-known member
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.
Looks great
I didn't try Autoinput so I don't know if this works instead of x, y when clicking the numbers
It would be a lot easyer if it did

com.android.keyguard:id/key0
com.android.keyguard:id/key1
com.android.keyguard:id/key2
com.android.keyguard:id/key3
com.android.keyguard:id/key4
com.android.keyguard:id/key5
com.android.keyguard:id/key6
com.android.keyguard:id/key7
com.android.keyguard:id/key8
com.android.keyguard:id/key9
com.android.keyguard:id/delete_button
com.android.keyguard:id/key_enter
 

dhj49er

Well-known member
I'm not familiar with autoinput.
However, if the PIN input screen limitation is Google or the phone OS, rather than Macrodroid, I suspect autoinput keyguard wouldn't work either.
It's not difficult to work out the x,y values for each number on the PIN input screen, especially when show pointer location setting is enabled.
Also I would be wary using a plugin for storing the individual numbers of the PIN,
 

Mcrazy

Member
I'm not familiar with autoinput.
However, if the PIN input screen limitation is Google or the phone OS, rather than Macrodroid, I suspect autoinput keyguard wouldn't work either.
It's not difficult to work out the x,y values for each number on the PIN input screen, especially when show pointer location setting is enabled.
Also I would be wary using a plugin for storing the individual numbers of the PIN
Hi!
I made a macro, try it, you don't need a third party app.
You can find it here: Auto Screen Unlock
 

dhj49er

Well-known member
Hi!
I made a macro, try it, you don't need a third party app.
You can find it here: Auto Screen Unlock
I don't use a third party app.
Your macro is for a different use case. Also I stopped using secure lock when Google restricted it's usefulness - I used to use my smartwatch as a trusted device, but Google from Android 10, disable smart lock when the BT connection is lost, which happens frequently when I'm at home. The other reason I stopped using it is face unlock on my Oppo is more convenient to use and a lot faster.
As for your macroI I would prefer not storing the actual PIN in a variable...it's a security risk. Automatically unlocking the phone poses a security risk, that's why my macro only unlocks the phone for ~200ms, before turning the screen off and relocking the phone.
 

Mcrazy

Member
I don't use a third party app.
Your macro is for a different use case. Also I stopped using secure lock when Google restricted it's usefulness - I used to use my smartwatch as a trusted device, but Google from Android 10, disable smart lock when the BT connection is lost, which happens frequently when I'm at home. The other reason I stopped using it is face unlock on my Oppo is more convenient to use and a lot faster.
As for your macroI I would prefer not storing the actual PIN in a variable...it's a security risk. Automatically unlocking the phone poses a security risk, that's why my macro only unlocks the phone for ~200ms, before turning the screen off and relocking the phone.
Okay, I understand, but you should know that any app that you don't make is a security risk.
 

dhj49er

Well-known member
Okay, I understand, but you should know that any app that you don't make is a security risk.
Yes I do know....and that's why Google has Play protect, to minimise that risk.
A phone that automatically unlocks via a macro poses a security risk in the event the phone is lost or stolen, as it enables a third person or a thief full access to the phone.
 
I developed the attached macro to automate inputting the PIN once in each 72 hour period.

Hiya, I came across this from Google. Does this still work? I'm on Android 14 on an Oneplus Pro 10 and I'm very, very upset by the fact that Android forces this nonsensical 'feature' on me every 3 days. If your macro works I'll happily pay for the Macrodroid app to run it.

edit: I just ran a test and it seemed to work. Will have to wait if it does indeed get rid of the 72-hour annoyance. If so: you are a god, sir. I thank you for relieving me of my frustration.
 
Last edited:
Top