Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持短信验证码登录 #717

Open
Him188 opened this issue Dec 16, 2020 · 15 comments
Open

支持短信验证码登录 #717

Him188 opened this issue Dec 16, 2020 · 15 comments
Labels
M 优先级: 主要 s:core 子系统: mirai-core t:feature 类型: 新特性 x:protocol 属性: 协议相关
Milestone

Comments

@Him188
Copy link
Member

Him188 commented Dec 16, 2020

Exception in thread "main" net.mamoe.mirai.network.WrongPasswordException: Error(title=禁止登录, message=为了您的帐号安全,请使用QQ一键登录(通过手机QQ授权登录)。, errorInfo=)
@Him188 Him188 added t:feature 类型: 新特性 x:protocol 属性: 协议相关 M 优先级: 主要 labels Dec 16, 2020
@Him188 Him188 added this to the 2.1.0 milestone Dec 16, 2020
@BadDeveloper2022
Copy link

最新版也出现:Recv: Error(title=禁止登录, message=为了您的帐号安全,请使用QQ一键登录(通过手机QQ授权登录)。, errorInfo=)

@BadDeveloper2022
Copy link

@Him188 这个能不手机上显示验证?
也许第一次验证后后面不会出现吧

@Him188
Copy link
Member Author

Him188 commented Dec 19, 2020

这个issue就是要支持这种验证方式,有待研究

@ghost
Copy link

ghost commented Dec 19, 2020

这个issue就是要支持这种验证方式,有待研究

他的修复了 fix protocol

@anaivebird
Copy link

anaivebird commented Dec 19, 2020

@Him188 参照MiraiGo修复一下吧,现在大家用2.0-M1都没法登陆https://github.com/Mrs4s/MiraiGo/commit/3a65d05f33782f6e6d3d00234f44ffd7660bea64

image

Karlatemp added a commit that referenced this issue Dec 19, 2020
Thanks Mrs4s/MiraiGo

fix #737
Maybe fix:#717
@zeylei
Copy link

zeylei commented Dec 20, 2020

确实,我也没法登录,所有的都不行,完全不能用。

@anaivebird
Copy link

anaivebird commented Dec 20, 2020

确实,我也没法登录,所有的都不行,完全不能用。

已经修了,commit在这里,只不过要下个版本才有jar包吧

@Him188
Copy link
Member Author

Him188 commented Dec 20, 2020

确实,我也没法登录,所有的都不行,完全不能用。

已经修了,https://github.com/mamoe/mirai/commit/3252221308d5544a9b64eb23cb3d8fc4aefd03a3,只不过要下个版本才有jar包吧

看tag,已经在 2.0-M1-1 包含

@zeylei
Copy link

zeylei commented Dec 20, 2020

还是不行,现在虽然支持滑块验证了,但是验证完之后还是会失败:
Error(title=禁止登录, message=当前上网环境异常,请更换网络环境或在常用设备上登录或稍后再试。, errorInfo=)

@zeylei
Copy link

zeylei commented Dec 20, 2020

简单来说,如果是:1、新用户,第一次验证需要生成新的device.json。2、老用户不小心丢失了device.json,需要重新认证。都是完全无法使用mirai的。而一个老用户如果已经有device.json了,那么他就没有这样的问题。目前可能大多数的测试和开发都是基于一个老用户的使用场景的,因此可能就无法发现这个问题。建议在测试的时候,可以更多的对“新用户使用”的场景进行测试。

@sandtechnology
Copy link
Collaborator

简单来说,如果是:1、新用户,第一次验证需要生成新的device.json。2、老用户不小心丢失了device.json,需要重新认证。都是完全无法使用mirai的。而一个老用户如果已经有device.json了,那么他就没有这样的问题。目前可能大多数的测试和开发都是基于一个老用户的使用场景的,因此可能就无法发现这个问题。建议在测试的时候,可以更多的对“新用户使用”的场景进行测试。

1.主要问题是大多数用户不会考虑网络环境(即登录地不在常用登录地)的情况,从而遭遇网络环境异常错误,而应对这种情况的唯一办法就是挂电脑QQ几天后再尝试。
2.device.json对应了你的设备信息,从QQ风控的逻辑来看,当设备变化而在常用登录地下会允许登录,反之亦然,并不存在”老用户不小心丢失了device.json,需要重新认证。都是完全无法使用mirai的“的问题。
3.如果两者(常用设备、常用登录地)都无,那请参考1的解决方案。
4.由于使用环境千奇百怪,新用户遇见的验证是不可知的,只能通过提交issue的方式让开发者得知,请谅解。

@BlackcatWatcher
Copy link

问题:2.0-M1出现同样提示,在用2.0-M1-1后,没有了“使用QQ一键登录”的提示,但出现网络错误。
关键点:1.服务器在异地,但挂了两周的PC QQ。2.几天前曾被风控(1.3.3版),PC和手机都能登上号,就mirai被封登录,但登录其他号可以上,提示版本过旧。(换过device信息也一样)。
以下是控制台输出:

2020-12-21 00:41:49 I/Bot.xxxxxxxxx: Logging in...
2020-12-21 00:42:05 W/Bot.xxxxxxxxx: kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 5000 ms
kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 5000 ms
        at kotlinx.coroutines.TimeoutKt.TimeoutCancellationException(Timeout.kt:186)
        at kotlinx.coroutines.TimeoutCoroutine.run(Timeout.kt:156)
        at kotlinx.coroutines.EventLoopImplBase$DelayedRunnableTask.run(EventLoop.common.kt:497)
        at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
        at kotlinx.coroutines.DefaultExecutor.run(DefaultExecutor.kt:69)
        at java.base/java.lang.Thread.run(Thread.java:832)

2020-12-21 00:42:05 I/Bot.xxxxxxxxx: Connection lost, retrying login
2020-12-21 00:42:20 W/Bot.xxxxxxxxx: kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 5000 ms
kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 5000 ms
        at kotlinx.coroutines.TimeoutKt.TimeoutCancellationException(Timeout.kt:186)
        at kotlinx.coroutines.TimeoutCoroutine.run(Timeout.kt:156)
        at kotlinx.coroutines.EventLoopImplBase$DelayedRunnableTask.run(EventLoop.common.kt:497)
        at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
        at kotlinx.coroutines.DefaultExecutor.run(DefaultExecutor.kt:69)
        at java.base/java.lang.Thread.run(Thread.java:832)

2020-12-21 00:42:20 W/Bot.xxxxxxxxx: kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 5000 ms
kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 5000 ms
        at kotlinx.coroutines.TimeoutKt.TimeoutCancellationException(Timeout.kt:186)
        at kotlinx.coroutines.TimeoutCoroutine.run(Timeout.kt:156)
        at kotlinx.coroutines.EventLoopImplBase$DelayedRunnableTask.run(EventLoop.common.kt:497)
        at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
        at kotlinx.coroutines.DefaultExecutor.run(DefaultExecutor.kt:69)
        at java.base/java.lang.Thread.run(Thread.java:832)

2020-12-21 00:42:20 W/Bot.xxxxxxxxx: java.lang.IllegalStateException: network channel is closed
java.lang.IllegalStateException: network channel is closed
        at net.mamoe.mirai.internal.network.QQAndroidBotNetworkHandler.sendAndExpect(QQAndroidBotNetworkHandler.kt:632)
        at net.mamoe.mirai.internal.network.QQAndroidBotNetworkHandler.sendAndExpect$default(QQAndroidBotNetworkHandler.kt:626)
        at net.mamoe.mirai.internal.network.QQAndroidBotNetworkHandler.closeEverythingAndRelogin(QQAndroidBotNetworkHandler.kt:155)
        at net.mamoe.mirai.internal.network.QQAndroidBotNetworkHandler$closeEverythingAndRelogin$1.invokeSuspend(QQAndroidBotNetworkHandler.kt)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

2020-12-21 00:42:20 W/Bot.xxxxxxxxx: java.lang.IllegalStateException: network channel is closed
java.lang.IllegalStateException: network channel is closed
        at net.mamoe.mirai.internal.network.QQAndroidBotNetworkHandler.sendAndExpect(QQAndroidBotNetworkHandler.kt:632)
        at net.mamoe.mirai.internal.network.QQAndroidBotNetworkHandler.sendAndExpect$default(QQAndroidBotNetworkHandler.kt:626)
        at net.mamoe.mirai.internal.network.QQAndroidBotNetworkHandler.closeEverythingAndRelogin(QQAndroidBotNetworkHandler.kt:155)
        at net.mamoe.mirai.internal.network.QQAndroidBotNetworkHandler$closeEverythingAndRelogin$1.invokeSuspend(QQAndroidBotNetworkHandler.kt)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

@Him188 Him188 modified the milestones: 2.1.0, 2.2.0 Jan 12, 2021
@Him188 Him188 changed the title 支持手机 QQ 一键登录 支持短信验证码登录 Jan 26, 2021
@Him188 Him188 modified the milestones: 2.2.0, Backlog Jan 26, 2021
@Him188
Copy link
Member Author

Him188 commented Jan 26, 2021

短信验证应该也需要处理滑动验证码, 现阶段要支持免密登录 #119 更划算

@AdoptOSS
Copy link
Contributor

AdoptOSS commented May 3, 2021

似乎可以参考 takayama-lily/oicq@7b56771

@Him188 Him188 added the s:core 子系统: mirai-core label Jan 4, 2022
@Him188 Him188 modified the milestones: Backlog, 2.14 Jun 30, 2022
Him188 added a commit that referenced this issue Aug 26, 2022
- close #2190, helps #717
- deprecate `LoginSolver.onSolveUnsafeDeviceLoginVerify`, add `.onSolveDeviceVerification`
Him188 added a commit that referenced this issue Aug 26, 2022
- close #2190, helps #717
- deprecate `LoginSolver.onSolveUnsafeDeviceLoginVerify`, add `.onSolveDeviceVerification`
@Him188
Copy link
Member Author

Him188 commented Aug 26, 2022

#2216 支持用短信验证码解决设备锁, 这个 issue 用于记录不使用密码而直接使用短信登录

Him188 added a commit that referenced this issue Aug 26, 2022
- close #2190, helps #717
- deprecate `LoginSolver.onSolveUnsafeDeviceLoginVerify`, add `.onSolveDeviceVerification`
Him188 added a commit that referenced this issue Sep 11, 2022
- close #2190, helps #717
- deprecate `LoginSolver.onSolveUnsafeDeviceLoginVerify`, add `.onSolveDeviceVerification`
Him188 added a commit that referenced this issue Sep 11, 2022
- close #2190, helps #717
- deprecate `LoginSolver.onSolveUnsafeDeviceLoginVerify`, add `.onSolveDeviceVerification`
@Him188 Him188 modified the milestones: 2.14, 2.14.0-RC Sep 23, 2022
@Him188 Him188 modified the milestones: 2.14.0-RC, 2.15 Dec 16, 2022
@Him188 Him188 modified the milestones: 2.15, 2.15.0-RC Jan 18, 2023
@Him188 Him188 modified the milestones: 2.15.0-RC, Backlog Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M 优先级: 主要 s:core 子系统: mirai-core t:feature 类型: 新特性 x:protocol 属性: 协议相关
Projects
None yet
Development

No branches or pull requests

7 participants