This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to disable the ADB port over network
#1
Is it possible to disable the ADB port over network (as over USB)?
Reply
#2
hi lionel,

have you already looked @ this...

Android Security: double check your ADB connection

--------------- ;-]..
hope it helps,
k,
Reply
#3
Here's what I'm testing:

1) flash OS image v14.4.0.5 (so developper options not enabled)
2) through ethernet: "adb connect IP" => "connected to IP"
3) through ethernet: "adb usb" => "restatring in USB mode"
4) through ethernet: "adb connect IP" => "cannot connect to IP ..."
5) power off / on
2) through ethernet: "adb connect IP" => "connected to IP"

Is there a way to disable the ADB port over network that persists after a shutdown?
Reply
#4
hi...

I just checked TinkerOS_Android 7 Nougat v14.4.0.5..

enabled Developer options & System UI Tuner..
Enable adb debugging on your device...

but.. if you know how to disable adb from shell...
maybe you can make file.. 

nano init.asus.sh
Code:
setprop service.adb.tcp.port -1
stop adbd
start adbd
found this.. "And you can disable it and return ADB to listening on USB with"

then.. push file to tinker board..
Code:
adb push init.asus.sh /system/etc/init.asus.sh

also.. make sure to 
Code:
adb shell chmod 0755 /system/etc/init.asus.sh

got this info.. thanks to doggedly - AUTOSTART, START ON BOOT SCRIPT?

note.. using only.. stop adbd in /system/etc/init.asus.sh will disable adb when
tinker board boots.. sooooo you will not be able to use adb to connect to root shell...

--------------- ;-]..
hope it helps,
k,
Reply
#5
Many thanks for your help!

Now that I can disable adb on boot the question is how do I go back and reassign port 5555 to the adb service if needed?
I am unable to connect the Tinker via usb... (developer options and "USB debbuging" are enabled)
Reply
#6
ooooops.....

that is why I  put...
note.. using only.. stop adbd in /system/etc/init.asus.sh will disable adb when
tinker board boots.. sooooo you will not be able to use adb to connect to root shell... ]]]].....

did.. 
Code:
setprop service.adb.tcp.port -1
stop adbd
start adbd
disable adb network and return ADB to listening on USB only..

if you have rooted tinker board.. then just download app like termux
this gives you termux bash shell..

open termux app then...
Code:
pkg upgrade
pkg install root-repo
pkg install termux-api php termux-exec termux-tools proot termux-services
exit termux, clear from recent app list & restart termux app..

now from termux bash shell
Code:
su
setprop service.adb.tcp.port 5555
stop adbd
start adbd
this should get you back in with network adb.. 

if you don't have rooted tinker board..
then I think serial access to root shell should still be working.. 

you will need.. pc/laptop & USB to TTL Serial Cable
connected to gpio pins of tinker board.. 

update...
this.. I have not yet done.. [[[....
Getting to the Serial Console on Tinker Board Android 7 Nougat V14.4.0.14

just searching for "tinker board root android shell via serial"

from Configuring UART to use as a serial port
"When the board boots the UART port should now be accessible from a terminal program on /dev/ttyS1."

hmm... 
Code:
bash:5.0][u0_a133]@~:$ sudo gpio readall
+-----+-----+---------+------+---+--Tinker--+---+------+---------+-----+-----+
| CPU | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | CPU |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
|     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
| 252 |   8 |   SDA.1 |  I2C | 1 |  3 || 4  |   |      | 5v      |     |     |
| 253 |   9 |   SCL.1 |  I2C | 1 |  5 || 6  |   |      | 0v      |     |     |
|  17 |   7 | GPIO0C1 |   IN | 0 |  7 || 8  | 0 | SERL | TxD.1   | 15  | 161 |
|     |     |      0v |      |   |  9 || 10 | 1 | SERL | RxD.1   | 16  | 160 |
| 164 |   0 |  CTSN.4 | SERL | 1 | 11 || 12 | 0 | I2S  | I2S_CLK | 1   | 184 |
| 166 |   2 | GPIO5B6 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |
| 167 |   3 | GPIO5B7 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO5B2 | 4   | 162 |
|     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO5B3 | 5   | 163 |
| 257 |  12 |  MOSI.2 |  SPI | 0 | 19 || 20 |   |      | 0v      |     |     |
| 256 |  13 |  MISO.2 |  SPI | 1 | 21 || 22 | 0 | IN   | GPIO5C3 | 6   | 171 |
| 254 |  14 |  SCLK.2 |  SPI | 1 | 23 || 24 | 1 | SPI  | CE0.2   | 10  | 255 |
|     |     |      0v |      |   | 25 || 26 | 1 | IN   | GPIO8A3 | 11  | 251 |
| 233 |  30 |   SDA.4 |  I2C | 1 | 27 || 28 | 1 | I2C  | SCL.4   | 31  | 234 |
| 165 |  21 |  RTSN.4 | SERL | 1 | 29 || 30 |   |      | 0v      |     |     |
| 168 |  22 | GPIO5C0 |   IN | 1 | 31 || 32 | 1 | SERL | GPIO7C7 | 26  | 239 |
| 238 |  23 | GPIO7C6 | SERL | 1 | 33 || 34 |   |      | 0v      |     |     |
| 185 |  24 |  I2S_FS |  I2S | 0 | 35 || 36 | 1 | SERL | RxD.3   | 27  | 223 |
| 224 |  25 |   TxD.3 | SERL | 1 | 37 || 38 | 1 | I2S  | I2S_SDI | 28  | 187 |
|     |     |      0v |      |   | 39 || 40 | 0 | I2S  | I2S_SDO | 29  | 188 |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
| CPU | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | CPU |
+-----+-----+---------+------+---+--Tinker--+---+------+---------+-----+-----+
bash:5.0][u0_a133]@~:$
looks like pins 8 & 10 are setup for serial from boot ;-]...

The Tinker Board contains UART on pins 8 and 10, the same as on the Raspberry Pi GPIO port...
Asus has the UART enabled by default as a serial console on ttyS1 with a baud rate of 115200. 
this is true for TinkerOS Debian... but is it also true for TinkerOS_Android...???  I don't know..... [[.. 

update...
notes.. UART
The default serial console is UART3, 115200 baud, 8N1 (8bit, no parity, 1 stop bit), 
no software flow control (Xon/Xoff), no hardware flow control

A "Prolific Technology, Inc. PL2303 Serial Port (067b:2303)" USB adapter can be used.

The relevant kernel parameter is console=ttyS3,115200n8

Getting to the Serial Console on Tinker Board Android 7 Nougat V14.4.0.14

also found this.. Linux / Unix Commands For Connecting To The Serial Console
&..................... How to Connect to a Serial Console

------------------
hope this helps,
k,
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)