fix 扫一扫
This commit is contained in:
@@ -706,7 +706,7 @@ object WeworkLoopImpl {
|
|||||||
if (imageCheck && Constant.pushImage && textType == WeworkMessageBean.TEXT_TYPE_IMAGE) {
|
if (imageCheck && Constant.pushImage && textType == WeworkMessageBean.TEXT_TYPE_IMAGE) {
|
||||||
if (Constant.enableMediaProject) {
|
if (Constant.enableMediaProject) {
|
||||||
AccessibilityUtil.performClickWithSon(relativeLayoutContent)
|
AccessibilityUtil.performClickWithSon(relativeLayoutContent)
|
||||||
AccessibilityExtraUtil.loadingPage("ShowImageController", Constant.CHANGE_PAGE_INTERVAL)
|
AccessibilityExtraUtil.loadingPage("ShowImageController", timeout = Constant.CHANGE_PAGE_INTERVAL)
|
||||||
//图片双重校验
|
//图片双重校验
|
||||||
var image = 0
|
var image = 0
|
||||||
var image2 = 0
|
var image2 = 0
|
||||||
@@ -745,7 +745,7 @@ object WeworkLoopImpl {
|
|||||||
MultiFileObserver.saveSet.clear()
|
MultiFileObserver.saveSet.clear()
|
||||||
LogUtils.v("点击图片类型")
|
LogUtils.v("点击图片类型")
|
||||||
AccessibilityUtil.performClickWithSon(relativeLayoutContent)
|
AccessibilityUtil.performClickWithSon(relativeLayoutContent)
|
||||||
AccessibilityExtraUtil.loadingPage("ShowImageController", Constant.CHANGE_PAGE_INTERVAL)
|
AccessibilityExtraUtil.loadingPage("ShowImageController", timeout = Constant.CHANGE_PAGE_INTERVAL)
|
||||||
LogUtils.v("发现图片类型 查看图片检查有无新图片产生")
|
LogUtils.v("发现图片类型 查看图片检查有无新图片产生")
|
||||||
sleep(Constant.CHANGE_PAGE_INTERVAL)
|
sleep(Constant.CHANGE_PAGE_INTERVAL)
|
||||||
if (MultiFileObserver.createSet.isNotEmpty()) {
|
if (MultiFileObserver.createSet.isNotEmpty()) {
|
||||||
|
|||||||
@@ -1707,7 +1707,7 @@ object WeworkOperationImpl {
|
|||||||
LogUtils.i("点击登录")
|
LogUtils.i("点击登录")
|
||||||
uploadCommandResult(message, ExecCallbackBean.SUCCESS, "点击登录", startTime)
|
uploadCommandResult(message, ExecCallbackBean.SUCCESS, "点击登录", startTime)
|
||||||
sleep(Constant.CHANGE_PAGE_INTERVAL * 3)
|
sleep(Constant.CHANGE_PAGE_INTERVAL * 3)
|
||||||
if (AccessibilityExtraUtil.loadingPage("WwMainActivity", timeout = 0)) {
|
if (AccessibilityExtraUtil.loadingPage("WwMainActivity", "JsWebActivity", timeout = 0)) {
|
||||||
AccessibilityUtil.findTextAndClick(getRoot(), "继续登录", exact = true)
|
AccessibilityUtil.findTextAndClick(getRoot(), "继续登录", exact = true)
|
||||||
sleep(Constant.CHANGE_PAGE_INTERVAL * 3)
|
sleep(Constant.CHANGE_PAGE_INTERVAL * 3)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,25 +17,25 @@ object AccessibilityExtraUtil {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 等待进入页面
|
* 等待进入页面
|
||||||
* @param clazz 页面Class
|
* @param clazzList 页面Class
|
||||||
* @param timeout 检查超时时间
|
* @param timeout 检查超时时间
|
||||||
*/
|
*/
|
||||||
fun loadingPage(
|
fun loadingPage(
|
||||||
clazz: String,
|
vararg clazzList: String,
|
||||||
timeout: Long = 5000
|
timeout: Long = 5000
|
||||||
): Boolean {
|
): Boolean {
|
||||||
val service = WeworkController.weworkService
|
val service = WeworkController.weworkService
|
||||||
val startTime = System.currentTimeMillis()
|
val startTime = System.currentTimeMillis()
|
||||||
var currentTime = startTime
|
var currentTime = startTime
|
||||||
while (currentTime - startTime <= timeout) {
|
while (currentTime - startTime <= timeout) {
|
||||||
if (service.currentClass == clazz || service.currentClass.split(".").last() == clazz) {
|
if (service.currentClass in clazzList || service.currentClass.split(".").last() in clazzList) {
|
||||||
Log.v(tag, "loadingPage: $clazz")
|
Log.v(tag, "loadingPage: $clazzList")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
sleep(SHORT_INTERVAL)
|
sleep(SHORT_INTERVAL)
|
||||||
currentTime = System.currentTimeMillis()
|
currentTime = System.currentTimeMillis()
|
||||||
}
|
}
|
||||||
Log.e(tag, "loadingPage: not found: $clazz current: ${service.currentClass}")
|
Log.e(tag, "loadingPage: not found: $clazzList current: ${service.currentClass}")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user