Tell me more ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

I flashed the latest Cyanogenmod ROM for my device (Samsung Captivate) last night and after doing so I set a numeric lock screen password. I then customized my phone and spent a goodly amount of time working on it and locked and unlocked it successfully multiple times. This morning when I woke up and went to unlock it, my password did not work. I have tried the password (and combinations thereof) over 100 times and it never unlocks. I also never get the "Lost Password" button on the lock screen to use my Gmail account to unlock the device. Does anyone know if there is a way to connect to the device using an ADB shell and reset the password? I am able to get to a shell and can run commands. Any help is appreciated.

share|improve this question

1 Answer

Yes, you can delete the PIN data from the settings database. In the below instructions, anything that follows a # or sqlite> is a command you should enter (from an adb shell):

# cd /data/data/com.android.providers.settings/databases
# sqlite3 settings.db
sqlite> delete from secure where name='lockscreen.password_type';
sqlite> delete from secure where name='lockscreen.password_salt';
sqlite> .exit
# reboot

When the phone reboots the PIN lock should be disabled. If this doesn't work then try executing the following from within sqlite (second might not be needed):

sqlite> select * from secure;
sqlite> select * from system;

These two commands will simply list all entries in the secure and system tables, respectively. That will help you find the proper rows that need to be deleted in the case that they are named differently (though I don't think they will be as I just tested this on my own CyanogenMod 7 install).

share|improve this answer
I ended up re-flashing and restoring from a Titanium backup I had. However, out of sheer curiosity, I am testing what you have posted and even after deleting the two entries from the database file and rebooting the lock is still on the screen and I can find no way around it. I did confirm that both lockscree.password_type and _salt are no longer in the database file. Any other suggestions? Like I said this is not critical at this point, it is now an experiment in Android security. – t11m Jun 30 '11 at 3:45
@t11m: Hm, I'm not aware of any other relevant entries offhand, but maybe I'll mess around with it a little bit. Just deleting those two definitely works for me if I set up a PIN lock... – eldarerathis Jun 30 '11 at 13:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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