FORUMS
Remove All Ads from XDA

[Hack] remove a lockscreen pin via adb with sqlite3

509 posts
Thanks Meter: 151
 
By PAulyhoffman, Senior Member on 24th December 2011, 06:11 PM
Post Reply Email Thread
There are a couple other ways posted for folks who have forgotten lockscreen password or pattern, but this methods REMOVES the PIN. for pattern and password follow other methods

This method requires root access and debugging enabled.
*if debugging is not enabled it can be done from any custom recovery
-reboot recovery and follow code

PIN

Code:
adb shell
# sqlite3 /data/data/com.android.providers.settings/databases/settings.db
sqlite> update secure set value=65536 where name='lockscreen.password_type';
sqlite> .exit
# exit
adb reboot
step one
Code:
adb shell
make sure you have # in the command prompt/terminal (if not type su)

step two
Code:
sqlite3 /data/data/com.android.providers.settings/databases/settings.db
you will now see sqlite>in command prompt/terminal

step 4
Code:
update secure set value=65536 where name='lockscreen.password_type';
still sqlite>

step 5
Code:
.exit
you will see the # again

step 6
Code:
exit
you will now be in the path/to/adb command prompt/terminal again

step 7
Code:
adb reboot
Enjoy full access to the device

Now lets say you think your wife is cheating on you (which she probably is) and you want to check her sext messages but return the PIN back when you are done.



Code:
adb shell
# sqlite3 /data/data/com.android.providers.settings/databases/settings.db
sqlite> update secure set value=131072 where name='lockscreen.password_type';
sqlite> .exit
# exit
adb reboot
The Following 14 Users Say Thank You to PAulyhoffman For This Useful Post: [ View ] Gift PAulyhoffman Ad-Free
 
 
15th March 2012, 06:46 PM |#2  
BrotherG's Avatar
Senior Member
Thanks Meter: 14
 
More
I find this a bit scary, how would you normally prevent ADB or Recovery hacking like this if your device gets stolen?
16th March 2012, 12:26 AM |#3  
mDroidd's Avatar
Senior Member
Thanks Meter: 1,389
 
Donate to Me
More
Quote:
Originally Posted by BrotherG

I find this a bit scary, how would you normally prevent ADB or Recovery hacking like this if your device gets stolen?

I recommend Avast Anti Theft.

When your device gets stolen, the new owner will take the sim card out and put his in huh?

Well, anti theft sends a pre-entered number a warning that an other SIM is in it. Via sms commands, you can turn GPS on, send the location, block root and stuff.

It wont be deleted as it is a system app
I use it.

Thanks for the job, needed this for hacking my bros phone xD

Greets!
The Following User Says Thank You to mDroidd For This Useful Post: [ View ] Gift mDroidd Ad-Free
16th March 2012, 12:33 AM |#4  
Senior Member
Thanks Meter: 62
 
Donate to Me
More
hahaha. .... these Feds could of used this method. They couldnt get past the lockscreen. Great read here.


How a Pimp’s Android Pattern Lock Foiled the Feds
http://gizmodo.com/5893410/how-a-pim...oiled-the-feds
16th March 2012, 07:09 PM |#5  
BrotherG's Avatar
Senior Member
Thanks Meter: 14
 
More
Cool
Looks like CyanogenMod is working on securing ADB

Quote:

Security and You
March 16th, 2012
jeagoss
1
Many of you may not give it a second glance, but among all the furor and concern about permissions requested by market apps and privacy, all Custom ROMs (CyanogenMod included) ship with one major security risk — root!

We have been struggling with how to handle this for quite a bit, and took a first step with the first public CyanogenMod 9 alpha builds, by disabling the previously-default root access over USB. You can still get adb root access by running “adb root” in terminal, should you ever need it.

We recently merged 3 patches into CyanogenMod 9, to further address this: http://goo.gl/eCjDV http://goo.gl/oWAFI and http://goo.gl/34vai.

What follows is an explanation of the changes, how they affect you and our reasoning behind them.

What do the patches do?
They disable root selectively and in a configurable way. Users will be able to configure their exposure to root as:

Disabled
Enabled for ADB only
Enabled for Apps only
Enabled for both
How does this change affect the usage of your device, and root apps you have installed?
On a default CyanogenMod installation, root usage will have to be explicitly enabled by the user. This means that the user is fully aware that any application that uses root may perform actions that could compromise security, stability and data integrity. Once enabled, the process mirrors that of the current process, apps that request root will be flagged by the SuperUser.apk and the user will have to grant selective access.

Why the change?
At CyanogenMod, security has always been one of our primary concerns, however, we were hesitant to make a change that might disrupt the current root ecosystem. With CyanogenMod 9 we have the opportunity to do things better, whether its the code in the OS, UI/UX, or security – we are taking this time to do things with a fresh approach.

Shipping root enabled by default to 1,000,000+ devices was a gaping hole. With these changes we believe we have reached a compromise that allows enthusiasts to keep using root if they so desire but also provide a good level of security to the majority of users.

What concerns remain?
Many of you reading this are savvy enough to note a remaining hole in this approach – recovery and unlocked bootloaders. The bootloaders are out of our hands, there is little to nothing we can do on that front.

Regarding recovery – with unlocked bootloaders, a malicious user could just flash a new recovery image (without any potential security we could apply) or just dump the data partition. This however, requires physical access to the device. As such, the security standards for this are highly reliant on you, the device owner. Data encryption is available in ICS to safeguard your data. (Warning for emmc only users – encrypted /data means recovery will be non-functional.)

The onus is on you to secure your device; take care of your possessions, and this risk is minimal. Always make sure you take devices out of your car before you go into the mall and remove them from pockets before washing laundry. Common sense is a basic security tool.

But Why?
We honestl

Source: http://www.cyanogenmod.com/blog/security-and-you
The Following User Says Thank You to BrotherG For This Useful Post: [ View ] Gift BrotherG Ad-Free
2nd April 2012, 09:07 AM |#6  
jaibar's Avatar
Senior Member
Flag Underwater, no Sh!t
Thanks Meter: 897
 
More
Quote:
Originally Posted by mDroidd

I recommend Avast Anti Theft.

When your device gets stolen, the new owner will take the sim card out and put his in huh?

Well, anti theft sends a pre-entered number a warning that an other SIM is in it. Via sms commands, you can turn GPS on, send the location, block root and stuff.

It wont be deleted as it is a system app
I use it.

Thanks for the job, needed this for hacking my bros phone xD

Greets!

All true, if speaking of a casual thief- maybe you left the phone on the bar and someone couldn't resist the temptation. A couple of months ago my wife's phone was recovered in such an occasion- got an sms from Avast Theft Aware with the new number, contacted the rather surprised "honest finder" and he decided to return it back to us.

Anyway, two weeks ago went scubadiving and when returning to the car found the window broken and sure, among other stuff (wallets, scuba gear etc) also both our phones were stolen. However, this time it looks like the thieves were not quick to put their own sim card. Actually, it looks like they've removed the batteries, thrown the sim cards away (the're useless anyway as the carrier blocks the sim).

Since then, no signs whatsoever that the phones have been turned on, sims replaced or that someone has tried to type wrong security pin or whatever- no sms notifications, no emails, no webtracking, nothing.

My guess- the thieves sell them for a small fee (20% of street price?) to some lab or someone who knows "how to deal with it"- do a good wipe (not just factory reset) and remove whatever stuff was installed- system app or not- then put them on market for sale as second hand. Or maybe they just wait with patience a few weeks until you stop looking for it?

So, sometimes these apps like Avast, Cerberus and the such work, sometimes not. Better to keep the phone safe and not rely on it being stolen by a stup!d thief...

On the bright side, one can consider it as an opportunity for upgrade
5th October 2012, 06:45 AM |#7  
Senior Member
Flag Pune
Thanks Meter: 95
 
More
irst I typed in :

sqlite3 /data/data/com.android.providers.settings/databases/settings.db
However, in spite of what he stated, sqlite>in command prompt doesn't appear.

Instead, I get

/system/bin/sh: sqlite3: not found

how do i set sqlite working?

I'm unable to launch sqlite3 from adb shell

I can manually launch sqlite from the folder but not in cmd
The Following User Says Thank You to Mr.Oug For This Useful Post: [ View ] Gift Mr.Oug Ad-Free
6th January 2013, 05:14 AM |#8  
Member
Thanks Meter: 5
 
More
You have to install sqlite3 - https://play.google.com/store/apps/d...3forroot&hl=en
6th February 2013, 09:20 PM |#10  
Member
Thanks Meter: 0
 
More
Is there another way to bypass the pin code lockscreen? Cus´ I´m always stucking on:

" /sbin/sh: sqlite3: not found "

I have installed sqlite from market
7th February 2013, 09:45 AM |#11  
Member
Thanks Meter: 0
 
More
any idea?
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes