Some months ago, I rooted my Samsung Galaxy and installed SuperSU.

Stupidly, I'd had believed that the only thing that happens when you enter the pattern wrong too many times is that you have to wait a bit until you can try again, so when an acquantaince's little kid played around with it, I didn't mind, only to figure out I was locked out afterwards.

Usually, I have data and wifi turned off on my phone to preserve battery life, which was the case here as well, so I cannot unlock the phone with my google account because the phone has no internet access.

I tried the "call from different phone and try to get into settings" tricks, but no dice.

So I hope for one of these solutions (in order of preference):

  • Somehow be able to activate wifi or data so I can unlock the phone conventionally

  • Somehow be able to disable or deactivate the pattern lock at least long enough to activate wlan or data

  • Any other way that lets me keep my data

  • Any other way that makes my phone useable again

"su" in the adb shell makes me wait, then does nothing (probably SuperSU trying to ask for permission on the phone but invisible due to pattern lock).

-- Edit --

I am aware of this:

  • Solutions 1-3 require the phone to have internet, which it doesn't

  • adb -d shell works, but sqlite3 data/data/com.android.providers.settings/databases/settings.db produces sqlite3: permission denied and mount /data produces Usage: mount [-r] [-w] [-o options] [-t type] device directory. adb -d pull doesn't work either: failed to copy 'data/data/com.android.providers.settings/databases/settings.db' to './settings.db': Permission denied

  • The link to the zip file solution is dead

  • Apparently the security hole trick with calling the phone to try getting into the menu does not work for my phone

  • The next phone solution doesn't work either

  • the GSMHosting Solution is discontinued and taken down

  • Yeah..., I don't think I'm able to get my hands on a forensics program...

  • 2
    Welcome to the Android Enthusiasts! That looks like a classical case for our locked-out tag-wiki – and especially for our collection in Cannot unlock tablet as have no internet connection?
    – Izzy
    Commented Dec 5, 2015 at 22:15
  • Which Galaxy model specifically and which Android version precisely?
    – Firelord
    Commented Dec 6, 2015 at 3:59
  • @Firelord Samsung Galaxy Mini 2 S6500; unless the Android version can change on its own, it should be the stock one for this model/phone, except I also have SuperSU installed, as mentioned above (su --help in the adb shell has SuperSU v2.45 (aosp:armeabi) in the header and su --version says 2.45:SUPERSU)
    – joelproko
    Commented Dec 7, 2015 at 7:12
  • I've also tried adb -d root to circumvent su not giving permissions to access sqlite3 or pull, but that says adbd cannot run as root in production builds . All solutions I've found for that error message seem to require your phone not to be locked.
    – joelproko
    Commented Dec 7, 2015 at 7:20
  • I can't find any information about the stock android version in the phone's manual or other paper stuff that came with it.
    – joelproko
    Commented Dec 7, 2015 at 7:26

2 Answers 2


You could turn up your computer, and create a flashable ZIP to reset the lock by yourself. The folder tree must reflect the one below:


Next, inside the "android" folder, create two files, called "updater-script" and "update-binary". Double check for them to not have any extension.

Then, leave the updater-script blank, and enter the following lines into the update-binary:


mount /data
mount -o remount,rw /data

rm /data/system/gesture.key
rm /data/system/password.key

umount /data

After you saved the file, open an archive manager (like 7Zip), and compress the META-INF folder as ZIP, with the lowest possible compression level. Once compressed, rename the ZIP as per your liking.

Reboot the smartphone in Recovery mode, then plug it to the PC via USB. On the PC, start a command prompt and launch the adb server via:

adb start-server

Then, switch to your phone, and find an option called "adb sideload". Tap on it, and switch back to your computer, in whose prompt you'll write:

adb sideload "name-of-your-zip.zip"

Lastly, check that all goes well on your phone, and, if no errors are thrown, unplug the USB and restart it. Once the OS has booted, insert whatever pattern on the lock screen, and it will be accepted as correct.


First step : Reboot to a custom recovery. (You should probably know how to do that, but see here in case you don't).

Mount all the partitions (On TWRP, Check everything under Mount)

Connect to your PC, and launch an ADB shell. You should directly fall into a root shell.

Then, either use method 1, method 2, or both.

Method 1

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';

Method 2

adb shell rm /data/system/gesture.key

Reboot, and enjoy !

Main source...

  • Since I couldn't find TWRP for my GT-S6500, I installed Clockworkmod Recovery instead (and with Heimdall instead of Odin, since I have no access to a Windows machine). Seems to have worked, except now the phone keeps booting into recovery mode.
    – joelproko
    Commented Dec 31, 2015 at 23:16
  • That's weird.... Did you try a full shutdown (i.e. removing battery) ?
    – THC
    Commented Jan 1, 2016 at 11:36
  • For new problem of booting into recovery every is to flash that recovery again and don't ever try to reboot from cwm. It has bug or something about that. When ever you have to boot in system just remove your battery and plug it again. Now just simply boot.
    – Vivek Ji
    Commented Feb 23, 2016 at 16:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .