Open pmeenan opened 7 years ago
Hi. i suppose, it's possible. Give me some time to research this issue
FWIW, gnirehtet uses a control service with .START and .STOP intents
In the meantime, it's a bit ugly but setting the usb config will toggle the interface and start the VPN:
adb shell su -c 'setprop sys.usb.config adb'
The VPN confirmation dialog can also be detected:
dumpsys window windows | grep vpndialogs
and dismissed:
adb shell input keyevent KEYCODE_DPAD_RIGHT
adb shell input keyevent KEYCODE_ENTER
adb shell input keyevent KEYCODE_DPAD_RIGHT
adb shell input keyevent KEYCODE_ENTER
I need to test a couple different releases to see if the permissions dialog is the same but it looks like it is at least possible. It's a shame that the dialog comes up after every reboot.
That said, it would be a lot cleaner if:
@pmeenan How are you getting on with this? Have you found any further info, or a suitable workaround? Or anything else relevant?
I went a different path and updated a fork of vpn-reverse-tether
Is it possible to start the service directly without requiring physically detaching and re-attaching the USB cable?
In an automated lab environment we may be rebooting devices remotely and managing the state of the device over adb and it is pretty critical to be able to start/stop remotely. It feels like I'm pretty close but may be missing something:
Stopping it remotely (and cleanly) is pretty easy: