Android OS Forum banner
1 - 5 of 5 Posts

·
Android Beginner
Joined
·
19 Posts
This guide is not meant to help you break into someone else's phone. This is intended as instructional for anyone who gets locked out of their phone because either they forgot the combination or got locked out as a mean prank.

**THIS IS FOR CM7 ONLY!*** If you're not on cm7, you can try this. It might work on ROMS based on it. See the bottom for one other potential method.

Requirements:
-adb

Step 1:
If debugging is enabled already on the device, just skip to step 2. If not, reboot the phone into recovery. Usually it's VolDown+Power or x+Power or Menu+Power when turning on the phone. If you are unsure of how to do that, just google it.

Step 2:
In a terminal type the following, one line at a time:

>adb shell
>su

You should now have a '#' sign at the beginning of the line

# sqlite3 /data/data/com.android.providers.settings/databases/settings.db

This opens up the database in a native program

Step 3:
Edit the database so you clear the lockscreen data. Your command line should start with "sqlite >"

NOTE- Different commands are required for different lockscreen types and vary depending on how often you change the lockscreen type.

Start by typing:

select * from secure;

This will print out a long list of settings. At the bottom (in the 100s) there should be lockscreen settings.

substitute **id # here** in the following command and replace it with the number on the left for the following commands. **NOTE** They might not all be listed depending on the the lockscreen type.

lockscreen.password_salt
lockscreen.patterneverchosen
lockscreen.password_type

update secure set value=0 where _id=**id # here**;

For instance, yours might say something like:

...
...
...
150|lockscreen.password_salt|-58532586903847692873
153|lockscreen.patterneverchosen|1
...

so type:

update secure set value=0 where _id=150;
update secure set value=0 where _id=153;

Final note: If you type in a command and hit enter and it just takes you to a new line with " ...>", you probably forgot to include a semicolon. it's fine, just type ';' and hit enter and it will complete the command

Step 4:
Reboot the phone and the lockscreen is gone

One other potential method:
If this database doesn't exist, try deleting "password.key" from "/data/system/" with the following command in adb shell or a terminal

"mv /data/system/password.key /data/system/password.bak"

This method may even work for non-rooted android phones that use this protection type. because you are editing the /data partition I'm fairly certain it works on CM6... Let me know how it works out.
 

·
Registered
Joined
·
5 Posts
So I enabled the minimal lockscreen and now everytime I try to unlock it hot reboots. I'm trying to change the lockscreen via ADB..because I stupidly haven't yet done a backup. Any thoughts?
 

·
Registered
Joined
·
1 Posts
ABSOLUTE LIFE SAVER!

Worked on CM9 as well.

lockscreen.password_salt and lockscreen.password_type

exist.

lockscreen.patterneverchosen is missing, but so what. After following the instructions and a reboot, the face recog and pin were disabled.

A word to the wise, when installing a new ROM like CM9, beware of what you restore with Titanium Backup, because after I probably restored some "key" files that may have worked on the previous ROM, but not on the CM9.

Thanks.
 
1 - 5 of 5 Posts
Top