惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Project Zero
Project Zero
GbyAI
GbyAI
Y
Y Combinator Blog
Google DeepMind News
Google DeepMind News
小众软件
小众软件
The GitHub Blog
The GitHub Blog
阮一峰的网络日志
阮一峰的网络日志
J
Java Code Geeks
WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
IT之家
IT之家
F
Fortinet All Blogs
博客园 - 【当耐特】
H
Hackread – Cybersecurity News, Data Breaches, AI and More
P
Proofpoint News Feed
Schneier on Security
Schneier on Security
C
Cybersecurity and Infrastructure Security Agency CISA
L
LINUX DO - 热门话题
Spread Privacy
Spread Privacy
O
OpenAI News
V
V2EX
博客园 - 三生石上(FineUI控件)
AI
AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Stack Overflow Blog
Stack Overflow Blog
P
Privacy International News Feed
Microsoft Azure Blog
Microsoft Azure Blog
Blog — PlanetScale
Blog — PlanetScale
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Jina AI
Jina AI
H
Help Net Security
L
LINUX DO - 最新话题
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Tenable Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Cisco Talos Blog
Cisco Talos Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
博客园 - 叶小钗
V
Vulnerabilities – Threatpost
C
Cisco Blogs
D
Darknet – Hacking Tools, Hacker News & Cyber Security
酷 壳 – CoolShell
酷 壳 – CoolShell
Hacker News: Ask HN
Hacker News: Ask HN
S
Security @ Cisco Blogs
S
Securelist
T
The Blog of Author Tim Ferriss
Apple Machine Learning Research
Apple Machine Learning Research
美团技术团队
雷峰网
雷峰网
V2EX - 技术
V2EX - 技术

博客园 - AI健康

Git & GitHub 协作操作手册(三人团队) Copilot: 如何把kiro的spec转到leanSpec来 小龙虾作者peterSteinberger同时推进多少个项目?-来自copilot-edge chatGpt- 图片文件的群识别工程可落地 chatGpt-pc端监控获取微信群中照片 openclaw-zero-token worked, respect and thanks the author and contributors openclaw-zero-token仓库支持的免费模型如下: 各AI平台 Web 使用政策-from sonnet4.5 openclaw-zero-token在wsl启用备忘 trae's tools include: figma, editor,etc. and its shortcut is c-a-/ opencode答复:Atlas vs Sisyphus 的关系 Windows 下 AI IDE/CLI 规则加载实测:硬链接能解决什么,不能解决什么 github-copilot源码调研kimi-cli:没有显示它支持全局规则文件 三大GUI AI 编程助手快捷键全解析:Antigravity、Trae 与 Kiro 对比指南 mouseless(少鼠) 技术调研 调研 骨传导麦克风 具体在图书馆等安静场合,微小声音模式下语音输入-结论是暂时不可行 opencode server,web两命令, --mDNS 参数的使用场景 跟 ChatGPT 对话:运行wsl+open code资源消耗-没验证 静态为主轻交互微信小程序开发环境推荐-chatgpt推荐 AI coding大模型+工具的组合实际效用对比
sonnet4.6: 如何在windows/android上使用无障碍功能保存微信群图片
AI健康 · 2026-03-24 · via 博客园 - AI健康

以下是两条路的完整拆解,均不需要降级微信


🖥️ 路线 A:Windows — pywinauto (UIA Accessibility)

原理:通过 Python + pywinauto 库(backend='uia')连接微信进程,实现对界面元素的自动化操作,用 Windows UI Automation 监听聊天区图片元素,右键→另存为。

来源

完整脚本

# 安装依赖
# pip install pywinauto pywin32 psutil

import time, os, psutil
from pywinauto.application import Application
import uiautomation as uia  # pip install uiautomation

SAVE_DIR = r"C:\WechatGroupPics"
GROUP_NAME = "你的群名称"
os.makedirs(SAVE_DIR, exist_ok=True)

def get_wechat_pid():
    for p in psutil.process_iter(['pid','name']):
        if p.info['name'] == 'WeChat.exe':
            return p.info['pid']

def connect_wechat():
    pid = get_wechat_pid()
    app = Application(backend='uia').connect(process=pid)
    return app.window(class_name='WeChatMainWndForPC')

def open_group(win, group_name):
    # 搜索群
    win.Edit.set_text(group_name)
    time.sleep(1)
    win.ListItem.click()
    time.sleep(1)

def save_all_images(win):
    # 遍历聊天区所有图片控件
    chat_area = win.child_window(control_type='List')
    items = chat_area.children(control_type='ListItem')
    count = 0
    for item in items:
        imgs = item.descendants(control_type='Image')
        for img in imgs:
            try:
                img.right_click_input()
                time.sleep(0.3)
                # 点「另存为」
                menu = uia.MenuControl(searchDepth=2)
                for m in menu.GetChildren():
                    if '另存' in (m.Name or ''):
                        m.Click()
                        time.sleep(0.5)
                        # 自动填路径并确认
                        dlg = uia.WindowControl(Name='另存为')
                        dlg.EditControl().SetValue(
                            os.path.join(SAVE_DIR, f"img_{count}.jpg"))
                        dlg.ButtonControl(Name='保存').Click()
                        count += 1
                        time.sleep(0.3)
            except:
                pass
    print(f"共保存 {count} 张")

win = connect_wechat()
open_group(win, GROUP_NAME)
save_all_images(win)

已有的 MCP 封装(可直接接 Claude Desktop)

WinAutoWx@pmhw/WinAutoWx)是基于 Python + pywinauto 的 MCP server,支持 Windows 微信自动化操作,包括搜索好友/群、发消息,可通过 HTTP API 或 MCP 协议调用。


📱 路线 B:Android — ADB + wechat-dump(需 Root)

原理:微信在 Android 上把图片存在 /data/data/com.tencent.mm/MicroMsg/${userid}/image2/,通过 ADB 直接拉取。

来源ppwwyyxx/wechat-dumphttps://github.com/ppwwyyxx/wechat-dump
该工具最后验证时间为 2025/01/01,需要 ADB + Root 的 Android 设备,拉取 /data/data/com.tencent.mm/MicroMsg/${userid}/image2 目录即可获得所有图片资源。

# Windows PowerShell 执行
# 1. 确认设备已 root 并连接
adb devices

# 2. 拉取整个 image2 目录(替换 ${userid} 为你的32位hex用户ID)
adb pull /data/data/com.tencent.mm/MicroMsg/${userid}/image2 C:\WechatGroupPics

# 3. 图片是 .dat 加密格式,用 wechat-dump 解码
git clone https://github.com/ppwwyyxx/wechat-dump
cd wechat-dump
pip install -r requirements.txt
python ./android-interact.sh db

📱 路线 C:Android — UIAutomator(不需要 Root

原理:通过 adb shell uiautomator 模拟用户点击,遍历群聊图片并长按→保存。

# 推滚动群聊,长按图片,点保存到相册
adb shell uiautomator runtest /path/to/SaveImages.jar -c com.example.SaveImages

或用 Python 的 uiautomator2(更简单):

pip install uiautomator2
python -m uiautomator2 init   # 首次在设备上安装 agent
import uiautomator2 as u2, time

d = u2.connect()  # 连接手机

# 打开群聊(假设已在群聊界面)
# 向上滚动找图片并保存
while True:
    imgs = d(resourceId="com.tencent.mm:id/b4o")  # 图片控件ID(需用 uiautomator2 inspector 确认)
    for img in imgs:
        img.long_click()
        time.sleep(0.5)
        d(text="保存").click()
        time.sleep(0.3)
    d.swipe_ext("up", scale=0.8)  # 继续上滑加载更多
    time.sleep(1)

方案对比

方案 是否需要降级 是否需要Root 稳定性
Windows pywinauto (UIA) ❌ 不需要 中(UI变化会失效)
Android wechat-dump + ADB ❌ 不需要 ✅ 需要
Android uiautomator2 ❌ 不需要 ❌ 不需要

最推荐:Windows 用 pywinauto,Android 无 root 用 uiautomator2。