dsh-miniapp-audit
IdentifiedBefore submitting a WeChat mini program, check the parts a machine can. `miniapp_privacy_scan` lists the privacy APIs that must be declared in the user-privacy guideline, gaps in `requiredPrivateInfos
dsh-miniapp-audit
微信小程序提交审核之前,先把能机器查的部分查一遍。
为什么
小程序被驳回最常见的原因不是功能不行,是隐私声明和实际调用对不上:
代码里调了 wx.getLocation,后台的「用户隐私保护指引」里没勾对应项;
或者 requiredPrivateInfos 漏了声明,真机上直接 fail。
这类问题的共同点是:代码里看得见,界面上看不见。提审前翻一遍源码不现实, 提审后被打回又得重来一轮。这个插件就是把这一步变成一条命令。
三个工具
miniapp_privacy_scan
扫隐私接口调用,逐条给文件与行号:
## 1. 历史映射命中的待核对项(4 类)
[1] 收集你的位置信息 (1 处)
pages/index/index.js:3 → wx.getLocation
[2] 收集你的手机号 (1 处)
pages/index/index.wxml:3 → open-type="getPhoneNumber"
[4] 读取你的剪切板 (1 处)
utils/clip.js:2 → wx.getClipboardData
## 2. requiredPrivateInfos 校验
待核对:发现 wx.getLocation 直接调用,app.json 未列出该项
## 3. 静默失败点 fail: () => {}(4 处)
! pages/index/index.js:6 ⚠ 需检查 ← fail: () => {}
· pages/index/index.js:16 (疑似合理静默:附近 showModal,向上 2 行)
覆盖 21 类:昵称头像、位置、地址、发票、步数、手机号、车牌、照片视频、文件、 麦克风、摄像头、蓝牙、相册、通讯录、日历、四类传感器、剪切板。
静默失败那一节是重点。 fail: () => {} 让用户在失败时看到的是「点了没反应」。
但并不是所有静默都该报——wx.showModal 用户主动取消是正常的。
判断方式是向上回溯 40 行、取缩进最小的那个调用(最外层对象字面量):
wx.showActionSheet({
success: () => { wx.showModal({ ... }) },
fail: () => {} // 属于外层 showActionSheet,不是 showModal
})
只看「最近」或只看缩进层级都会判错。
miniapp_asset_audit
## 预算(2 MB / 单个分包)
✅ 余量 843.8 KB
## 最大的 10 个
1.17 MB assets/icons/hero-banner.png
## 未见引用(2 个,1.18 MB)
1.17 MB assets/icons/hero-banner.png
原则是宁可多留,绝不误删。动态拼接的引用({{icon}}--{{tone}}.svg、'prefix' + name)
会按前缀保守保留,报告里说的是「没在源码文本里找到名字」,不是「可以删」。
miniapp_release_check
把上面两项合成一份提审前报告,外加基础配置检查:
## 自动检查
✗ tabBar 图标缺失:assets/icons/missing.png
✗ tabBar 有 6 项,微信上限是 5
✗ app.json 未设置 __usePrivacyCheck__
✗ requiredPrivateInfos 可能缺 getLocation
✗ 3 处静默失败没有错误反馈
## 工具查不到的部分
· 后台「用户隐私保护指引」是否与服务内容一致
· 「接口设置」里对应接口是否已开通
· 真机授权弹窗的实际表现
最后那一节是刻意留的。工具只负责把要核对的地方摆出来,不能替你下合规结论。
安装
dsh plugin add github:Lee2277-t/dsh-miniapp-audit
配置
maxFindings: 60
packageLimitMB: 2
立场
这是线索,不是结论。 映射表来自历史整理,规则一年改几次,可能过时。 报告里每一处都带文件与行号,就是为了让你能自己去核对。
工具不访问后台、不执行真机测试、不判断类目与资质。
许可
AGPL-3.0-only。
Comments
Loading…
Similar plugins
by lizhijie429
Privacy guard for git workflows: before git commit, git push or gh repo sync it scans the content that would enter git (local paths, user info, API keys, private keys, connection strings) and blocks a
★ 0
MIT
JavaScript
Nov 10, 2026
dsh plugin --profile web add dsh-push-privacy-guardKeeps a panel of what you must do, what you can apply for and what is worth knowing, distilled from your WeChat and QQ chat logs by one resident agent session that re-reads them on a schedule or when
★ 0
dsh plugin --profile web add dsh-chat-digestby wz1184197761
Mirrors a single Windows desktop window into a DSH side panel over a bundled local capture service, with click, drag, scroll and keyboard passthrough, and six agent tools for status, screenshot, click
★ 0
MIT
JavaScript
Nov 14, 2026
dsh plugin --profile web add @local/dsh-wremoteby zhxnix
Portable DSH plugin for native WeChat Mini Program discovery, local preview, debugging, source mapping, and sidebar inspection.
★ 0
MIT
JavaScript
Sep 22, 2026
dsh plugin --profile web add dsh-wx-previewdsh的diff审核
★ 1
MIT
JavaScript
dsh plugin --profile web add dsh-diff-reviewby xbzbing
Redacts secrets, cookies and personal data in every model request at the host process undici dispatcher and restores the placeholders in the reply, so one interception covers every provider, adapters
★ 3
↓ 843/wk
MIT
TypeScript
Nov 11, 2026
dsh plugin --profile web add dsh-privacy-gateway