From 7d5c341962e9721bdeecdb36c37511e1d8c25e23 Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Tue, 29 Oct 2019 21:44:39 -0700 Subject: Start adbd in user mode if bootloader is unlocked During automatic tests, we sometimes want to reboot the device out of the rescue party remotely. And per http://go/recovery-adb-access, one option is to start adbd in user build if the device has an unlocked bootloader. This should not add more surface of attack. Because verified boot is off with the unlocked bootloader, and the user can always flash a custom recovery image that always starts adbd. Bug: 141247819 Test: check adbd doesn't start in user build, unlock bootloader, and check adbd starts. Change-Id: I851746245f862cb4dfb01e6c3ad035f2c9f9ccec --- etc/init.rc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'etc') diff --git a/etc/init.rc b/etc/init.rc index 0822aba03..9786f6104 100644 --- a/etc/init.rc +++ b/etc/init.rc @@ -99,6 +99,10 @@ on property:service.adb.root=1 on fs && property:ro.debuggable=1 setprop sys.usb.config adb +# Also start adbd on user build with an unlocked bootloader +on fs && property:ro.debuggable=0 && androidboot.verifiedbootstate=orange + setprop sys.usb.config adb + on fs && property:sys.usb.configfs=1 mount configfs none /config mkdir /config/usb_gadget/g1 0770 shell shell -- cgit v1.2.3