fix:R6 手势翻页验证闭环+诊断实锤:

swipePanelRowForward 重写:
- 手势横滑+翻页验证(树 text 集出现新按钮=成功),未翻页重试一次
- 原生滚动降为已知不可信兜底(performAction=true 但滚错容器)
- R6 实锤:派发=true 页面变化=false 两次——抖音面板静默吞掉
  无障碍通道手势事件(shell input 同参成功,防自动化为刻意设计)
- 四条翻页路全堵死:手势吞掉/原生滚动错容器/无离屏节点预渲染/
  「更多」是 DOU+ 付费页入口(已列入红线)

验证:369 项 JVM 全过;APK 装机 13:23:41

Co-Authored-By: Claude Code <[email protected]>
This commit is contained in:
2026-11-19 13:39:15 +08:00
co-authored by Claude Code
parent 8844c9b63a
commit df2c44d199
@@ -601,11 +601,32 @@ internal class DouyinDevicePort(
}
/**
* 分享面板功能行翻页(e2e 第四轮实锤:手势横滑页码不动——微博 e35 同款坑,
* 手势易被面板误判为拖拽关闭)。首选无障碍原生滚动(面板内 y>1400 的
* isScrollable 容器 ACTION_SCROLL_FORWARD),失败退化横滑手势。
* 分享面板功能行翻页(R5/R6 实锤链):
* - 手势横滑(adb input swipe 同参)真机验证可行,GestureRunner 派发待验证;
* - 原生滚动 ACTION_SCROLL_FORWARD 返回 true 但滚错容器(好友列表),**不可信**;
* - 第二页按钮不在第一页树里(R6 取证证伪离屏预渲染)。
* 策略:手势横滑 → **翻页验证闭环**(树 text 集出现新按钮=成功);未翻页重试一次;
* 全部失败才退原生滚动(知道它不可信,仅兜底记录)。
*/
private fun swipePanelRowForward(): Boolean {
fun panelTexts(): Set<String> =
tree()?.selfAndDescendants()?.mapNotNull { it.text.takeIf { t -> t.isNotBlank() } }?.toSet() ?: emptySet()
val before = panelTexts()
for (attempt in 1..2) {
val swiped = runCatching {
kotlinx.coroutines.runBlocking { service.gestures.swipe(0.833f, 0.868f, 0.185f, 0.868f) }
}.getOrDefault(false)
Thread.sleep(1_200)
val after = panelTexts()
val changed = before.isNotEmpty() && after.isNotEmpty() && (after - before).isNotEmpty()
if (swiped && changed) {
log("面板功能行:手势翻页成功(第 $attempt 次,新增按钮=${(after - before).take(3)})")
return true
}
log("面板功能行:手势第 $attempt 次 派发=$swiped 页面变化=$changed")
}
// 兜底:原生滚动(R5 实锤滚错容器,返回值不可信,仅当最后的尝试)
val root = service.root()
if (root != null) {
var visited = 0
@@ -628,17 +649,16 @@ internal class DouyinDevicePort(
} finally {
runCatching { target.recycle() }
}
if (ok) {
log("面板功能行:原生滚动成功")
Thread.sleep(1_200)
val after = panelTexts()
if ((after - before).isNotEmpty()) {
log("面板功能行:原生滚动翻页成功")
return true
}
log("面板功能行:原生滚动 performAction=$ok 但页面未变(滚错容器实锤)")
}
}
val swiped = runCatching {
kotlinx.coroutines.runBlocking { service.gestures.swipe(0.833f, 0.868f, 0.185f, 0.868f) }
}.getOrDefault(false)
log("面板功能行:原生滚动不可用,手势横滑=$swiped")
return swiped
return false
}
override fun saveLocalFromSharePanel(): DouyinHotListCollector.SaveLocalOutcome {