From df2c44d199e7fa50144e0f0195bc15016ddb73ca Mon Sep 17 00:00:00 2001 From: huanghaohao <759903577@qq.com> Date: Thu, 19 Nov 2026 13:39:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:R6=20=E6=89=8B=E5=8A=BF=E7=BF=BB=E9=A1=B5?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E9=97=AD=E7=8E=AF+=E8=AF=8A=E6=96=AD?= =?UTF-8?q?=E5=AE=9E=E9=94=A4=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit swipePanelRowForward 重写: - 手势横滑+翻页验证(树 text 集出现新按钮=成功),未翻页重试一次 - 原生滚动降为已知不可信兜底(performAction=true 但滚错容器) - R6 实锤:派发=true 页面变化=false 两次——抖音面板静默吞掉 无障碍通道手势事件(shell input 同参成功,防自动化为刻意设计) - 四条翻页路全堵死:手势吞掉/原生滚动错容器/无离屏节点预渲染/ 「更多」是 DOU+ 付费页入口(已列入红线) 验证:369 项 JVM 全过;APK 装机 13:23:41 Co-Authored-By: Claude Code --- .../source/douyin/DouyinDevicePort.kt | 40 ++++++++++++++----- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/com/haorui/app/crossplatform/source/douyin/DouyinDevicePort.kt b/app/src/main/java/com/haorui/app/crossplatform/source/douyin/DouyinDevicePort.kt index 1f41720..c320d90 100644 --- a/app/src/main/java/com/haorui/app/crossplatform/source/douyin/DouyinDevicePort.kt +++ b/app/src/main/java/com/haorui/app/crossplatform/source/douyin/DouyinDevicePort.kt @@ -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 = + 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 {