fix: code check error

This commit is contained in:
余泓铮
2024-05-28 15:18:21 +08:00
parent a2cb0415f9
commit 05c4bc9e08

View File

@@ -205,15 +205,11 @@ func (d *Device) Forward(remoteInterface interface{}, noRebind ...bool) (port in
if err != nil {
return
}
command := ""
local := fmt.Sprintf("tcp:%d", localPort)
command := fmt.Sprintf("host-serial:%s:forward:%s;%s", d.serial, local, remote)
if len(noRebind) != 0 && noRebind[0] {
command = fmt.Sprintf("host-serial:%s:forward:norebind:%s;%s", d.serial, local, remote)
} else {
command = fmt.Sprintf("host-serial:%s:forward:%s;%s", d.serial, local, remote)
}
_, err = d.adbClient.executeCommand(command, true)