{"id":15641267,"url":"https://github.com/cssxsh/fix-protocol-version","last_synced_at":"2025-04-15T06:54:25.737Z","repository":{"id":139862478,"uuid":"610435302","full_name":"cssxsh/fix-protocol-version","owner":"cssxsh","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-08T15:34:15.000Z","size":401,"stargazers_count":112,"open_issues_count":1,"forks_count":25,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T06:54:18.744Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cssxsh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-06T19:13:13.000Z","updated_at":"2025-04-08T08:02:08.000Z","dependencies_parsed_at":"2024-03-08T16:50:20.911Z","dependency_job_id":null,"html_url":"https://github.com/cssxsh/fix-protocol-version","commit_stats":null,"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssxsh%2Ffix-protocol-version","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssxsh%2Ffix-protocol-version/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssxsh%2Ffix-protocol-version/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssxsh%2Ffix-protocol-version/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cssxsh","download_url":"https://codeload.github.com/cssxsh/fix-protocol-version/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249023710,"owners_count":21199958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T11:42:03.027Z","updated_at":"2025-04-15T06:54:25.721Z","avatar_url":"https://github.com/cssxsh.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 临时性协议修复插件\n\n[![Downloads](https://img.shields.io/github/downloads/cssxsh/fix-protocol-version/total)](https://github.com/cssxsh/fix-protocol-version/releases)\n\n目前对于 `code=45` 的处理：\n\n在 `1.7.0+` 中加入了 [TLV544Provider](src/main/kotlin/xyz/cssxsh/mirai/tool/TLV544Provider.kt), 但实际效果有限\n\n在 `1.9.0+` 中加入了 [KFCFactory](src/main/kotlin/xyz/cssxsh/mirai/tool/KFCFactory.kt), 以对接[第三方签名服务](https://mirai.mamoe.net/topic/2373)\n\n本插件不内置签名服务，你需要修改配置，根据版本指定**第三方签名服务**  \n\n目前已知的签名服务已经全部跑路，本插件项目停止维护  \n本项目不提供任何代替方案，请自行解决  \n请勿在 Issues 和 Discussions 宣泄情绪  \n\n在 `1.13.0+` 中正式将 JDK 版本提升至 11\n\n## 第三方签名服务\n\n\u003e KFCFactory  \n\u003e ↓  \n\u003e ANDROID_PHONE / ANDROID_PAD  \n\u003e ↓  \n\u003e KFCFactory.json  \n\u003e ↓  \n\u003e UnidbgFetchQsign(fuqiuluo/unidbg-fetch-qsign) / ViVo50(kiliokuara/magic-signer-guide)  \n\nKFCFactory 会根据登录协议版本从配置文件(KFCFactory.json)获取签名服务的配置信息\n\n请确保第三方签名服务**可用**！！！  \n请确保第三方签名服务**可用**！！！  \n请确保第三方签名服务**可用**！！！\n\n目前支持的第三方签名服务有 (你需要准备至少一个可用的服务)  \n* [fuqiuluo/unidbg-fetch-qsign](https://github.com/fuqiuluo/unidbg-fetch-qsign)\n* [kiliokuara/magic-signer-guide](https://github.com/kiliokuara/magic-signer-guide)\n\n**请确认第三方签名服务 支持的协议版本 和 登录的协议版本 匹配**\n\n下面是配置文件 KFCFactory.json 示例，你可以根据实际情况调整  \n```json\n{\n    \"8.9.63\": {\n        \"base_url\": \"http://127.0.0.1:8080\",\n        \"type\": \"fuqiuluo/unidbg-fetch-qsign\",\n        \"key\": \"114514\"\n    },\n    \"8.9.58\": {\n        \"base_url\": \"http://127.0.0.1:8888\",\n        \"type\": \"kiliokuara/magic-signer-guide\",\n        \"server_identity_key\": \"vivo50\",\n        \"authorization_key\": \"kfc\"\n    }\n}\n```\n\n修改配置文件 KFCFactory.json 无需重启 Mirai\n\n## JVM 参数\n\n| property                                                | default         |               desc               | \n|:--------------------------------------------------------|:----------------|:--------------------------------:|\n| `xyz.cssxsh.mirai.tool.KFCFactory.config`               | KFCFactory.json |   KFCFactory config file path    |\n| `xyz.cssxsh.mirai.tool.ViVo50.Session.timeout`          | 60000           |   Session except timeout (ms)    |\n| `xyz.cssxsh.mirai.tool.UnidbgFetchQsign.token.interval` | 2400000         | RequestToken interval, 0 is stop |\n| `xyz.cssxsh.mirai.tool.FixProtocolVersion.source`       | RomiChan        |        protocol versions         |\n\n## Mirai Console 使用方法\n\n下载 `mirai2.jar` 放到 `plugins` ，重启 `Mirai Console` 即可  \n出现 `协议版本检查更新...` 就表示插件开始工作\n\n### 命令\n\n\u003e since 1.6.0\n\n*   `protocol sync \u003ctype\u003e` 在线同步协议  \n    例如 `protocol sync ANDROID_PAD`\n\n*   `protocol info` 显示当前协议信息\n\n\u003e since 1.8.0\n\n*   `protocol load` 加载本地协议文件  \n    例如 `protocol load ANDROID_PHONE`\n\n\u003e since 1.9.6\n\n*   `protocol fetch \u003ctype\u003e \u003cversion\u003e` 在线获取协议  \n    例如 `protocol fetch ANDROID_PAD 8.9.63`\n\n## Mirai Core 使用方法\n\n\u003e since 1.1.0\n\n下载 `mirai2.jar`, 然后作为 lib 引用  \n在 `1.9.0+` 中加入了 [async-http-client](https://search.maven.org/artifact/org.asynchttpclient/async-http-client/3.0.0.Beta2/jar) 作为依赖，请自行补全\n\n然后在代码中调用 `FixProtocolVersion` 的静态方法  \njava示例:\n\n```java\nimport xyz.cssxsh.mirai.tool.FixProtocolVersion;\nimport net.mamoe.mirai.utils.BotConfiguration.MiraiProtocol;\n\nimport java.io.FileNotFoundException;\nimport java.util.Map;\n\npublic class Example {\n    // 获取指定协议版本\n    public static void fetch() {\n        // 获取最新版本协议\n        FixProtocolVersion.fetch(BotConfiguration.MiraiProtocol.ANDROID_PAD, \"latest\");\n        // 获取 8.9.63 版本协议\n        FixProtocolVersion.fetch(BotConfiguration.MiraiProtocol.ANDROID_PHONE, \"8.9.63\");\n    }\n\n    // 从本地文件加载协议版本\n    public static void load() {\n        try {\n            FixProtocolVersion.load(BotConfiguration.MiraiProtocol.ANDROID_PAD);\n        } catch (FileNotFoundException ignored) {\n            FixProtocolVersion.fetch(BotConfiguration.MiraiProtocol.ANDROID_PAD, \"8.9.63\");\n        }\n    }\n\n    // 获取协议版本信息\n    public static Map\u003cBotConfiguration.MiraiProtocol, String\u003e info() {\n        return FixProtocolVersion.info();\n    }\n}\n```\n\n\u003e since 1.9.0\n\n关于 [KFCFactory](src/main/kotlin/xyz/cssxsh/mirai/tool/KFCFactory.kt), 正常来说  \n它会根据 [SPI](https://en.wikipedia.org/wiki/Service_provider_interface) 机制被自动加载  \n如果项目结构特殊，也可用使用 `KFCFactory.install()` 手动注册\n\n## 相关项目\n\n* https://github.com/RomiChan/protocol-versions 协议信息同步来源\n* https://github.com/LaoLittle/t544_enc 内置 T544 编码器\n* https://github.com/fuqiuluo/unidbg-fetch-qsign\n* https://github.com/kiliokuara/magic-signer-guide Docker 镜像, 解决各种 QQ 机器人框架的 sso sign 和 tlv 加密问题。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcssxsh%2Ffix-protocol-version","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcssxsh%2Ffix-protocol-version","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcssxsh%2Ffix-protocol-version/lists"}