ADB over Wireless without root? - Android Software/Hacking General [Developers Only]

So Ive been trying to enable ADB over Wifi using both "adb tcpip 5555" and "setprop service.adb.tcp.port". Both methods work well on my rooted Android phones, but it doesnt work on neither an unrooted HTC Hero (2.1) and a stock Sony Ericsson Xperia X10 pro mini (1.6)..
Just wondering if it is at all possible to anble ADB through WiFi on a stock phone?

In order to issue the setprop command you need root privileges.
So unless your phone already listens to incoming tcp connections on some port you won't be able to enable it on a stock phone.
You might want to try and run a portscan on your phone's ip in order to determine if adb over wifi might be bound to a different port.

Related

[Q] Wireless ADB on Linux

Hi all,
I recently bought a Chromebook and promptly installed crouton to get the XFCE4 environment. I have eclipse set up and ADB set up and everything works wonderfully.
ADB happily detects my Moto G when I use the USB port.
My problem is that I cannot seem to get Wireless ADB working. Each time I type adb connect ip_adress_from_app it gives me unable to find device error
Can anyone help me?
I have already tried rebooting both my Chromebook and my Moto G, without success. I have also tried adb kill-server and adb start-sever, again without success.
Thanks in advance
Edit: Nevermind, it turns out my network was having problems, ADB wireless works fine when I use my mobile connection. Now I need to fix my network :/

[question] how to enable htc diagnostics interface via adb or terminal emulator

Hello... I have being at this for a long time. I have been googling and searching Xda but no better results. I want to enable the HTC's DIAG MODE via adb-shell or terminal emulator. In most HTC devices running stock HTC ROMS, this can be enabled by entering certain codes in the dailer but it doesnt work on the DESIRE HD's stock rom.
I managed to find some commands.
This one
Code:
echo 1 > /sys/devices/virtual/android_usb/android0/f_diag/on
And this
Code:
echo 1 > /sys/devices/virtual/usb_composite/diag/enable
First one works on non sense roms and the second one works on sense roms. They actually trigger the diag mode when they are issued but when i open QPST, it says no phone although it detects the port been opened,same thing applies to DFS. In device manager i can see the HTC DIAGNOSTICS INTERFACE there. I installed the driver but its still wouldnt work.
This leaves me to think that maybe i havent enabled all the functions needed for diagmode to work.
Reason why i have come to this conclusion is that, with the samsung devices, you would have to enter 3 to 4 commands to have the mode activated.
If anyone has been able to activate diagmode on thier HTC device via adb or terminal, pls share. As many people might be depending on this to fix thier devices(changed imeis after jtag).
mickeyasamoah said:
Hello... I have being at this for a long time. I have been googling and searching Xda but no better results. I want to enable the HTC's DIAG MODE via adb-shell or terminal emulator. In most HTC devices running stock HTC ROMS, this can be enabled by entering certain codes in the dailer but it doesnt work on the DESIRE HD's stock rom.
I managed to find some commands.
This one
Code:
echo 1 > /sys/devices/virtual/android_usb/android0/f_diag/on
And this
Code:
echo 1 > /sys/devices/virtual/usb_composite/diag/enable
First one works on non sense roms and the second one works on sense roms. They actually trigger the diag mode when they are issued but when i open QPST, it says no phone although it detects the port been opened,same thing applies to DFS. In device manager i can see the HTC DIAGNOSTICS INTERFACE there. I installed the driver but its still wouldnt work.
This leaves me to think that maybe i havent enabled all the functions needed for diagmode to work.
Reason why i have come to this conclusion is that, with the samsung devices, you would have to enter 3 to 4 commands to have the mode activated.
If anyone has been able to activate diagmode on thier HTC device via adb or terminal, pls share. As many people might be depending on this to fix thier devices(changed imeis after jtag).
Click to expand...
Click to collapse
AnyOne?

[How To] Disable Some Functions Of [USB PORT]

I am wondering around the internet to learn any method to disable MTP/PTP/all usb stuff except charging.
So, why i want this?
Because i want my device to be secure.
I don't anyone to sneak around and try to go into bootloader or recovery/connection to a pc etc to set my device to make a fresh start/copying data and end my privacy up.
So is there a way to disable those functions?
And if it is possible then what? Will it be secured?
And the big question is that can i enable it through recovery (from adb or moving mobile files) as you know if one has a messed up rom then he/she should have those functions workable.
I have Galaxy S3 Neo GT-I9301I
With stock rom (rooted)
I found this on a web:
.
The most device-compatible way to disable everything is to run this command at startup or set this in your build.prop:
Code:
setprop persist.sys.usb.config none
which is equivalent to charge-only on all Android devices.
That also disables adb. If you use adb regularly, then:
Code:
setprop persist.sys.usb.config adb
will allow adb when developer options are turned on/checked. If you don't use ADB often, I would not recommend it, because setting adb causes my S5 to still recognize in device manager, even when it is locked.
To restore original functionality,
Code:
setprop persist.sys.usb.config mtp,ptp,adb
allows all USB protocols.

adb over ethernet in Android 11

Hi. I've been playing with connecting my phone via ethernet, and notice that since (stock) android 11, enabling wireless debugging no longer enables generic local network adb access, it's now specifically for wireless only adb. Anyone know if there's a way to enable ethernet adb debugging, or where I can ask Google about it?
try
setprop persist.adb.tcp.port 5555
stop adbd
start adbd
adb connect <device ip>:5555
Ah, great idea, but requires root and I have not rooted or replaced the rom. Guess I may just have to wait until I have enough time, I suppose the warranty is close to finished.

Broke the display of my phone :(

So, My Redmi 5A fell from hands and ended up with completely black display. I could call and hear my ringtone and upon connecting to SCRCPY could see the lock screen. I could not unlock it as I had not allowed the input stimulation permission. So, I took it to service center and they a tried a couple of displays and told me that data will have to be wiped in order for the new display to work. The phone contains crucial amount of data that I cannot afford to lose. So, I brought is back and tried the following steps:
1. The lock is pattern style and I tried usb mouse over OTG but could not perform the correct swipes due to no display.
2. I found an app that can make one android act as mouse for another android. I could connect my phone through SCRCPY and unlock it with that app but the problem is I need to approve the bluetooth pairing prompt for the first time.
3. I looked around google to pair a bluetooth device using ADB but all methods require the device to be rooted.
4. Despite knowing the pattern, I can't find anyway to use a keyboard over OTG as it will be more precise than mouse.
Is there a way that I can solve this problem? Can I unlock my phone using ADB as I know the pattern? Can I connect my phone through usb to my PC in order to run SCRCPY and use a mouse at the same time to unlock it? Or is there anyway of display replacement without data wipe? Help a troubled fellow
you can't simulate touch events via adb shell input keyevent/ tap? is that some miui permission?
can you adb pull -a /sdcard?
surely there is a way maybe something with
adb shell settings put secure ...
https://developer.android.com/reference/android/provider/Settings.Secure
edit: I think it's somehow related to miui security center. at least I can't find it in settings tables
if you are not afraid about more invasive methods you could enable adb root shell in boot.img, root with magisk or flash twrp.img from EDL mode. this requires hacked splash.img and some bytes appended to magisk_patched.img
Note: In any case do a full raw dump of all partitions first, kinda failsafe backup.
aIecxs said:
if you are not afraid about more invasive methods you could enable adb root shell in boot.img, root with magisk or flash twrp.img from EDL mode. this requires hacked splash.img and some bytes appended to magisk_patched.img
Note: In any case do a full raw dump of all partitions first, kinda failsafe backup.
Click to expand...
Click to collapse
I'm not much familiar with all this. I don't think that I'll be able to do it safely. I'm trying blind swipes using OTG mouse but that too is now appearing to be futile. Is there a way that I can connect my Redmi 5A to a monitor using some sort of HDMI adapter and then use a mouse at the same time via OTG? Will that work? Please help me. I am really troubled by the thought of losing my data.
aIecxs said:
you can't simulate touch events via adb shell input keyevent/ tap? is that some miui permission?
can you adb pull -a /sdcard?
surely there is a way maybe something with
adb shell settings put secure ...
https://developer.android.com/reference/android/provider/Settings.Secure
edit: I think it's somehow related to miui security center. at least I can't find it in settings tables
Click to expand...
Click to collapse
Yes there is setting in MIUI security center. I have pulled data like my photos and videos but could not pull my texts, call logs, contacts and other app data which I need the most such as my Signal chat data.
unfortunately app data is not accessable via adb. you can read contacts and sms in plain text
Code:
adb shell content query --uri content://sms
adb shell content query --uri content://com.android.contacts/data
you could try MyPhoneExplorer it uses adb
you could try adb over wifi
Code:
adb tcpip 5555
adb connect 192.168.1.222:5555
adb -s 192.168.1.222:5555 shell
don't panic. your data is still there, just don't do anything stupid.
but consider risk of losing adb authorization. this can happen if you run different adb.exe from either platform-tools or from scrcpy directory. backup your adbkey.pub from .android directory now (although still could expire)
@helpwithabrokendisplay Don't try too much wrong pattern you will locked out from gatekeeper!
aIecxs said:
unfortunately app data is not accessable via adb. you can read contacts and sms in plain text
Code:
adb shell content query --uri content://sms
adb shell content query --uri content://com.android.contacts/data
you could try MyPhoneExplorer it uses adb
you could try adb over wifi
Code:
adb tcpip 5555
adb connect 192.168.1.222:5555
adb -s 192.168.1.222:5555 shell
don't panic. your data is still there, just don't do anything stupid.
but consider risk of losing adb authorization. this can happen if you run different adb.exe from either platform-tools or from scrcpy directory. backup your adbkey.pub from .android directory now (although still could expire)
@helpwithabrokendisplay Don't try too much wrong pattern you will locked out from gatekeeper
Click to expand...
Click to collapse
aIecxs said:
unfortunately app data is not accessable via adb. you can read contacts and sms in plain text
Code:
adb shell content query --uri content://sms
adb shell content query --uri content://com.android.contacts/data
you could try MyPhoneExplorer it uses adb
you could try adb over wifi
Code:
adb tcpip 5555
adb connect 192.168.1.222:5555
adb -s 192.168.1.222:5555 shell
don't panic. your data is still there, just don't do anything stupid.
but consider risk of losing adb authorization. this can happen if you run different adb.exe from either platform-tools or from scrcpy directory. backup your adbkey.pub from .android directory now (although still could expire)
@helpwithabrokendisplay Don't try too much wrong pattern you will locked out from gatekeeper!
Click to expand...
Click to collapse
Hi! This ADB over WiFi looks promising. I can use SCRCPY over WiFi and then connect mouse via OTG. The problem is how do I connect my Redmi 5A to the same wifi network that my PC is connected to. I was able to turn on WiFi using "adb shell svc wifi enable". Could not really find much on Google about it. Can you please tell me how can I connect to a specific wifi network usinf ADB? Anxiously waiting for your reply.
you can try this app adb-join-wifi.apk to join new wifi. but why not spoof any formerly known SSID in residential gateway wifi settings, so phone can connect automatically?
Connecting to WiFi using adb shell
I have all the details to connect to a particular access point. I have to use that access point only, so all I require is the command to do it.
stackoverflow.com
Hi! I was able to connect SCRCPY over WiFi and turned on the setting that had stopped me from entering inputs through scrcpy. So, I backed up all my appdata. Thanks a lot. Is there a way to donate to this website or more specifically to you?
although I wonder how you could backup without root, glad you solved. don't thank me, consider donation to scrcpy or MyPhoneExplorer if you find it useful
aIecxs said:
although I wonder how you could backup without root, glad you solved. don't thank me, consider donation to scrcpy or MyPhoneExplorer if you find it useful
Click to expand...
Click to collapse
MyPhoneExplorer didn't work. I donated to SCRCPY. Actually I opened all my apps and backup up data to Google Drive or created an offline copy which I restored on my other device. Thanks a lot to you. Hope you have a great time
helpwithabrokendisplay said:
So, My Redmi 5A fell from hands and ended up with completely black display. I could call and hear my ringtone and upon connecting to SCRCPY could see the lock screen. I could not unlock it as I had not allowed the input stimulation permission. So, I took it to service center and they a tried a couple of displays and told me that data will have to be wiped in order for the new display to work. The phone contains crucial amount of data that I cannot afford to lose. So, I brought is back and tried the following steps:
1. The lock is pattern style and I tried usb mouse over OTG but could not perform the correct swipes due to no display.
2. I found an app that can make one android act as mouse for another android. I could connect my phone through SCRCPY and unlock it with that app but the problem is I need to approve the bluetooth pairing prompt for the first time.
3. I looked around google to pair a bluetooth device using ADB but all methods require the device to be rooted.
4. Despite knowing the pattern, I can't find anyway to use a keyboard over OTG as it will be more precise than mouse.
Is there a way that I can solve this problem? Can I unlock my phone using ADB as I know the pattern? Can I connect my phone through usb to my PC in order to run SCRCPY and use a mouse at the same time to unlock it? Or is there anyway of display replacement without data wipe? Help a troubled fellow
Click to expand...
Click to collapse
What app are you talking about in #2, I know my pattern but my screen is broken, so if I could simulate a mouse that would make the pattern, with another device, I could get back into my phone, thanks!
solution here. thx @ zgfg
https://forum.xda-developers.com/t/how-to-rescue-data-from-my-9t-pro.4581901/post-88497057

Categories

Resources