For security reasons, I want to be able to specify two lock passwords (or patterns) as follows :

One for normal unlocking the device.

Another one if entered, the device will factory reset itself (and maybe format the SD)

I want this to happen from the main Android lock screen, but with two passwords.

  • Interesting request. This would require a device administrator, as normal applications do not have this access. Personally, I don't know of any apps that have this support... Aug 7 '14 at 17:07

I do not know of any application that does what you request. Maybe "After Unlock" has a feature like that.

What I would do is make an Android application that is fired after unlocking the phone. The application would request a new password and if it is entered correctly do the factory reset and format the SD if needed.

Check this project for an example of how this could be done: myLock


Its possible with device admin & setting password policy. Im not sure I can post some sample code here or not as this site not for codes , for ex

mDevicePolicyManager.setMaximumFailedPasswordsForWipe(mCameraAdminReceiver, 2);
  • @MIH1406 If you want more help regarding code I can help you out.
    – mvnpavan
    Aug 11 '14 at 11:34
  • This site is intended for end-user questions, so I would guess that the OP was not looking for code. Aug 18 '14 at 19:18

Well, personally I don't think that there is any application that can help you in putting the lock over your device when wrong password is entered your device gets factory reset. But yes I have seen that function available over the HTC one M8, if you put the password over the HTC M8 wrong for 5 times it gives you the warning and if you put the password wrong for 10 times then the device automatically factory reset your device. I would say it's not possible to till data but I think if you are hungry for the function like, you can either try creating and application which can do so (but I think that would be whole tough mess) or try getting an HTC one M8.


You might need to root your phone and find a way to add another password. You might need programming knowledge for this.

  • Down voted simply because it is entirely obvious. If you gave sample code or linked to a successful example, the answer would be have been up voted instead.
    – pheidlauf
    Aug 13 '14 at 13:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.