work well now for oneplus 8t
This commit is contained in:
@@ -205,10 +205,14 @@ class CommandorPage {
|
||||
}
|
||||
|
||||
let cancel
|
||||
const intervalTask = setInterval(() => {
|
||||
const intervalTask = setInterval(async () => {
|
||||
if (this.isTerminated) {
|
||||
log(this.device.model() + ":request terminated, send cancel()");
|
||||
// this.resetBrowser();
|
||||
try {
|
||||
await this.page.close()
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
this.disconnectBrowser();
|
||||
clearInterval(intervalTask)
|
||||
cancel()
|
||||
@@ -555,14 +559,14 @@ class CommandorPage {
|
||||
await delay(getRandomWaitTime())
|
||||
try {
|
||||
if (!this.page.isClosed()) {
|
||||
if (!this.isTerminated && !this.page.isClosed()) {
|
||||
this.page.evaluate(() => {
|
||||
let element = document.getElementsByClassName("btn")[0];
|
||||
if (typeof element !== 'undefined')
|
||||
document.getElementsByClassName("btn")[0].focus();
|
||||
})
|
||||
}
|
||||
await delay(getRandomWaitTime())
|
||||
// if (!this.isTerminated && !this.page.isClosed()) {
|
||||
// this.page.evaluate(() => {
|
||||
// let element = document.getElementsByClassName("btn")[0];
|
||||
// if (typeof element !== 'undefined')
|
||||
// document.getElementsByClassName("btn")[0].focus();
|
||||
// })
|
||||
// }
|
||||
// await delay(getRandomWaitTime())
|
||||
if (!this.page.isClosed()) {
|
||||
try {
|
||||
// remove debug flag
|
||||
@@ -980,6 +984,8 @@ class CommandorPage {
|
||||
await this.device.shell("input tap " + 530 + " " + 970)
|
||||
else if (this.device.model() === "ONEPLUS A6000")
|
||||
await this.device.shell("input tap " + 530 + " " + 1064)
|
||||
else if (this.device.model() === "KB2003")
|
||||
await this.tapForDevice(this.device, 500, 1200)
|
||||
else
|
||||
try {
|
||||
await this.tapForDevice(this.device, 500, 1120)
|
||||
@@ -994,7 +1000,7 @@ class CommandorPage {
|
||||
if (this.device.model() === "MI 5s")
|
||||
await this.device.shell("input tap " + 60 + " " + 1400)
|
||||
else
|
||||
await this.device.shell("input tap " + 455 + " " + 1920)
|
||||
await this.tapForDevice(this.device, 455, 1920)
|
||||
await delay(2000);
|
||||
await this.checkResultWithOcr();
|
||||
break;
|
||||
@@ -1109,6 +1115,7 @@ class CommandorPage {
|
||||
|
||||
async tapForDevice(device, x, y) {
|
||||
let cmd = `adb -s ${device.serial()} shell input tap ${x} ${y}`
|
||||
logWithDevice("cmd is " + cmd, this.device)
|
||||
await exec(cmd);
|
||||
}
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ class OCRChecker {
|
||||
await this.deleteFile(screenShot)
|
||||
return OCRResult.BRAVE_PRIVACY_PUB
|
||||
} else {
|
||||
return OCRResult.TERMINAED``
|
||||
return OCRResult.TERMINAED
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
|
||||
Reference in New Issue
Block a user