On my Pixel 7 Pro with a smashed screen, and fingerprint unlock as well as unlock PIN, I used scrcpy
, which is amazing for accessing a broken phone. However, on newer Android versions (I think >10), pin number screens, and other "admin" views are not mirrored.
This is what worked for me, which is a combination of the techniques for this question:
I connected via adb
then ran:
shell
input keyevent POWER # alias for key 26
input keyevent 82 # unlock I think
input keyevent 82 # twice, unsure why
input text XXXXXXXXXXXX # PIN code here
input keyevent ENTER # alias for key 66
I needed a few tries to get this to work, since I think there are some timing dependencies. I used the CLI up/down history to quickly retry some of these until I could unlock.
I almost tried doing what @AaoIi did, getting exact coordinates for input mouse tap XX YY
or input touch tap XX YY
, to better simulate the PIN pad.
Another way to get the coordinates needed for this approach (after adb shell
), is getevent -t -l -v=32
, which translates to:
-t
add timestamps
-l
use nice labels for everything
-v=32
show position events only, but there might be an even better option
This will be quite noisy, and the positions are in hexademical :(, but you can do something (terrible) like:
getevents -your_options | grep ABS_MT_POSITION | awk -FS'[\s\\[\\]]+' '{printf "%s,%s,$d\n" $1, $4, $5}'
--fair to ban me from SO for this mess - It pipes the grep
-ed logs through awk
using SPACE, [ & ] as delimiters, and prints out the timestamp, label (X or Y position), and the hex position in decimal format.
I put this into a pivot table using a jupyter notebook, but something like clipivot
or datamash
can do this. So can awk
but it looks messy. You need this to rearrange the X and Y coords, which are logged sequentially, into 2d (x,y) data points