Академический Документы
Профессиональный Документы
Культура Документы
I know I can launch apps from adb. But with the screen locked, what good
does that do? My first thought was something like BBQScreen or AirDroid.
Turns out AirDroid doesn't actually let me control the screen, only view it. I
found that out too late. :\
Many of the steps here are actually not necessary or not the easiest way, but
I've included my entire process for educational purposes. This assumes you
are rooted and have USB debugging enabled. If you don't, then getting
around that will be your step 1, and that'll have to be an exercise for the
reader for now. If your bootloader is unlocked (or you don't mind wiping your
device to unlock it), anything should be possible.
1. Disable the lock screen through USB debugging. Must manually edit one
of Android's sqlite3 databases to do this. (Do not copy/paste in bulk. It
won't work due to changing shells and programs.)
adb shell
su
cp /data/data/com.android.providers.settings/databases/sett
chmod 665 /sdcard/settings.db
exit
exit
adb pull /sdcard/settings.db settings.db
sqlite3 settings.db
insert into secure (name, value) values ('lockscreen.passwo
update secure set value=1 where name='lockscreen.disabled';
^D
adb push settings.db /sdcard/settings.db
adb shell
su
cd /data/data/com.android.providers.settings/databases/
mv settings.db settings.db.bak
cp /sdcard/settings.db settings.db
chown system:system settings.db
chmod 660 settings.db
Search
exit r/Android
exit
854 adb
reboot
How I manag… CLOSE
Why use /sdcard as an intermediary? Well, I can't adb pull/push with protected
storage (such as /data), since the adb daemon itself doesn't use root. "adb
root" fails, saying it doesn't work on production builds. This probably depends
on your kernel. I'm on stock 4.4 kernel (but I am rooted). So I need to copy to
and from sdcard in a root shell to get my grubby hands into /data.
2. Okay, that didn't work. Better also remove the password files.
adb shell
su
cd /data/system
mkdir lock
mv password.key gesture.key locksettings* lock
exit
exit
adb reboot
3. Enable Bluetooth.
adb shell
su
am start -a android.bluetooth.adapter.action.REQUEST_ENABLE
Aw crap, it asks for confirmation on screen. I can't turn on Bluetooth until I get
my Bluetooth mouse connected, can't connect the Bluetooth mouse until I turn
on Bluetooth. Classic chicken-and-egg problem. But just as science has proven
that the egg came without any proper chickens before it, so will I prove that I
can turn on goddamn Bluetooth without clicking any goddamn buttons.
sqlite3 settings.db
update global set value=1 where name='bluetooth_on';
Then adb push and reboot like we did before. Aww yeah, Bluetooth is on.
Almost done! Turn on the Bluetooth mouse. Unfortunately I hadn't ever paired
it since my last OS reset, so it didn't autoconnect. I should've known. Onward!
5. Maybe I can use remote-control software. Doesn't AirDroid have that? The
hardest part is finding the name of the activity within AirDroid (or any app you
need to launch). A little Googling and I found it. I think I could've extracted it
from the apk easily enough if necessary, but glad I didn't have to. Let's also
enable wifi so AirDroid can work.
adb shell
am start -a android.intent.action.MAIN -n com.sand.airdroid/.
svc wifi enable #isn't that easy?
Search r/Android
6. Load up the AirDroid interface in my browser. Ugh. AirDroid asks for
confirmation on my phone. Another button to click!
854 How I manag… CLOSE
7. Screw it! All this manually editing SQL databases is making me batty. There's
gotta be a way to simulate taps/keystrokes through adb. Oh, turns out there
is. "input tap xcoord ycoord". Sweet. Looks like I just wasted a lot of time edited
SQL databases.....
Okay, so forget AirDroid. I'll just tap my way to Bluetooth. I just need to work
out the x/y coordinates of everything I need to tap. Let's just guess some. My
homescreen has a 5x6 grid, and the settings app is 2 down and 4 from the left.
The Nexus 4 screen is 1280x768. I think 600/300 ought to do it.
adb shell
su
input tap 600 300
Aww, that hit the one on top. Let's hit the back button and try 600/400 instead.
Bingo! Settings is up. The Bluetooth item is the second one down. You know, it
looks like roughly the same location as my Setting icon. Let's just try the same
thing.
Bingo bango! I'm in. I turn on my mouse. I see it in the list. It looks like...wait,
the same location on screen again? Really? Could I be that lucky?
If I'd known it was so easy to simulate taps, I wouldn't have bothered disabling
the lock screen, or manually enabling Bluetooth through sqlite3. However, I
think these techniques are worth putting out there, especially since simulating
a gesture lock would be a big fat pain in the booty.
Cheers!
Edit: formatting. Seems like I needed extra indents for the code tag to take
effect here.
ADVERTISEMENT
Search r/Android
SORT BY BEST
fastcompany.com/904149...
provider.fluidstack.io/ SIG N UP
78 Comment Share
Andy Rubin
@Arubin
We've started rolling out dark mode for Gmail in the latest update.
You should see an option to enable it if you have iOS 11+/Android 10+
soon.
twitter.com/gmail/...
Search r/Android ①⓿ @Jid_10 · Oct 10, 2019
@gmail when will we be able to mark as read an
email directly from the notification bar ? And what
2.9k
854 How I manag… CLOSE
431 Comments mode ?
Share
about dark
As always make sure to have your google account set to require your password for
all purchases, especially if you have kids using your phone, as a child may want a
voice changer app, but not quite understand the concept of money yet.
2.8k 117 Comments Share
This 6 year old poker game keeps getting better and better with
monthly updates and daily live events. Join in and start enjoying the
best poker experience on the internet.
Search r/Android
playwsop.com/ PLAY N O W
Months ago, Google executive for Android tweeted his requisites for
the perfect Bluetooth earbuds. Will rumored Pixel earbuds be like
this?
twitter.com/lockhe...