if [ ${ACTION} = "bind" ]; then
if [ ${PRODUCT} = ${MYPRODUCT} ]; then
adb start-server
adb shell svc data enable
adb shell svc usb setFunctions rndis
fi
fi
it works
but the smartphone every time I connect it asks me to
allow the connection, even if I have allowed more
once hooking.
That is a security feature in Android OS. A human (presumably the phone's owner) has to unlock the screen to allow the connection. Otherwise someone who doesn't know the unlock code could use adb to read your files.
I solved the problem (solution not appropriate but working) by copying the files:
adbkey
adbkey.pub
from my computer to the router in the directory
/root/.android
and now everything works perfectly
on the router I have:
openwrt 19.07.5
adb android.5.0.2_r1-3
I would like someone who knows what the program that creates the .android / adbkey and .android / adbkey.pub files is to communicate
the related problem to the maintainer of the package
I assume the adb package creates the files, but they are not
of course.
Yep, but this is performed implicitly when starting the server.
The newer adb version supports the keygen command that can generate the keys explicitly.
Perhaps the phone can remember only one key, or for some reason only the first one.
Also the adb version might be too old creating incompatible or weak keys.