Repository navigation
Conversation
Co-authored-by: MirrorChyanDesu <277286474+MirrorChyanDesu@users.noreply.github.com>
* feat(update): 接国内源 Mirror 酱,更新设置分「国内源 / 海外源」 对方 PR #137 加了上传 workflow(RID MAA-PRTS、os=win、arch=x64),这次是 客户端这半:新增 core/mirror.py,appupdate 改成双源。 设置 → 版本更新 → 下载源三选一: - 自动(默认)先问国内源,没更新或连不上再走 GitHub; - 国内源(Mirror 酱,可填 CDK 加速); - 海外源(只走 GitHub,老行为不变)。 按官方文档踩准的几条(写错就出事): 1) 不填 CDK 也能查版本。响应里 version_name 一定有,url 只在 CDK 有效时 才给——所以不能拿「有没有 url」判断有没有新版本。 2) 两个源取更新的那个。上传是发版后 workflow_dispatch 异步触发的,某次 CI 挂了那边就停在旧版本,只信它会静默漏更新。 3) 校验值按源分组(_download_plan)。对面会重新打容器,Mirror 的 zip 和 GitHub 的不是同一份字节,混用哈希会稳定报 sha256 不匹配。 4) 加速链接不落盘(_persistable 剥 urls)。url 带时效,隔天点下载必过期; download() 发现「源是 mirror 但没有 urls」会强制重查一次。 CDK 等同密码:DPAPI 加密存 config/mirror.key,settings.json 里一个字都不留, 接口只回掩码(········1234),报错只拼中文提示、不带 cdk 参数和完整 URL。 一期只走全量包(current_version 传空):install.ps1 现在对 _internal 用 robocopy /MIR,增量包用它会把没变的几千个文件全删了;26 MB 在加速链路上 是几秒的事,增量等包明显变大再做(参数已留好)。 平台参数按资源实际配置写死 os=win / arch=x64——文档里的 windows/amd64 会拿 8002/8003。 冒烟 B75(默认值/错误码/按源校验/时效链接不落盘/CDK 不泄露/接线), 全部 78 项通过。真机验证:无 CDK 查到 v2.7.0 + release_note;假 CDK 返回 7002 并翻成「CDK 不对,请检查后重新填写」。 * fix(update): 国内源没更新时也带回到期时间 + 文档/CDK 说明 设置页只有在恰好有新版本那次才能看到 CDK 有效期,用户判断不了该不该续费。 status() 走 GitHub 兜底分支时把 mirror.check 拿到的 expiredAt 写进 cdkExpiredAt;B75 第 10 段钉住(无更新 + CDK 有效 → cdkExpiredAt 非空)。 --------- Co-authored-by: HuiParu <171644868+HuiParu@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
更新内容
core/mirror.py,两个源各自校验(两份包不是同一份字节),带时效的加速链接不落盘校验
见 Release 正文自动生成的 SHA256。