From d1e3653c4ae5b85ea7a90aae3c4aa4103c320aff Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Fri, 17 Apr 2026 23:59:02 +0800 Subject: [PATCH] Fix: [CN] Skip user agreement --- module/handler/login.py | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/module/handler/login.py b/module/handler/login.py index f5139ac94..a41752177 100644 --- a/module/handler/login.py +++ b/module/handler/login.py @@ -8,7 +8,7 @@ from uiautomator2.xpath import XPath, XPathSelector import module.config.server as server from module.base.timer import Timer -from module.base.utils import color_similarity_2d, crop, random_rectangle_point +from module.base.utils import color_similarity_2d, crop from module.handler.assets import * from module.logger import logger from module.map.assets import * @@ -106,26 +106,29 @@ class LoginHandler(UI): if not self._user_agreement_timer.reached(): return False - confirm = self.image_color_button( + right = self.image_color_button( area=(640, 360, 1280, 720), color=(78, 189, 234), color_threshold=245, encourage=25, name='AGREEMENT_CONFIRM') - if confirm is None: + if right is None: return False - scroll = self.image_color_button( - area=(640, 0, 1280, 720), color=(182, 189, 202), - color_threshold=245, encourage=5, name='AGREEMENT_SCROLL' - ) - if scroll is not None: + # 2026.04.17 No scroll anymore, just bare swipe before clicking confirm + # if having blue button at right half of screen, but missing in left, it's a confirm button + # if having both, it's a blue button at middle confirming login + left = self.image_color_button( + area=(0, 360, 640, 720), color=(78, 189, 234), + color_threshold=245, encourage=25, name='AGREEMENT_CONFIRM') + if left is None: # User agreement - p1 = random_rectangle_point(scroll.button) - p2 = random_rectangle_point(scroll.move((0, 350)).button) - self.device.swipe(p1, p2, name='AGREEMENT_SCROLL') - self.device.click(confirm) + # just somewhere at the middle + box = (350, 230, 920, 430) + self.device.swipe_vector((0, -150), box, name='AGREEMENT_SCROLL') + self.device.swipe_vector((0, -150), box, name='AGREEMENT_SCROLL') + self.device.click(right) self._user_agreement_timer.reset() return True else: # User login - self.device.click(confirm) + self.device.click(right) self._user_agreement_timer.reset() return True