Believe it or not i could not find an app which would reboot phone on certain number of failed unlock attempts. Why would anyone want this? To prevent unlocking encrypted devices of course!
- Phone: galaxy S5 stock rom, rooted and debloated.
- Encrypt device.
- Set pattern lock.
- Set cryptfs password using Cryptfs password manager
- Install and run UnlockWatch once, grant permanent root and add as device administrator.
This setup provides you with encrypted device which uses strong password on boot, and pattern (or pin if you choose so) lock to unlock device normally. Three failed pattern (or pin) entries will reboot device and you will have to enter your long and strong password. Application is using android device administrator API and does not need to run in the background. It is very light on resources and reliable. Also note that invalid attempt is counted only if invalid pattern or pin length is at least as long as minimal length enforced by OS.
While writing this post i discovered SnooperStopper app. It is supposed to do same thing as UnlockWatch + Cryptfs password manager, however setting password did not work on my android 6 and source code is nowhere to be seen.
The good stuff
Source code: https://github.com/rokups/UnlockWatch