image-send-false-success.md 4.87 KB

微信图片发送「假成功」现场 —— 2026-09-17 03:00 日报图实测

一句话:终端回 ok:true / status:sent、完成标记也落了,但图片没发出去;对账看日志签名才发现,重试同一脚本一次即成。

1. 首发失败(03:01:33,日志原文)

[2026-09-17T03:01:33.568  ...] [WeChatHook] SEND_IMAGE_INTERNAL proc=com.tencent.mm to=yibooo path=/sdcard/Pictures/wx_send_21822.jpg
[2026-09-17T03:01:33.687  ...] [WeChatHook] sendImageViaAPI: built o70.k+o70.h e=/sdcard/Pictures/wx_send_21822.jpg g=yibooo plugin=b80.u
[2026-09-17T03:01:33.688  ...] [WeChatHook] hookImageSend: captured b80.u=b80.u@7856bb3
[2026-09-17T03:01:33.828  ...] [WeChatHook] f9.convertTo() msgtype=3 proc=com.tencent.mm/tinker
ContentValues=isSend=1 status=1 talker=yibooo lvbuffer=[B@61596f6 type=3 msgId=38898 bizChatId=-1 content=<msg></msg> createTime=1789585291974 imgPath=THUMBNAIL_DIRPATH://th_0450386e8f00d635b4d8db90c5aaeec0
[2026-09-17T03:01:33.930  ...] [WeChatHook] SEND_IMAGE_INTERNAL failed: JdLL.OopPhjYz.cafeU.No.XposedHelpers$InvocationTargetError: java.lang.NumberFormatException: For input string: "wx_send_21822.jpg"
    at com.example.wechathook.WeChatHook.sendImageViaAPI(WeChatHook.java:527)
    at com.example.wechathook.WeChatHook.-$$Nest$smsendImageViaAPI(WeChatHook.java:0)
    at com.example.wechathook.WeChatHook$56.lambda$onReceive$0(WeChatHook.java:3921)
    at com.example.wechathook.WeChatHook$56$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
Caused by: java.lang.NumberFormatException: For input string: "wx_send_21822.jpg"

判读:

签名 有无
SEND_IMAGE_INTERNAL … to=yibooo path=… ✅ 广播到了 hook
sendImageViaAPI: built … ✅ 消息对象建出来了(别把这当成功)
oj() DONE to=yibooo res=size=1 ❌ 无
CDN submit DONE items=1 ❌ 无 ⇒ 图片没上 CDN ⇒ 对方收不到
isSend=1 status=1 … type=3 msgId=38898 ⚠️ 有,但是半成品(content=<msg></msg>)⇒ 不是成功证据
SEND_IMAGE_INTERNAL failed: …NumberFormatException ⚠️ 失败签名

同轮终端回显:{"ok": true, "target": "yibooo", "result": {"status": "sent", …, "verified": false, "detail": "Broadcast completed: result=0"}} 且封装脚本已把 scheduler_daily_send_tgo_20260917(done 1789585293)无条件写下来(脚本第 38-47 行不看 result)。

2. 重试成功(03:04:38,同脚本同图片)

[2026-09-17T03:04:38.308] SEND_IMAGE_INTERNAL proc=com.tencent.mm to=yibooo path=/sdcard/Pictures/wx_send_24740.jpg
[2026-09-17T03:04:38.309] sendImageViaAPI: built o70.k+o70.h e=/sdcard/Pictures/wx_send_24740.jpg g=yibooo plugin=b80.u
[2026-09-17T03:04:42.108] sendImageViaAPI: oj() DONE to=yibooo res=size=1
[2026-09-17T03:04:42.126] sendImageViaAPI: CDN submit DONE items=1 self=wxid_51ap3m6p9xs722 compress=0

⇒ 真投递(迟 ~3 分钟)。新进程 ⇒ 新暂存名(wx_send_24740.jpg)。 失败那次没上 CDN,因此重试不会让对方收到两张。

3. 已排除的成因(照抄一遍能省一轮)

假设 实测 结论
图片坏了/被截断 源 _qr_2x.jpg 2,293,039 B;暂存件字节数一致;JPEG SOI/EOI 均 OK 排除
磁盘满 /sdcard 余 363 G 排除
WeChatHook 模块换版 pm path com.example.wechathook → base.apk mtime 2026-07-28 排除
微信升级、混淆名变了 versionName=8.0.74、lastUpdateTime=2026-07-06 排除
这条 hook 路径本来就坏 昨天(09-16 03:01)同一段日志内两条发送全绿(oj() DONE×2 + CDN submit×2),9 小时段内 NumberFormatException=0 排除 ⇒ 判暂态
暂存件 MediaStore 索引未落地 失败前 WeChat 已 f9.convertTo() 建消息,走了兜底分支(异常把文件名当 int 解析) 疑似根因(未坐实)

⚠️ 首发与成功那次的 time.sleep(1.0) 等扫描时序完全一样 ⇒ 「多等几秒」不是可靠解法; 可靠解法 = 发完必对账 + 失败重试一次。

4. 当时的排查命令(已验证可用)

# 1) 找覆盖发送时刻的段
su -c "ls -lt /data/adb/lspd/log/ | grep verbose | head -3"
# 2) 签名对账(用落盘的 .sh 跑,别把 -c/嵌套 $() 写在 terminal 里)
bash ~/.hermes/skills/wechat-send-delivery-verification/scripts/audit_recent_send.sh 30

5. 写回技能的两条规矩(2026-09-17 已落到 cron 族 skill)

  • cron-scheduler-round-verification §5.1 新增:失败签名行 + 「send_digest_group.py 标记无条件写 ⇒ 标记≠成功」+ 「03:00 发送轮必须对账才算收工」。
  • cron-scheduler §3:00 新增:发送后必跑 verify_send.sh,见失败签名立刻重跑同一脚本重试一次,再对账。
  • 后续轮次见到 scheduler_daily_send_* 标记不能据此断定「发过了」。