From d2ee9228555a1697ea8957f68403df8e4c55f42d Mon Sep 17 00:00:00 2001 From: b10tt0 Date: Tue, 13 Jun 2023 10:34:55 -0400 Subject: vm/adb: have adb work with android emulator by default Add syzkaller recognition of android emulator ID. --- vm/adb/adb.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'vm/adb') diff --git a/vm/adb/adb.go b/vm/adb/adb.go index b63331cc8..96c156130 100644 --- a/vm/adb/adb.go +++ b/vm/adb/adb.go @@ -69,6 +69,7 @@ type instance struct { var ( androidSerial = "^[0-9A-Z]+$" ipAddress = `^(?:localhost|(?:[0-9]{1,3}\.){3}[0-9]{1,3})\:(?:[0-9]{1,5})$` // cuttlefish or remote_device_proxy + emulatorID = `^emulator\-\d+$` ) func loadDevice(data []byte) (*Device, error) { @@ -100,8 +101,8 @@ func ctor(env *vmimpl.Env) (vmimpl.Pool, error) { if len(cfg.Devices) == 0 { return nil, fmt.Errorf("no adb devices specified") } - // Device should be either regular serial number, or a valid Cuttlefish ID. - devRe := regexp.MustCompile(fmt.Sprintf("%s|%s", androidSerial, ipAddress)) + // Device should be either regular serial number, a valid Cuttlefish ID, or an Android Emulator ID. + devRe := regexp.MustCompile(fmt.Sprintf("%s|%s|%s", androidSerial, ipAddress, emulatorID)) for _, dev := range cfg.Devices { device, err := loadDevice(dev) if err != nil { -- cgit mrf-deployment