New: XDA launches forum for app developers. Discuss coding, tools, marketing, and more.
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
m.sabra
Old
(Last edited by m.sabra; 23rd August 2012 at 11:28 AM.)
#1  
Senior Member - OP
Thanks Meter 480
Posts: 130
Join Date: Sep 2011
Location: Beirut
Default [GUIDE][HOW-TO]Crack android pattern lock!

Quote:
Dislcaimer: this is for educational purposes only,you shall not use this on other people phones without permission under any circumstances,and am not responsable to any misuse of this hack
ok so not long ago i had a problem with a locked android device with a pattern and i managed to unlock it using adb,so here's how in case you were stuck one day with a locked device.

the device needs to have usb debugging enabled in case usb debugging isn't enabled and you have cwm you can run the same instructions from cwm,root is not required (though it will be so better if the device was rooted)

this was tested on:gingerbread,ice cream sandwich and jelly bean.

both method are through adb.

method 1:
Code:
adb shell
cd /data/data/com.android.providers.settings/databases
sqlite3 settings.db
update system set value=0 where name='lock_pattern_autolock';
update system set value=0 where name='lockscreen.lockedoutpermanently';
.quit
-AND/OR-

method 2:
Code:
adb shell rm /data/system/gesture.key
and that's a video showing how method 2 is done (thanks to melvinchng) : http://www.youtube.com/watch?v=tVJ7T...layer_embedded

you can try both of them,here is how i managed to remove the lock:
1- run the first method.
2-reboot
3-run the second method
4-reboot

NOTES:
-in the first method each line is a seperate command so click enter after typing each line.
-in the second method type all the command and then press enter.
-after running both methods and rebooting you may see the pattern lock,that doesn't necessarily mean it doesn't work,just try any random pattern and it may unlock then remove the pattern from settings.
-this may and may not work,it may work on some devices and don't on others,so all you can do is trying it but i can't assure it will work.
a small donation would be much appreciated thank (check my signature)
Galaxy Nexus & Nexus S One Click Root Tool !
[Toolkit] Nexus 7 One Click Root Tool
paypal not available in my country so i can't have a donation button,but you still can send me an amazon gift card with any value to this email m.sabra95@gmail.com by clicking here Thanks.
The Following 138 Users Say Thank You to m.sabra For This Useful Post: [ Click to Expand ]
 
creagrox
Old
#2  
creagrox's Avatar
Senior Member
Thanks Meter 13
Posts: 139
Join Date: Feb 2012
Location: Ranchi, Jharkhand
But What if i remember the password well enough, but didnt have data enabled the moment it got locked?

Explained elaborately here>>>http://forum.xda-developers.com/show...php?p=29963687
 
ashirviskas
Old
#3  
Senior Member
Thanks Meter 18
Posts: 135
Join Date: Jun 2011
Location: Kaunas
It will unlock either (Loook at the time of message above - I am time traveler )
Device: Optimus one
Device status:Finally got P500 AGAIN
Rom: IcySnap 1.6
OC: @480-768 SmartassV2
About me: Poor english I have. Please blame me not ; )
Other Things: Ma future phone will have foldable screen, at least 2 GB of RAM, 4 or 8 cores processor, good camera and of course it will be AnDrOiD Google Phone (It is my "dream phone" from 2010 ).
 
vNa5h
Old
#4  
vNa5h's Avatar
Senior Member
Thanks Meter 75
Posts: 352
Join Date: Dec 2011
Location: Mumbai
i have better method than bot the above ones


look for smudges on the phone
Dell XCD35 a.k.a ZTE Blade a.k.a Orange San Fransisco
Powered by CM10.1 KonstaKANG, Soundmagic PL11 earphones, Samsung class 6 16GB
Quote:
TV Shows / Movies .....I have watched....
The Following 13 Users Say Thank You to vNa5h For This Useful Post: [ Click to Expand ]
 
simster007
Old
#5  
Junior Member
Thanks Meter 3
Posts: 14
Join Date: Aug 2010
Do the files need to be restored or are they just the user data for the pattern locks?
 
spiderio
Old
#6  
spiderio's Avatar
Senior Member
Thanks Meter 66
Posts: 500
Join Date: Aug 2009
Location: Jakarta
This is really great...
i wonder how do you discover this
you must be a hacker

HTC Sensation
4.2.2 Slimbean beta | Sultan Kernel 3.0.76 | Hardswap 256mb | Self Tweaks

Samsung Galaxy S II
Rom Samsung Stock | Kernel Speedmod

Smartfren AndroTab
Rom Spiderio Andro-XperiaZ 4.1.2 | Performance Tweak
- - - - - - - - - ~*spiderio*~ - - - - - - - - -
 
manemzjum
Old
#7  
Senior Member
Thanks Meter 124
Posts: 730
Join Date: Dec 2010
Location: glasgow

 
DONATE TO ME
Or you could boot into recovery backup data
wipe factory reset and reboot
Could try restoring data but most likely restore pattern lock
Or simply enter your gmail address as requested
The Following User Says Thank You to manemzjum For This Useful Post: [ Click to Expand ]
 
Thunder07
Old
#8  
Thunder07's Avatar
Recognized Contributor / Recognized Developer
Thanks Meter 1058
Posts: 989
Join Date: Sep 2007

 
DONATE TO ME
2nd option...
if you have Custom recovery
use AROMA File Explorer and you can do the same thing through the recovery
or adb through the recovery
The Following 2 Users Say Thank You to Thunder07 For This Useful Post: [ Click to Expand ]
 
zmore
Old
#9  
zmore's Avatar
Senior Member
Thanks Meter 776
Posts: 1,357
Join Date: Apr 2011
FWIW, on CM10 neither method works as non-root. Yay CyanogenMod.

Method #1 FAIL:
1|shell@android:/data/data/com.android.providers.settings/databases $ ll
opendir failed, Permission denied
255|shell@android:/data/data/com.android.providers.settings/databases $ sqlite3 settings.db
Error: unable to open database "settings.db": unable to open database file

Method #2 FAIL:
shell@android:/data $ ll /data/system/gesture.key
-rw------- system system 20 2012-08-11 04:51 gesture.key
shell@android:/data $ rm /data/system/gesture.key
rm failed for /data/system/gesture.key, Permission denied

(I use faceunlock + pattern (mostly to keep my kid outta my phone), but if I actually cared more about security I'd encrypt my phone and use a passphrase instead)
phone #1: SGS3 (SGH-i747); ROM: CM10.1 Nightly (JB 4.2.2); kernel: Stock @ 1.5GHz || KT747 @ 2.1GHz(!); misc: Incipio Silicrylic case; 64GB class10 microSDXC
phone #2: SGS1 Captivate (SGH-i897 r1008); ROM: CM10.1 M3 (JB 4.2.2); kernel: Stock @ 1.0GHz; misc: $0.99 silicone case; 32GB Lexar microSDHC
 
 
D0GuKaN
Old
#10  
Senior Member
Thanks Meter 14
Posts: 153
Join Date: Jul 2010
Location: Ankara
This is a useful guide, thanks, I will try it