Unlocking the bootloader and/or the recovery is very popular discussion across many devices. But doing so exposes a very obvious and inevitable issue with security!
An unlocked recovery means that no matter how secure you make your android lock screen, someone can easily reset phone to restore the phone to a fully functional (and lockless/insecure) state and the worst part, they don't have to erase your data(meaning they can access all your personal files and folders)!
It is almost hilarious! In fact if the phone supports insertion of external SD cards, you can even flash your own software into the phone and maybe bypass the lock screen without wiping any data.
For example: One possible loophole is using the 'Tasker' app which has a feature that can temporarily disable the keyguard. And the best part is that Tasker can be flashed using the recovery!
So is there any method by which I could add a security measure that prevents complete access to my recovery and/or boot loader that will make my phone less insecure?!
Expected answer: Method by which a custom pin/password must be entered before entering the bootloader/recovery. So that my bootloader/recovery is still technically unlocked but simply requires authentication to use (this also ensures that conventional unlocking methods won't work as the phone is not really locked!). This also means that one does not have to lose root access to ensure security!