I have a similar problem as the one described in this question, but that question doesn't solve my problem. Summarized here:

I recently installed CyanogenMod 10 on my Galaxy Nexus. I enabled encryption. The first time I rebooted the phone, I was able to get past the lock screen with no trouble. I tried to change the screen lock PIN, but the settings app wouldn't accept my PIN.

Later, the screen locked due to the timeout being reached, and I wasn't able to unlock it. My password kept being rejected, and the "Forgot password" button that I read should come up never appeared. I rebooted my phone, and though I can easily decrypt it, I can't unlock it.

This answer suggested going through adb to fiddle with an SQLite database. However, I can't seem to access /data on my phone. I get the following error when I try to do an ls:

opendir failed, Permission denied

I tried to use su, but again, I got a Permission denied error. The phone is most definitely rooted, as I regularly use several root-only apps.

I really don't want to have to wipe the phone. Is there any other way to unlock this phone?


After posting this question, I came across this answer. I was able to get my phone unlocked by exploiting the phone hole mentioned (involving calling the phone and mashing the keys repeatedly--though instead of hitting the non-existent home key I swiped up Google Now). I deleted the password using the SQL mentioned in the answer I cited earlier. However, upon rebooting the phone, I'm back in an non-unlockable state.

In other words, I can exploit a hole to unlock my phone, but I can't reset the PIN, and I have to make sure to turn my screen on before 30 minutes elapses and avoid rebooting, or I'm toast.

5 Answers 5


I got it fixed. Here are the steps I took:

  1. Use the exploit here entitled "Phone: Use a hole to disable your lock". For me, it didn't work exactly as documented, though. I had to mash the password keys for a long time (calling my phone was unnecessary), then swipe up Google Now, mash the password a few more times, and hit Enter. With that, Google Now pops up and the phone is unlocked. I didn't test to find out how much of this is necessary and how much isn't.
  2. Fire up a terminal app on the phone. I can't get root access from adb. Type su to become root. It should go without saying that this method will not work unless the phone has been rooted.
  3. Enter the following commands to clear the password (source). Each line represents a command to type, one at a time.

    sqlite3 /data/data/com.android.providers.settings/databases/settings.db
    delete from secure where name='lockscreen.password_type';
    delete from secure where name='lockscreen.password_salt';

    Tip: These commands will be easier to type if you use Hacker's Keyboard and type with the phone in landscape orientation.

  4. Reboot the phone.
  5. The screen will still be locked and non-unlockable. So, repeat step 1 to unlock it.
  6. Go to the security screen and hit Screen lock. You will be asked to confirm your PIN. The new password is null. That means that instead of entering a password, just hit Next with a blank password.
  7. Now, you're in, so go ahead and change your PIN to whatever you want.

Here is how a Samsung GT-S5300 (Android 2.3 Gingerbread) was unlocked, which according to the user would not recognise its screen lock PIN anymore. No data was lost during the process. The device was not rooted, nor did it had anything fancy installed. An internet connection -WiFi or G2/3/4- is required though.

  1. Unplug the charger from your device.
  2. Install the free version of Screen Lock Bypass Reset. Ignore any warnings about purchasing the Pro version.
  3. Once installed, a bypass can be activated by plugging in the charger.
  4. The black Screen Lock Bypass Reset screen appears. Hit the return key ⏎ on your device to show the temporarily unlocked device desktop.
  5. This offers a window of opportunity to approve the Lock & Erase application which can be sent from any other device connected via the internet to the Google Android Device Manager website.
  6. After approval, it may take anything up to half an hour for the phone to become visible on the Google Android Device Manager website.
  7. Once visible on the website, click on Lock to enter a new PIN.
  8. The device can now be unlocked with the new PIN.
  • NOTE: This app is incompatible with my phone. It looks like it only works on Android versions up to 4.0. At any rate, the description in the Play Store is insufficient for understanding which devices it might be incompatible with. It appears that your phone is running Gingerbread, so it's rather ancient. Feb 3, 2014 at 2:29
  • @ScottSeverance Once logged in to the Google Play Store, a line under the application title will tell whether the app is compatible with one's phone and network. If not, consider purchasing the Pro version of the unlock app. Feb 3, 2014 at 8:08
  • The pro version is incompatible, as well. Likely this is for the same reason: The app only works with ancient Android versions, and possibly can't be made to work with modern versions. Feb 4, 2014 at 0:39

Gin Gordon's answer is good enough to fix most of the problem related to password unlocking. However, if the issue still exists, I suggested to have a look at Android Lock Screen Removal(paid), a small tool developed by Wondershare. It will use the downloaded recovery image to remove the lock screen password.


Here's how I cleared the screen lock password on my phone running CyanogenMod 11:

  • Boot into TeamWin (or other adb-enabled) recovery,
  • Connect the USB cable on the computer, then perform:


sudo -i
adb -d shell
mount /data
cd /data/system
rm gesture.key
rm password.key
  • reboot

if you know your samsung account, u can unlock your device without loosing any data or anything! I had the same problem. 1) Sing in with your samsung account : findmymobile.samsung.com/mindex.jsp 2) you will see 'unlock my screen' among the options . Then click it. It really works well Good lucks :)

  • This doesn't work since the question mentions installing CyanogenMod, which removes all Samsung's preinstalled software and customizations. If the user was on a stock ROM this could help. Aug 19, 2014 at 8:59
  • Plus, there's no Samsung account on a stock ROM, either, because there's no Samsung ROM. This is a Nexus device Aug 25, 2014 at 13:11

You must log in to answer this question.

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