/etc/init/force-adb.conf is in lxc-android-config 0.230+16.04.20160328-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | # adbd - run adb debugging shell
#
# This task enables the adb shell
# adbd - run adb debugging shell
# gadget service - force adb
#
# This service checks if the adb shell user has a password set on boot
# It disables adb on the usb gadget if there is no password
start on ((file FILE=/var/lib/extrausers/shadow EVENT=modify) or (starting android-tools-adbd))
task
pre-start script
# in the emulator we always want to first have the gadget on
if grep -q qemu /proc/cmdline; then
android-gadget-service enable adb
stop
fi
end script
script
SHADOWFILE="/var/lib/extrausers/shadow"
ADBUSER="phablet"
PWLEN="$(grep ^$ADBUSER: $SHADOWFILE | sed -e "s/^$ADBUSER://" -e "s/:.*$//" | wc -c)"
if [ ! "$PWLEN" -gt 2 ]
then
if android-gadget-service status adb|grep -q enabled
then
android-gadget-service disable adb
fi
fi
end script
|