Skip to content

微信 4.1.8.52 数据库无法打开 openAccount code=-3 #688

@xxxzdsg

Description

@xxxzdsg

正文:

Bug: 微信 4.1.8.52 数据库无法打开,openAccount code=-3 (file is not a database)

环境信息

┌───────────────┬────────────────────────────────────────────────┐
│ 项目 │ 详情 │
├───────────────┼────────────────────────────────────────────────┤
│ WeFlow 版本 │ nightly-dev (build 26.4.9, 4月8日构建) │
├───────────────┼────────────────────────────────────────────────┤
│ WeFlow 稳定版 │ 4.2.1 (同样报错 -101) │
├───────────────┼────────────────────────────────────────────────┤
│ 微信版本 │ 4.1.8.52 │
├───────────────┼────────────────────────────────────────────────┤
│ 操作系统 │ Windows 10 Home China 10.0.19045 │
├───────────────┼────────────────────────────────────────────────┤
│ 微信安装路径 │ C:\Users\17660\AppData\Roaming\Tencent\xwechat │
├───────────────┼────────────────────────────────────────────────┤
│ 微信数据路径 │ D:\software\wechat\xwechat_files │
└───────────────┴────────────────────────────────────────────────┘

问题描述

4月8日使用 WeFlow 4.2.1 稳定版第一次成功打开数据库并读取了聊天记录(两个微信账号均成功)。

4月9日起,无论是稳定版还是开发版(nightly-dev build 26.4.9),均无法打开数据库:

  • 稳定版 4.2.1: 报错 InitProtection rc=-101,程序卡死在初始化阶段
  • 开发版 nightly-dev: InitProtection 通过,但打开数据库时报 openAccount code=-3

复现步骤

  1. 安装 WeFlow nightly-dev (build 26.4.9)
  2. 完全退出微信(包括托盘图标)
  3. 启动 WeFlow,选择微信数据目录 D:\software\wechat\xwechat_files
  4. 选择微信账号 wxid_n9qu947dtz9q22_bca0
  5. 连接测试 → 报错 code=-3

错误日志

[2026-04-10 00:58:05.945] wcdb_init [SecurityStatus:0]
Monitor: Starting file watch on
D:\software\wechat\xwechat_files\wxid_n9qu947dtz9q22_bca0\db_storage\session\session.db
open_account fail try ps4096 err=file is not a database code=26
open_account fail try ps1024 err=file is not a database code=26
open_account fail: cannot open db
D:\software\wechat\xwechat_files\wxid_n9qu947dtz9q22_bca0\db_storage\session\session.db

反复重试多次,均报 file is not a database (code=26),最终 openAccount code=-3。

补充信息

  • session.db 文件大小为 180KB
  • 文件头为 8718 a9f5(完全加密状态,非标准 SQLite 头)
  • 4月8日使用同一数据库路径、同一 WeFlow 版本时可以正常打开
  • 推测微信 4月8日之后自动更新(从旧版本升级到 4.1.8.52),数据库加密方式发生了变化

期望

希望尽快适配微信 4.1.8.52 的数据库加密方式,谢谢!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions