[Q] Accessing phone via ADB shell with broken touchscreen (can't authenticate) - Nexus 4 Q&A, Help & Troubleshooting

So, the touchscreen on my Nexus 4 broke this weekend. I have a new device coming in, but in the meantime I need to be able to access the device to use a few different apps and send/receive some SMS messages from it.
I found a guide on reddit (Apparently I'm not allowed to post links, but it'll be the first result if you google "How I managed to use my Android device with a broken touch screen")
It's not exactly simple, but it should work.
Unfortunately, I discovered that in order to use ADB shell commands, a pop-up window should appear on the phone to allow/disallow USB debugging. (USB debugging is enabled already, but there appears to be an additional 'authentication' step)
Unfortunately, I can't use the phone's touchscreen, so I can't unlock it or tap the notification that will allow me to authenticate the phone.
Is there a way I can get around that authentication step?
The device is unlocked and rooted.

Related

GPS Tether via USB with simultaneously tethering Internet via Ad-hoc WiFi

I have searched several times, usually while on the road, so only now and then, but all total I must have searched for weeks worth of days trying to find an answer.
I found one.
What I wanted to do was take my T-Mobile G1's GPS receiver AND its Internet connection and forward both of these on to my laptop running Windows XP. I really would prefer a Linux solution, and I found one, but while in Linux my needs change slightly enough that the solution I found wasn't worth trying at that time. So I used Windows. As will most other people reading this, so.... >shrug<
I know it's not a very popular topic (not that it's non-popular; it's just that most people don't care enough to worry about it). However, that said, I know some poor pleb is out there trying to do exactly the same thing I found out how to do with exactly the same hardware and software, so I wanted to post how I did it.
MODS: I've not found anything detailing specifically this method on XDA and I did search before, but Google and I have been having communication problems in our relationship so I haven't been as proficient with results as usual. Therefore, if this has already been posted by someone else somewhere else, please forgive me, and feel free to pop a link in here, or merge, or whatever is appropriate. -- Thanks.
--------------------------------------------------
Required:
Rooted phone. which will require...
A computer with a USB port AND a WiFi device of some kind.
Install on the computer:
* the Android SDK
* com0com
* com2tcp - Which MIGHT be included in com0com, I don't remember.
* Something to use it with (Google Earth, for instance)
And on the phone, install the following:
* Android-Wifi-Tether (WiFi Tether for Root Users)
* ShareGPS <-- Just a link to a page with a QR code. The dev's page says to get it from Android Market.
That's a lot of stuff, but if you NEED this, it's worth it.
First and foremost, get ADB working. Beyond the scope of this post, go to Google for more info on doing this. Make sure, though, that your phone's debugging is enabled (Menu > Settings > Applications > Development).
Once ADB works, install the software above in the appropriate places. For com2tcp, put its executable file somewhere in the system path. I used c:\windows\system32 for it (and for ADB, come to think of it) but many people might balk at this, as though it's some holy ground on which lowly mortal files shalt not tread. Whatever. Find a hole it'll fit in and make sure it's in your system path.
After installing ALL of the above software, do this, in this order:
1) Connect the phone to the laptop via USB.
ON THE LAPTOP
2) Open com0com from your start menu.
3) Either remember these names for the com ports (at the top of the com0com window) OR name them more memorably. I'll use COM1 and COM2, but ONLY BECAUSE MY LAPTOP DOESN'T ALREADY HAVE THESE TWO PORTS. You can call them PORT1 and PORT2 if you want, or CHUNKY1 and CHEWY234 but I used COM1 and COM2. So, the rest of these instructions will be the way I did it -- you'll have to adjust them accordingly, and if you're not smart enough to figure out how to do so or what I mean by that, then I can't help you. After naming them, hit APPLY.
3b) On your first time running com0com, it'll want you to install new devices, twice. LET IT. Just let it do the automatic thing and you'll be fine.
4) Open the command prompt (Windowkey-R, "cmd", ENTER) (or Start, Programs, Accessories, Command Prompt).
5) In the command prompt, type in:
Code:
adb forward tcp:50000 tcp:50000
and hit enter. This creates the forwarding of the phone's internal communications to the USB (I think). Assuming there are no errors (if there are, you either did something wrong or you did something wrong (like getting ADB working)) then type in the following
Code:
com2tcp --telnet \\.\COM1 127.0.0.1 50000
and hit enter. This uses the above-created forward of comms and attaches it to the virtual COM port made with com0com in step 3. This time, assuming there are no errors, you should see some diagnostic output.
ON THE PHONE
6) Open ShareGPS.
6b) In ShareGPS, Menu > Settings, select Use USB and deselect Use Bluetooth. The Format is irrelevant to what we're doing, and Create NMEA is not needed for the HTC Dream hardware as the output already is in NMEA format AFAICT. Back out of the settings screen.
7) Tether your Internet connection. OPTIONAL: If your laptop already has Internet access somehow else, you can ignore this step.
8) Open and connect your mapping application on the laptop. YMMV, depends on your software, I can't help you here. In Google Earth, go to Tools, GPS, and click the REALTIME tab. Select NMEA, not Garmin. Select other options as appropriate (like auto follow). Hit start. You should, if it works, see diagnostic output in your command prompt window as well as a connection message on the phone in ShareGPS. In Google Earth, YMMV, but I at first saw no icon, and second I saw a little blue dot. Problem is, in GE, it quickly disconnects and reconnects. You might have better luck with GooPs Free.
If you use GooPs Free, it might not pop up in front. Look down in your system tray, and you'll find the GooPs icon. Right-click it, and select "Open GooPs". you'll be presented a small window. Click options. For the COM port, use one of the two that you made with com0com (if one doesn't work, try the other). Default rate worked for me, Hardware flow control. Autoconnect, Autoscan are set for me. The rest of the options should be pretty self-explanatory. If not, I can't help you (it's midnight here and I'm oh so tired right now) (but I REALLY wanted to get this posted to help anyone else). IF everything works, you'll have an obnoxiously large 3D arrowhead right where you are in Google Earth. If not, you'll have to troubleshoot the errors.
-----------------------------------------
Feel free to ask questions in reply, as I'll of course subscribe to this thread, but understand that I can't answer all questions as I barely understand enough to get this working myself.
ALSO, KNOW THIS: YOUR PHONE WILL BECOME LESS STABLE. I noticed a significant increase of unprompted reboots of my phone after futzing with these programs. Sometimes it lasted a few minutes, but usually it goes for hours. Further, they don't seem to be an issue until I start GPS tethering, so maybe it's not so bad.
You CANNOT use GPS Tether and USB Internet Tether at the same time. If you need to tether your phone's Internet, install WiFi Tether for Root Users (link above) and set it up accordingly. You should be able to launch WiFi tether at any time, but I would recommend doing it before forwarding the ADB GPS ports.
I do sincerely hope this helps someone, and if not, hopefully it will save time and not waste it.
Best Regards to All
Edits below:
WARNING: IF YOU PERFORM THIS HACK, AND THAT'S WHAT IT IS, YOU **WILL** SEE SUCH A HUGE DRAIN ON YOUR G1'S WIMPY LITTLE BATTERY THAT EVEN WITH IT PLUGGED IN AND "CHARGING" YOU WILL STILL HAVE A DRAIN UPWARD OF 35 PERCENT PER HOUR. ALSO, YOUR PHONE WILL GET HOT. NOT WARM. HOT. THINK ABOUT IT: YOU'RE CHARGING, YOU'RE RUNNING WIFI, AND YOU'RE RUNNING GPS ALL AT THE SAME TIME YOUR CUSTOM HACK ROM IS RUNNING YOUR CPU AT ITS MAXIMUM SPEED.
YOU HAVE BEEN WARNED.
How to in Linux
Hai
I am using an Ubuntu desktop...and might am interested in knowing hw to do it in Linux?
Regards
kumar
I wish I could help with that. While I use Linux too (Ubuntu, I think, on my laptop and Sabayon on my desktop), and used to use it as my primary OS, I do not know enough about it to do this. For starters, I've never gotten a decent working load of Google Earth on my laptop in Linux. When I was researching this, I found that 99% of what I found was based in Windows, and I was short on time so trying things in Linux was an unaffordable luxury. Everything takes me forever in Linux because I have to learn it first, and then start screwing with it.
For starters, though, you have to get ADB working, and then port forwarding the GPS to the phone's USB (done through ADB). From that point, I think Linux might *just* be able to handle getting the data visible to apps like Google Earth natively. I would start my search with "usb-to-telnet forwarding". Or "accessing USB with telnet", since really once you do the ADB forward, the phone is sending data direct to the USB port.
Edit: Of course, you'll also still need ShareGPS on the phone... I think...
I really don't know enough though to be able to provide the help I'm thinking you need/want, but hopefully this can at least get you started on the right track. If you figure it out, please post back to this thread...
Cheers,
CJ Chitwood
Linux Solutions???
I am going to dive into getting this working with Ubuntu on my EeePC. Right off the bat I'm thinking why not send the GPS to the netbook over bluetooth and use use the USB tether for the internet access? I'll see what my untrained brain can come up with.
Thanks for the post on this issue, I've been looking into this for 2 years.
Right, that should work if your Asus can receive GPS over bluetooth, and the USB tether for internet would save you a little on battery as you could kill the WiFi on both devices. My only problem was that my laptop did not have a bluetooth transceiver on it, so I was stuck doing it the bobo way. Story of my life, really
Glad it helped!
Thank you for this guide, I used some other applications though.
For my HD2 (running on Android 2.3.5) I used BlueNMEA, you can get it from the Android Market
I connected my phone with my laptop (running Win. 7), installed SDK and used ADB).
With ADB I used the commands from the BlueNMEA guide:
Code:
Using BlueNMEA over USB
-----------------------
Needs the Android SDK.
Connect your phone to a computer with the USB data cable. On the
computer, type "adb forward tcp:4352 tcp:4352". Now you can get NMEA
data by connecting to TCP 4352 on your computer.
For virtual ports I used HW VSP, quite simple to setup, I used COM9, typed 127.0.0.1 as address and the port 4352. It creates a service so this is a 1 time job.
At first I used GPSGate, but this didn't work with BlueNMEA.
GPSGate works with ShareGPS, same principle I guess.
For testing my GPS on my laptop I use OpenCPN, it shows my location perfectly.
The phone is also very stable, no problems at all.
The internet part doesn't concern me, because I have internet at my laptop .
I've been searching for a method to use my Android as a GPS mouse and I found this, thought I'd share my findings with you.
The fastest way to do this is via Bluetooth I think, but my laptop has no Bluetooth, ordered one @ Ebay for 5$, hope this saves me all the hassle.
The only thing I'm wondering, since I'm not familiar with Android SDK, is the ADB forwarding still alive after a reboot?
BTW, for people still searching for a Linux guide: http://sharedroid.jillybunch.com/user_linux.html
Thank you very much for that! Nicely informative.
AFAIK, the adb forward is gone after a phone reboot. However, I've never actually tested it. I've also not looked for a way to undo it...
cj chitwood said:
Thank you very much for that! Nicely informative.
AFAIK, the adb forward is gone after a phone reboot. However, I've never actually tested it. I've also not looked for a way to undo it...
Click to expand...
Click to collapse
I've fooled around a bit with the phone, every time I disconnect/connect I have to forward the port using ADB, ow well, I'll use Bluetooth as soon as I have my dongle.
The best part is this works, so I'm sure it will also work with Bluetooth.
I know for Windows Mobile it is possible to tether GPS through activesync,
which I used for my HD2 when it was stock Windows Mobile.
I use this when I'm at sea, I'm a sailor so it's nice to track my course.

Data recovery with broken screen without USB-Debugging

Hi, my OnePlus 2's screen recently broke (both the touchscreen and LCD-screen are inoperable). I already upgraded to another phone, but want to retrieve the data (music recordings, photo's, documents) from my OnePlus 2.
I once had USB-debugging enabled, but I'm afraid I may have once turned it off again (I suspect this, because ADB doesn't recognize the phone when it's turned on). I am however, able to 'unlock' the phone, by using the fingerprint scanner, which still recognizes my fingerprint, but when I do so, my PC still doesn't show any data of the phone (it does say it's connected).
Is there a way to retrieve any data from it? Any apps I could install (via the Google Play website) and use, without using the touchscreen?
Thanks in advance,
TeeBoner

I need HELP, Samsung, Adb and a broken screen

Hello,
I'm trying to reach out here because I've been looking this up for the longest time and can't seem to find a solution ,
I have a Samsung galaxy S7 edge G935F, about a week ago the phone fell from 3rd floor and the screen is broken, it's still working and I see that the screen is still responsive but when I try to put in the pattern lock for some reason it doesn't work,
It was working just fine for the past couple of days but what I forgot is that I had the automatic reboot option enabled,
two days ago the phone reboots and I can't use my fingerprint, because after the reboot you need to enter the pattern before being able to use the fingerprint option,
my question is, can I get access to my phone still? I did recover some photos and videos but I wanna use the phone on pc using an app like Vysor,
I tried ADB but it doesn't recognize the phone when I do 'adb devices', even tho when I connect it on pc it shows up but it's empty when I open it, normally it would show the files and everything if I unlock it,
I wanna know if there's any way to install the app so I can control it on pc, I tried the official samsung sidesync app but again it needs to be on the phone too to work, can you please assist me in this, it's very important for me and I need some contacts ASAP
thank you :c
Try OTG mouse
D1stRU3T0R said:
Try OTG mouse
Click to expand...
Click to collapse
Sadly I don't have that option at the moment.
Dreamlesskai said:
Sadly I don't have that option at the moment.
Click to expand...
Click to collapse
If you did not have USB debugging enabled in developer options, adb isn't going to work, you have to get it enabled first.
The fact that you can connect and see the storage doesn't mean anything, that only requires USB MTP connection, not adb functionality. They are two different kinds of connections requiring different drivers.
If you can get USB debugging enabled, then you have more than one option to get connected to recover your data and probably even remove the pattern/fingerprint.
Sent from my LGL84VL using Tapatalk

Eonon GA7151W Android - Wifi connected but no internet?

I have Eonon GA7151W headunit - Android 6.0
Suddenly my wifi says "Connected" but 'No Internet' .... it doesn't matter whether I tether to my phone or use my home wifi, for some reason the wifi says 'No internet'.
I tried a few things and ended up resorting to a factory reset ... unfortunately it's still not working after the factory reset! Exactly the same symptoms ...
Any ideas?
hogiela said:
I have Eonon GA7151W headunit - Android 6.0
Suddenly my wifi says "Connected" but 'No Internet' .... it doesn't matter whether I tether to my phone or use my home wifi, for some reason the wifi says 'No internet'.
I tried a few things and ended up resorting to a factory reset ... unfortunately it's still not working after the factory reset! Exactly the same symptoms ...
Any ideas?
Click to expand...
Click to collapse
I have the same issue that has me stumped. any luck fixing it?
Did anyone find a solution for this? Same thing is happening to me. I don't use the internet much on my head unit but I need it. It seems this is a widespread issue.
I'm having the same problem with my radio and after Google'ing I found that you need to run this command to fix it. I don't have root on my radio yet, which is why I'm not sure if this will work.
Code:
su
settings put global captive_portal_server google.com
"Each time your Android device connects to a Wi-Fi network, the system performs a Captive Portal Check. Android aims to ensure that your device has not only received an IP address from the access point, but can actually reach targets on the Internet. This is necessary, for example, for the detection of portal pages of WLAN hotspots (e.g. in hotels). Android sends a request to the address "connectivitycheck.gstatic.com" for verification. If the request is successful or is answered with HTTP Response Code 204, the Internet is accessible. With this request, the system transmits information about the IP address of the connection, the time of Internet access and which browser is currently used to Google.If you block this request to Google via AFWall+ or anywhere else in your network, a small cross will appear on the Wi-Fi icon in the Android menu bar. Depending on the Android version, a message will also appear that no Internet is available. However, privacy-conscious users in particular do not want to send a "ping" to Google every time they go online. There is now a solution that works on rooted and non-rooted devices."
Here's a method that may work without root. Only problem is it seems to be for German devices. Also my device is Android 6.
Android Nougat (7.x)
Connects the device to your computer via USB cable and activates ADB for the process. You then place the following commands via a terminal on the computer:
adb shell 'settings put global captive_portal_http_url "http://captiveportal.kuketz.de"'
adb shell 'settings put global captive_portal_https_url "https://captiveportal.kuketz.de"'
Android Oreo (8.x) | Pie (9.x)
Connects the device to your computer via USB cable and activates ADB for the process. You then place the following commands via a terminal on the computer:
adb shell 'settings put global captive_portal_http_url "http://captiveportal.kuketz.de"'
adb shell 'settings put global captive_portal_https_url "https://captiveportal.kuketz.de"'
adb shell 'settings put global captive_portal_fallback_url "http://captiveportal.kuketz.de"'
adb shell 'settings put global captive_portal_other_fallback_urls "http://captiveportal.kuketz.de"'
You can check whether the URLs have been adjusted as desired with the following command:
adb shell 'settings get global captive_portal_https_url'
I think I've broken it down to one command that needs to be run at terminal or adb.
Code:
settings put global captive_portal_detection_enabled 0
Again, I don't have root yet on my device and spent the whole day trying to root it, but you guys can try it out for yourselves. You can use this command to see if you disabled it.
Code:
settings get global captive_portal_detection_enabled
Don't know if all of you solved this issue or swapped unit... But the same happened to me this week after a crash that made me reboot the unit.
Since then, no internet at all, besides the wifi was running like supposed to.
Also tried the factory default, a pain for nothing.
This is how I fixed the issue:
Go to date time of the unit on settings, change it to manual, get it right and adjust the time fuse to the correct one for you, then, switch off then on the wifi and should be running like a charm.
I'm my case, the internet came back in most of apps, but in google store don't, needed to reboot the unit. (I have the by eonon and the code to my radio it's 126, so I can reboot it going to eonon settings)
Rpscavaleiro said:
Don't know if all of you solved this issue or swapped unit... But the same happened to me this week after a crash that made me reboot the unit.
Since then, no internet at all, besides the wifi was running like supposed to.
Also tried the factory default, a pain for nothing.
This is how I fixed the issue:
Go to date time of the unit on settings, change it to manual, get it right and adjust the time fuse to the correct one for you, then, switch off then on the wifi and should be running like a charm.
I'm my case, the internet came back in most of apps, but in google store don't, needed to reboot the unit. (I have the by eonon and the code to my radio it's 126, so I can reboot it going to eonon settings)
Click to expand...
Click to collapse
I'm gonna try this. Would be silly that messing with the clock fixes it. I haven't been able to do anything about it since I need to root the stereo to run those commands.
I truly rocomemd you to do it!
I won't lie that first I get it running, I came to this post and when I saw you guys answer, I was already thinking in take the stereo off, but my mazda 6 it's a pain to get it off, because I have to unscrew the dash.
After some dig, found that solution for issues with access with hotspots.
I also didn't believe that the proceed would work but... the important thing is that my Eonon came back to internet life!
Let me know if also worked with you.

Fire HD 10 gen11 - Skip Registration after Update

I personally enjoy using my new Fire HD 10 , but I don't want it tied down to an Amazon account. At first startup, I was able to bypass registration by skipping the WiFi connections. However, after that, when a system update happens, it asks me to re-register, and this time it skips past the WiFi question, because I already had it registered by that point.
The first option to get past it was to move away from my WiFi access point. However, I found another way to do this.
If you've already turned on USB debugging on your device, you can connect it to a PC, and, with the "adb" tool, run:
adb shell "am start -n com.amazon.firelauncher/com.amazon.firelauncher.Launcher"
This will cause the launcher to start, where you can then access the WiFi settings. From here you can "Forget" the connected network, restart, then "Add Network Connection", "Cancel", then the "Skip Registration" will appear.
It's a bit of a pain. Does anyone have a better solution?
groboclown said:
I personally enjoy using my new Fire HD 10 , but I don't want it tied down to an Amazon account. At first startup, I was able to bypass registration by skipping the WiFi connections. However, after that, when a system update happens, it asks me to re-register, and this time it skips past the WiFi question, because I already had it registered by that point.
The first option to get past it was to move away from my WiFi access point. However, I found another way to do this.
If you've already turned on USB debugging on your device, you can connect it to a PC, and, with the "adb" tool, run:
adb shell "am start -n com.amazon.firelauncher/com.amazon.firelauncher.Launcher"
This will cause the launcher to start, where you can then access the WiFi settings. From here you can "Forget" the connected network, restart, then "Add Network Connection", "Cancel", then the "Skip Registration" will appear.
It's a bit of a pain. Does anyone have a better solution?
Click to expand...
Click to collapse
Try to disable unwanted Amazon system updates by executing adb shell pm disable-user com.amazon.device.software.ota and adb shell pm disable-user com.amazon.device.software.ota.override

Categories

Resources