From f67b6a3383d1e74d62690c2c6ce28f05ce2df1f2 Mon Sep 17 00:00:00 2001 From: PAN Lei Date: Fri, 27 Sep 2024 17:25:23 +0200 Subject: [PATCH] support moto --- src/workers/CommandorPage.js | 7 +++++-- src/workers/OCRChecker.js | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/workers/CommandorPage.js b/src/workers/CommandorPage.js index aefdb20..f2d5df5 100644 --- a/src/workers/CommandorPage.js +++ b/src/workers/CommandorPage.js @@ -1416,6 +1416,11 @@ class CommandorPage { await delay(2000); this.device.shell("input tap " + 818 + " " + 2140) await delay(1000); + } else if (model === "moto_g51_5G") { + await this.tapForDevice(this.device, 800, 2215) + await delay(2000); + this.device.shell("input tap " + 800 + " " + 2215) + await delay(1000); } else if (model === "CPH2219") { this.device.shell("input tap " + 772 + " " + 2146) await delay(2000); @@ -1468,11 +1473,9 @@ class CommandorPage { async enableDisableAirPlanMode() { logWithDevice("will enable/disable airplane mode", this.device) try { - // await this.device.shell("cmd connectivity airplane-mode enable") await exceutShellCmd(this.device, "cmd connectivity airplane-mode enable") await delay(1000) await exceutShellCmd(this.device, "cmd connectivity airplane-mode disable") - // await this.device.shell("cmd connectivity airplane-mode disable") await delay(2000) } catch (e) { try { diff --git a/src/workers/OCRChecker.js b/src/workers/OCRChecker.js index d4891d7..607344f 100644 --- a/src/workers/OCRChecker.js +++ b/src/workers/OCRChecker.js @@ -36,6 +36,7 @@ const ERR_CACHE_MISS_4 = "renvoyer les données" const ERR_EMPTY_RESPONSE = "ERR_EMPTY_RESPONSE" const ERR_SSL_PROTOCOL = "SSL_PROTOCOL_ERROR" const SLIDING_CAPTCHA_FR = "Pourquoi cette vérification" +const SLIDING_CAPTCHA_RETRY_FR = "RÉESSAYER" const SLIDING_CAPTCHA_LOADING_FR = "Chargement." const SLIDING_CAPTCHA_FR_2 = "Glissez vers la droite pour" const SLIDING_CAPTCHA_FR_3 = "la droite pour completer le puzzle" @@ -151,6 +152,10 @@ class OCRChecker { // if (result.includes("rac")) // return OCRResult.SLIDING_CAPTCHA_REFRESH return OCRResult.SLIDING_CAPTCHA + } else if (result.includes(SLIDING_CAPTCHA_RETRY_FR) + ) { + await this.deleteFile(fileName) + return OCRResult.TERMINAED } else if (result.includes(WELCOME_MESSAGE_FR) || result.includes(WELCOME_MESSAGE_FR_2) || result.includes(WELCOME_MESSAGE_FR_3)