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