use brave as browser
This commit is contained in:
@@ -8,7 +8,8 @@ const puppeteer = require('puppeteer');
|
|||||||
const GeoCaptchaSolver = require("./GeoCaptchaSolver");
|
const GeoCaptchaSolver = require("./GeoCaptchaSolver");
|
||||||
const SlidingCaptchaSolver = require("./SlidingCaptchaSolver");
|
const SlidingCaptchaSolver = require("./SlidingCaptchaSolver");
|
||||||
const OCRChecker = require("./OCRChecker");
|
const OCRChecker = require("./OCRChecker");
|
||||||
const {main} = require("yarn/lib/cli");
|
const {main, elephant} = require("yarn/lib/cli");
|
||||||
|
const {exec} = require("child_process");
|
||||||
// const RDV_URL = "http://192.168.0.44:8000/test_appointment.html"
|
// const RDV_URL = "http://192.168.0.44:8000/test_appointment.html"
|
||||||
const RDV_URL = "https://rendezvousparis.hermes.com/client/register";
|
const RDV_URL = "https://rendezvousparis.hermes.com/client/register";
|
||||||
const BLANK_URL = "about:blank"
|
const BLANK_URL = "about:blank"
|
||||||
@@ -665,6 +666,11 @@ class CommandorPage {
|
|||||||
|
|
||||||
async slidingCaptcha(onResult) {
|
async slidingCaptcha(onResult) {
|
||||||
logWithDevice("slidingCaptcha", this.device);
|
logWithDevice("slidingCaptcha", this.device);
|
||||||
|
if (this.device.model() === "MI 5s") {
|
||||||
|
let cmd = `adb -s ${this.device.serial()} shell input touchscreen swipe 900 495 900 295`
|
||||||
|
await exec(cmd);
|
||||||
|
await delay(1000);
|
||||||
|
}
|
||||||
let slidingCaptchaSolver = new SlidingCaptchaSolver(this.device);
|
let slidingCaptchaSolver = new SlidingCaptchaSolver(this.device);
|
||||||
await slidingCaptchaSolver.solve(this.page, async (isSuccessful) => {
|
await slidingCaptchaSolver.solve(this.page, async (isSuccessful) => {
|
||||||
console.log("check isAlwaysBlocked")
|
console.log("check isAlwaysBlocked")
|
||||||
@@ -893,11 +899,17 @@ class CommandorPage {
|
|||||||
await this.checkResultWithOcr();
|
await this.checkResultWithOcr();
|
||||||
break;
|
break;
|
||||||
case OCRResult.BRAVE_PRIVACY:
|
case OCRResult.BRAVE_PRIVACY:
|
||||||
|
if (this.device.model() === "MI 5s")
|
||||||
|
await this.device.shell("input tap " + 530 + " " + 970)
|
||||||
|
else
|
||||||
await this.device.shell("input tap " + 500 + " " + 1120)
|
await this.device.shell("input tap " + 500 + " " + 1120)
|
||||||
await delay(2000);
|
await delay(2000);
|
||||||
await this.checkResultWithOcr();
|
await this.checkResultWithOcr();
|
||||||
break;
|
break;
|
||||||
case OCRResult.BRAVE_PRIVACY_PUB:
|
case OCRResult.BRAVE_PRIVACY_PUB:
|
||||||
|
if (this.device.model() === "MI 5s")
|
||||||
|
await this.device.shell("input tap " + 60 + " " + 900)
|
||||||
|
else
|
||||||
await this.device.shell("input tap " + 455 + " " + 1920)
|
await this.device.shell("input tap " + 455 + " " + 1920)
|
||||||
await delay(2000);
|
await delay(2000);
|
||||||
await this.checkResultWithOcr();
|
await this.checkResultWithOcr();
|
||||||
@@ -993,8 +1005,11 @@ class CommandorPage {
|
|||||||
|
|
||||||
|
|
||||||
async handleBraveSkipBtn() {
|
async handleBraveSkipBtn() {
|
||||||
if (this.device.model() === "CPH2219") {
|
let model = this.device.model()
|
||||||
|
if (model === "CPH2219") {
|
||||||
await this.device.shell("input tap " + 558 + " " + 1160)
|
await this.device.shell("input tap " + 558 + " " + 1160)
|
||||||
|
} else if (model === "MI 5s") {
|
||||||
|
await this.device.shell("input tap " + 530 + " " + 1000)
|
||||||
} else {
|
} else {
|
||||||
await this.device.shell("input tap " + 470 + " " + 1160)
|
await this.device.shell("input tap " + 470 + " " + 1160)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user