StageGuard 78d0b4fd54 QRCode login support & Introduce new authorization factory (#2502)
* [core] process `wtlogin.trans_emp` to support qrcode login

* [core] fix `wtlogin.trans_emp` protocol

* [core] optimize QRCodeLoginProcessor logic

* [core] fix `wtlogin.trans_emp` outgoing packet

* [core] cancel login when logging a bot which is inconsistent from bot factory

* [core] ignore `flag3` check on ANDROID_WATCH & name `flag1` and `flag2`

* [core] provide default `QRCodeLoginListener` for jvm

* [core] don't catch IllegalStateException in QRCodeLoginProcessor

* [core] Use `LoginSolver.createQRCodeLoginListener()` instead of property; Rename configuration name

* [core] Code improvement

* [core] remove qrcode state lock

* [core] ignore `flag3` when command is `wtlogin.trans_emp` in packet codec

* [core] enable qrcode login for macos

* [core] remove debug property in log

* [core] reformat code

* [core] rename `TransEmpResponse` to `Response`

* [core] assert `flag3Exception` not null first

* [core] remove arg client

* [core] update qrcode login notes

* [core] set custom qrcode size

* [core] Draft BotAuthorization

* [core] make SecretsProtection mpp

* [core] BotAuthorization.byXXX

* [core] Move QRCodeLoginListener to `.auth`

* [core] Protect data of BotAccount

* [core] Add SelectorRequireReconnectException

* [core] Implementation of BotAuthorization

* Revert changes of BotConfiguration

* api dump

* [core] remove passwordMd5 in `BotAccount`

* [mock] Add new bot factory function to mock bot factory

* Delete LoginCommandTest

* [core] Improve QRCode render

* [core] Introduce UnsupportedCaptchaMethodException & UnsupportedQRCodeCaptchaException

* api dump

* update docs

* [core] update `DebugRunHelper`

* [core] add simple block for BotAuthorization

* api dump

* Rename `canDoQRLogin` to `supportsQRLogin`, and specify argument names for MiraiProtocolInternal

* Remove `phoneNumber` parameter from BotAccount

* Make `BotAccount.<init>` with String password parameter TestOnly

* Rename `InconsistentBotException` to `InconsistentBotIdException`

* Rename `QRCodeLoginListener.onStatusChanged` to `QRCodeLoginListener.onStateChanged`

* Rename `BotAuthorizationResult` to `BotAuthResult`

* Rename BotAuthComponent, move internal APIs to internal module

* Logic fixup

* doc update

* QRCodeLoginListener.qrCodeStateUpdateInterval & onIntervalLoop

* console login with BotAuthorization

* update testing

* Update mirai-core-api/src/jvmMain/kotlin/utils/LoginSolver.jvm.kt

* Move AuthControl outside SsoProcessor

* Redesign auth

* Add initialTicket to producerCoroutine

* Revert protocol changes of MACOS

* Fix latch death locking

* Fix CoroutineOnDemandValueScope.receiveOrNull exceptional finish

* Fix exception collecting

* Fix DefaultBotAuthorizationFactory loading

* [core] qrcode login for IPAD protocol

* Revert "[core] qrcode login for IPAD protocol"

This reverts commit c1136a8798.

---------

Co-authored-by: Karlatemp <kar@kasukusakura.com>
Co-authored-by: Him188 <Him188@mamoe.net>
2023-03-18 13:52:31 +00:00
2023-02-20 23:56:20 +00:00
2023-02-06 12:24:13 +08:00
2023-03-16 17:31:27 +08:00
2022-11-29 15:27:37 +08:00
2021-10-17 18:14:32 +08:00
2021-09-01 13:55:39 +08:00
2022-11-29 15:27:37 +08:00
2022-07-20 00:30:16 +08:00
2022-07-20 00:30:16 +08:00
2020-08-20 23:50:56 +08:00
2021-12-06 14:58:45 +00:00

logo
title

Gitter MiraiForum

mirai 是一个在全平台下运行,提供 QQ Android 协议支持的高效率机器人库

这个项目的名字来源于

京都动画作品《境界的彼方》栗山未来(Kuriyama mirai)

CRYPTON初音未来为代表的创作与活动(Magical mirai)

图标以及形象由画师DazeCake绘制

mirai

English

声明

一切开发旨在学习,请勿用于非法用途

  • mirai 是完全免费且开放源代码的软件,仅供学习和娱乐用途使用
  • mirai 不会通过任何方式强制收取费用,或对使用者提出物质条件
  • mirai 由整个开源社区维护,并不是属于某个个体的作品,所有贡献者都享有其作品的著作权。

许可证

Copyright (C) 2019-2023 Mamoe Technologies and contributors.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

mirai 采用 AGPLv3 协议开源。为了整个社区的良性发展,我们强烈建议您做到以下几点:

  • 间接接触(包括但不限于使用 Http API 或 跨进程技术)到 mirai 的软件使用 AGPLv3 开源
  • 不鼓励,不支持一切商业使用

鉴于项目的特殊性,开发团队可能在任何时间停止更新删除项目

衍生软件需声明引用

  • 若引用 mirai 发布的软件包而不修改 mirai则衍生项目需在描述或应用内的任意部位提及使用 mirai。
  • 若修改 mirai 源代码再发布,或参考 mirai 内部实现发布另一个项目,则衍生项目必须在文章首部或 'mirai' 相关内容首次出现的位置明确声明来源于本仓库 (https://github.com/mamoe/mirai)。不得扭曲或隐藏免费且开源的事实。

协议支持

支持的协议列表

消息相关

  • 文字
  • 原生表情
  • 商城表情
  • 戳一戳
  • 图片 (自定义表情)
  • XMLJSON 等富文本消息
  • 长消息5000 字符 + 50 图片)
  • 引用回复
  • 合并转发
  • 撤回
  • 提及群员
  • 提及全体成员
  • 语音
  • 闪照
  • 撤回群员消息
  • 自定义消息
  • 音乐分享

群相关

  • 群列表
  • 成员列表
  • 群员权限
  • 禁言
  • 全体禁言
  • 群公告管理
  • 群设置(自动审批、入群公告、成员邀请、匿名聊天)
  • 处理入群申请
  • 移除群员
  • 群文件

好友相关

  • 好友列表
  • 处理新好友申请
  • 删除好友

其他客户端

  • 同步其他客户端的消息
  • 向其他客户端发送消息

不会支持的协议

  • 金钱相关,如点赞、收付款
  • 敏感操作,如主动添加好友、主动加入群、主动邀请好友加群
  • 安全相关,获取账号登录凭证(tokencookie等)

一切开发旨在学习,请勿用于非法用途

开始

赞助

  • 本着与更多 mirai 开发者、用户、支持者共建更好的学习环境为目的mirai 自 2021 年 3 月 1 日发起官方社区的建设。社区建设可能涉及:学习论坛插件中心(在建)等。由于社区的运维需要经费mirai 项目开启 sponsor 功能。
  • 请注意,赞助是全自愿的。赞助者不会获得特权,不赞助也可以使用全部的功能。为资金管理方便,赞助后不设退款、折现等选项。最终解释权归社区运营团队所有。
  • 全部赞助金额、流向、票据单号等将透明化公示,欢迎任何人随时查看及提出建议。

鸣谢

IntelliJ IDEA 是一个在各个方面都最大程度地提高开发人员的生产力的 IDE适用于 JVM 平台语言。

特别感谢 JetBrains 为开源项目提供免费的 IntelliJ IDEA 等 IDE 的授权

Description
高效率 QQ 机器人支持库
Readme AGPL-3.0 107 MiB
Languages
Kotlin 99.5%
Java 0.3%
HTML 0.1%