diff --git a/hrp/internal/version/VERSION b/hrp/internal/version/VERSION index c63f5e808..feba9cc8d 100644 --- a/hrp/internal/version/VERSION +++ b/hrp/internal/version/VERSION @@ -1 +1 @@ -v4.3.3.2306151200 \ No newline at end of file +v4.3.3.2306281303 \ No newline at end of file diff --git a/hrp/pkg/uixt/algorithm.go b/hrp/pkg/uixt/algorithm.go index ac6c11c5b..ac517ddb5 100644 --- a/hrp/pkg/uixt/algorithm.go +++ b/hrp/pkg/uixt/algorithm.go @@ -203,7 +203,7 @@ func (dExt *DriverExt) FindDetectUIRectInUIKit(uiTypes []string, options ...Data return 0, 0, 0, 0, err } var rect image.Rectangle - rect, err = service.FindUI(uiTypes, bufSource.Bytes()) + rect, err = service.FindUI(uiTypes, bufSource.Bytes(), options...) if err != nil { return 0, 0, 0, 0, err } diff --git a/hrp/pkg/uixt/ext.go b/hrp/pkg/uixt/ext.go index ec0f1ca04..3c055f194 100644 --- a/hrp/pkg/uixt/ext.go +++ b/hrp/pkg/uixt/ext.go @@ -614,15 +614,30 @@ func (dExt *DriverExt) DoAction(action MobileAction) error { return fmt.Errorf("invalid %s params: %v", ACTION_TapByOCR, action.Params) case ACTION_TapByCV: if imagePath, ok := action.Params.(string); ok { - return dExt.TapByCV(imagePath, WithDataIdentifier(action.Identifier), WithDataIgnoreNotFoundError(action.IgnoreNotFoundError), WithDataIndex(action.Index)) + return dExt.TapByCV( + imagePath, + WithDataIdentifier(action.Identifier), + WithDataIgnoreNotFoundError(action.IgnoreNotFoundError), + WithDataIndex(action.Index), + WithDataScope(dExt.getAbsScope(action.Scope[0], action.Scope[1], action.Scope[2], action.Scope[3])), + ) } if uiParams, ok := action.Params.([]interface{}); ok { var uiTypes []string for _, uiParam := range uiParams { - uiType, _ := uiParam.(string) + uiType, ok := uiParam.(string) + if !ok { + continue + } uiTypes = append(uiTypes, uiType) } - return dExt.TapByUIDetection(uiTypes, WithDataIdentifier(action.Identifier), WithDataIgnoreNotFoundError(action.IgnoreNotFoundError), WithDataIndex(action.Index)) + return dExt.TapByUIDetection( + uiTypes, + WithDataIdentifier(action.Identifier), + WithDataIgnoreNotFoundError(action.IgnoreNotFoundError), + WithDataIndex(action.Index), + WithDataScope(dExt.getAbsScope(action.Scope[0], action.Scope[1], action.Scope[2], action.Scope[3])), + ) } return fmt.Errorf("invalid %s params: %v", ACTION_TapByCV, action.Params) case ACTION_DoubleTapXY: diff --git a/hrp/pkg/uixt/ui_vedem.go b/hrp/pkg/uixt/ui_vedem.go index c136a0587..3a6fc2ea8 100644 --- a/hrp/pkg/uixt/ui_vedem.go +++ b/hrp/pkg/uixt/ui_vedem.go @@ -160,7 +160,6 @@ func (s *veDEMUIService) FindUI(uiTypes []string, byteSource []byte, options ... var rects []image.Rectangle for _, box := range uiResult { rect = image.Rectangle{ - // cvResult.Points 顺序:左上 -> 右上 -> 右下 -> 左下 Min: image.Point{ X: int(box.Point.X), Y: int(box.Point.Y),