Monday, July 16, 2018

Android touch not working? Not to worry.

It's fairly rare to see a non-smartphone these days among the masses. Despite their numerous benefits, smartphones can sometimes be a PITA—especially the touchscreen.

I have a (somewhat aged) Greentel Safari M1 which suffers from an occasional hiccup - the touchscreen simply refuses to work. No matter how hard I try, there's no hint of a response - not a flicker, not a movement, not a button/icon highlight, nothing.

I have taken it to the vendor for repair, and all they do is factory-reset the phone (which then—for obvious reasons—starts running smoothly right away). None of the other suggestions—rebooting, tapping the corners, heating (which I didn't really try)—ever worked.

What if I can do the reset myself—without having to run to a repair shop every couple weeks?

Fortunately I can.

No, it's not a recovery option. That one I gave up a long time ago, after so many fruitless attempts to find a working button combination.

Now I always enable USB debugging right after I reset the phone (while the touch is back in its full glory) and authorize my developer machine to connect to it via adb.

Good thing with Android is that you get an impressive bunch of utility commands that run with adb, out of the box. Not much useful for a regular user, but handy for a developer, hacker or someone going through a hard time fixing his phone—like myself.

In my case, input is the tool that helps me get through my mess. input allows you to send arbitrary user inputs to your phone via your computer—touches, drags, long presses, keystrokes, home, back, shakes—whatever you wish.

Thankfully, now I can just get into the phone's shell (using adb shell) and run a series of inputs that would unlock my screen and reset the phone via [open top drawer] → Settings → [scroll down] → Backup and resetReset phone button:

# unlock
input swipe 120 320 0 320

# there will probably be unread SMS pop-ups: dismiss them with back button
input tap 10 180

# bonus: check missed calls!
input tap 20 450
input tap 120 180
input swipe 120 440 120 200
input swipe 120 440 120 200

# BEWARE! factory reset!
input keyevent HOME
input keyevent MENU
input tap 300 420
input swipe 120 440 120 200
input tap 300 420
input swipe 120 440 120 200
input tap 300 420
input tap 120 420
input tap 120 240

It's worth noting that my device runs a customized Android 4.4 OS, on a 240×320 screen. If you wish to utilize the same script for your phone, you might need to tweak it to suit your OS, menus and UI elements; the best way to do this would be to run the commands incrementally, checking the result at each stage and tweaking as you go along. (I myself had to spend about 15 minutes to get this one in order, the first time.)

Happy resetting!

No comments:

Post a Comment

Thanks for commenting! But if you sound spammy, I will hunt you down, kill you, and dance on your grave!