diff options
| author | b10tt0 <jfisher@greynoise.io> | 2023-06-13 10:34:55 -0400 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2023-06-13 18:11:15 +0200 |
| commit | d2ee9228555a1697ea8957f68403df8e4c55f42d (patch) | |
| tree | 663541a0bd41ad0d3190f1d2ca8ca0586f77a840 | |
| parent | 2f9d8e431803250e4c71dbd03599d64ba095ebdd (diff) | |
vm/adb: have adb work with android emulator by default
Add syzkaller recognition of android emulator ID.
| -rw-r--r-- | CONTRIBUTORS | 1 | ||||
| -rw-r--r-- | vm/adb/adb.go | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 516c92d38..ef9d9cfac 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -118,3 +118,4 @@ Liz Prucka George Kennedy Arm Ltd Andrew Turner +h0wdy 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 { |
