Google Android Lockout By-Pass
I recently had someone ask me how to get past the Android’s Pattern Pin. The problem is that there are random times when your phone could just “Poof!” in-validate the pattern pin sequence and lock you out of the phone. If this happens, you immediately lose access to your phone. Sure, you can enter the @google username and password, but most of the time it doesn’t accept; even if you try it on gmail.com and you know for sure you have the correct info.
If this ever happens to you, here’s three ways to go about bypassing that problem. The first solution is a simple user/pass bypass to fake your way through it. The second is a more drastic way of factory-reset and you do lose everything on your phone. The third is a debug way IF you had USB Debugging turned on.
See how after the jump.
Method 1 – Fake Password Hack
This will NOT wipe your phone, but no guarantee if it will work.
Keep messing with your phone and try to force it to go from the Pattern Pin entry screen to where it is asking you for your Google Username and Password. When it asks you for this information, enter your Google Account’s Username (email@example.com) and in the password field enter “null” (but without the quotes).
Assuming your phone / Android OS allows it, you will be asked to input a new pattern pin.
Method 2 – Force Reset
THIS WILL WIPE YOUR PHONE
Note: Your contacts ‘should’ be fine as long as they are from external sources (Google Contacts, Exchange Mail Contacts, etc.) If, however, your contacts are marked as ‘phone’ contacts, almost 100% sure they’ll be gone…kaput…vanished…you get the point.
- remove the battery from your phone and wait about 5 minutes to make sure all of the power in it flushes out.
- put your phone back together
- with the power off, hold the HOME button and the BACK button
- while holding those two buttons, press the END/DISCONNECT button
This will reset the phone to ‘factory’ settings and you will probably have to reset everything again.Once you have your phone back to working condition, go to the market. It will ask you if you accept the terms and conditions; select I DO NOT AGREE to the market. You will not be able to download any new items, but if you click ‘menu’ and then select ‘my downloads’ you will be able to re-download all of your apps that you previously had. However, if you are in the market and you select I DO AGREE, then it will wipe your market history and you will lose any kind of apps in your downloads area.
Method 3 – Root it!
This is a more advanced method.
Thanks to James Williams for specifics on this.
This assumes that you have USB Debugging enabled
It is highly recommend that you download the android development kit and turn USB debugging on before breaking your phone: http://developer.android.com/sdk/. If you have the android SDK and you change your phone settings to: Settings -> Applications -> Development -> USB Debugging = enabled, then you can hack at your phone from your computer.
- Plug phone into computer via USB
- Download http://zenthought.org/tmp/asroot2
- adb push asroot2 /data/local/ && ./adb shell chmod 0755 /data/local/asroot2
- adb shell
- /data/local/asroot2 /system/bin/sh
- chmod 777 /data/data/com.android.providers.settings/databases/settings.db
Now, you have root access to your android phone and you have changed the permissions to the “settings.db” so that you can pull/push it from your computer back to the phone. Many thanks to “briankwest” and this post for that valuable tidbit. Next, comes the hard part that I had to figure out on my own:
- Pull the sqlite database file from your phone settings using this command: adb pull /data/data/com.android.providers.settings/databases/settings.db ./settings.db
- Make a copy of this file to make sure you can push the original settings back, if needed: cp settings.db settings.db.bak
- Download SQLite database browser from here: http://sourceforge.net/projects/sqlitebrowser/
- Open the “settings.db” file that you pulled in #1 in SQLite Database Browser
- Browse data in the “system” table. You are looking for 2 rows: “lock_pattern_autolock” and “lockscreen.lockedoutpermanently”
- Make sure both rows have a value of “0″ instead of “1″. You can use SQLite to modify this data once you’ve browsed to it
- Save the database file and close the SQLite browser
- Push the sqlite database file back to your phone using this command: adb push settings.db /data/data/com.android.providers.settings/databases/settings.db
- Turn your phone off/on and your phone will no longer be locked! And, you don’t have to worry about fixing the permissions on settings.db. When your phone started, it reset the permissions on that file back to the default, which means you will have to root back in and re-chmod if you didn’t update the settings.db file properly.
This is a nifty way to change pretty much any SQLite data on your phone.