whitechi73 / OpenShamrock

A Bot Framework based on Lsposed with OneBot11
https://whitechi73.github.io/OpenShamrock
GNU General Public License v3.0
1.39k stars 178 forks source link

bug: 在 QQ 版本 9.0.70+ 下发送消息会导致 QQ 闪退 #334

Open SilianZ opened 3 weeks ago

SilianZ commented 3 weeks ago

警告: 在进一步操作之前,请检查下列选项。如果您忽视此模板或者没有提供关键信息,您的 Issue 将直接被关闭。

描述 Bug

通过支持 Onebot 协议的机器人向 OpenShamrock 发送纯文本消息请求时,消息不但发不出去,还会导致 QQ 的崩溃。

复现 Bug

日志:

[23:58:37] DEBUG 加载SO文件成功 -> /data/user/0/com.tencent.mobileqq/files/SM_LIBS/shamrock
[23:58:37] DEBUG registerHandler[100351266](cmd = init, seq = 2)
[23:58:38] DEBUG 加载SO文件成功 -> /data/user/0/com.tencent.mobileqq/files/SM_LIBS/shamrock
[23:58:38] INFO QIMEI获取: 7cb77f28cc7db118a414947a10001ab17c08
[23:58:38] WARN 未配置Token,将不进行鉴权。
[23:58:39] WARN 尝试连接WebSocketClient(url = ws://192.168.3.33:25565/ws/)
[23:58:39] INFO Start HTTP Server: http://0.0.0.0:5700/
[23:58:39] INFO WebSocketClient onOpen: 101, 
[23:58:39] WARN WebSocketClientService: 初始化服务
[23:58:41] DEBUG NTKernel try to init service: com.tencent.qqnt.kernel.api.impl.KernelServiceImpl@5e5017c
[23:58:41] INFO MSF Packet Receiver running!
[23:58:41] INFO Fetch kernel service successfully: 0,297127631,true
[23:58:41] INFO Register MSG listener successfully.
[23:58:44] DEBUG NTKernel同步消息开始
[23:58:44] DEBUG NTKernel try to init service: com.tencent.qqnt.kernel.api.impl.KernelServiceImpl@5e5017c
[23:58:45] DEBUG 反后台模式注入成功!
[23:58:45] DEBUG NTKernel同步消息完成
[23:58:46] DEBUG 阻止进入后台模式!
[23:58:54] DEBUG WebSocketClient心跳: 3806635891
[23:59:09] DEBUG WebSocketClient心跳: 3806635891
[23:59:24] DEBUG WebSocketClient心跳: 3806635891
[23:59:31] INFO 群消息(group = ***(***), uin = 1984841068, id = 533426848, seq = 3108, msg = ~say hi)
[23:59:36] DEBUG 加载SO文件成功 -> /data/user/0/com.tencent.mobileqq/files/SM_LIBS/shamrock
[23:59:36] DEBUG registerHandler[100351266](cmd = init, seq = 2)
[23:59:37] DEBUG 加载SO文件成功 -> /data/user/0/com.tencent.mobileqq/files/SM_LIBS/shamrock
[23:59:37] INFO QIMEI获取: 7cb77f28cc7db118a414947a10001ab17c08
[23:59:37] WARN 未配置Token,将不进行鉴权。
[23:59:39] INFO Start HTTP Server: http://0.0.0.0:5700/
[23:59:39] WARN 尝试连接WebSocketClient(url = ws://192.168.3.33:25565/ws/)
[23:59:39] INFO WebSocketClient onOpen: 101, 
[23:59:39] WARN WebSocketClientService: 初始化服务
[23:59:41] DEBUG NTKernel try to init service: com.tencent.qqnt.kernel.api.impl.KernelServiceImpl@3482f66
[23:59:41] INFO MSF Packet Receiver running!
[23:59:41] INFO Fetch kernel service successfully: 0,99412109,true
[23:59:41] INFO Register MSG listener successfully.
[23:59:43] DEBUG 阻止进入后台模式!
[23:59:43] DEBUG 反后台模式注入成功!
[23:59:43] DEBUG NTKernel同步消息开始
[23:59:44] DEBUG NTKernel同步消息完成
[23:59:44] DEBUG NTKernel try to init service: com.tencent.qqnt.kernel.api.impl.KernelServiceImpl@3482f66
[23:59:44] WARN java.lang.IllegalStateException: 不支持的消息来源类型 | generateMsgIdHash: 103
    at moe.fuqiuluo.shamrock.helper.MessageHelper.generateMsgIdHash(MessageHelper.kt:351)
    at moe.fuqiuluo.shamrock.remote.service.listener.AioListener.handleMsg(AioListener.kt:43)
    at moe.fuqiuluo.shamrock.remote.service.listener.AioListener.access$handleMsg(AioListener.kt:27)
    at moe.fuqiuluo.shamrock.remote.service.listener.AioListener$onRecvMsg$1.invokeSuspend(AioListener.kt:33)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)

[23:59:45] DEBUG 阻止进入后台模式!
[23:59:54] DEBUG WebSocketClient心跳: 3806635891
[00:00:01] WARN 消息element转换错误:java.lang.NoSuchMethodError: No virtual method getGrayTipElement()Lcom/tencent/qqnt/kernel/nativeinterface/GrayTipElement; in class Lcom/tencent/qqnt/kernel/nativeinterface/MsgElement; or its super classes (declaration of 'com.tencent.qqnt.kernel.nativeinterface.MsgElement' appears in /data/app/~~jPPVeMBUfMyyvcl5gSrRZg==/com.tencent.mobileqq-9ycN0CUi2kg9vbChd4qsfg==/base.apk), elementType: 8
[00:00:08] WARN 消息element转换错误:java.lang.NoSuchMethodError: No virtual method getGrayTipElement()Lcom/tencent/qqnt/kernel/nativeinterface/GrayTipElement; in class Lcom/tencent/qqnt/kernel/nativeinterface/MsgElement; or its super classes (declaration of 'com.tencent.qqnt.kernel.nativeinterface.MsgElement' appears in /data/app/~~jPPVeMBUfMyyvcl5gSrRZg==/com.tencent.mobileqq-9ycN0CUi2kg9vbChd4qsfg==/base.apk), elementType: 8
[00:00:09] DEBUG WebSocketClient心跳: 3806635891
[00:00:16] INFO Update message info from 3105 to 3105
[00:00:24] DEBUG WebSocketClient心跳: 3806635891

这个日志看起来好像不能很清晰地反映出问题所在,但是可以知道的是,在发送了纯文本信息请求之后,在 MuMu 模拟器中打开的 QQ 界面突然关闭,并且 OpenShamrock 的框架显示为未激活状态。

发送的纯文本消息类似于这样:

image

图中的消息能被正常发出的原因是它使用了 go-cqhttp。机器人在接收到指令之后,先会发出一个“戳一戳”请求,然后再发送指令对应的回复。

然而在我使用同样的机器人对接我当前正在使用的 OpenShamrock 时,机器人能成功发出“戳一戳”,然而在发出文本信息的时候就发送失败然后闪退了。

系统信息

fuqiuluo commented 3 weeks ago

QQ版本太高了,你没发现shamrock已经很久没更新了吗

SilianZ commented 3 weeks ago

QQ版本太高了,你没发现shamrock已经很久没更新了吗

你说的对,但我由于 QQ 版本升太高了,降不下去了。

ikechan8370 commented 3 weeks ago

试下1.0.9的最新构建

RealityError commented 3 weeks ago

试下1.0.9的最新构建

不行,仍然会报错

ikechan8370 commented 3 weeks ago

试下1.0.9的最新构建

不行,仍然会报错

是什么问题?日志有吗?如果问题不一样的话另开issue吧。

fuqiuluo commented 3 weeks ago

v1.1.0版本修复该问题,等待 @ikechan8370 在onebot分支修复

MTFFengHuang commented 2 weeks ago

降级可以先用Google Play版本的,登入后升级到更高版本号(目前我用的是[v9.0.15]) https://www.wandoujia.com/apps/566489/history_v5626 这里可以下载到

SilianZ commented 2 weeks ago

降级可以先用Google Play版本的,登入后升级到更高版本号(目前我用的是[v9.0.15]) https://www.wandoujia.com/apps/566489/history_v5626 这里可以下载到

我所指的降级降不下去是因为在使用过高版本的 QQ(9.0.71)后再使用低版本的 QQ(9.0.15)将会被禁止登录,显示“当前 QQ 版本过低”。

YuYue-Amatsuki commented 1 week ago

同遇到此问题 qq版本号为9.0.8也能触发该bug,升级qq至9.0.65也这样 升级至shamrock最新构建(1.0.9_65ddca2)才这样,此前不会出现该问题

SilianZ commented 1 week ago

更新到 v1.0.9 最新构建版本后,QQ 能正常发送消息,但是却出现了如 #337 一样的问题。这个问题影响着机器人的正常使用,希望能尽快修复。

SilianZ commented 1 week ago

感谢 QQ 9 带来了如此多的麻烦。

fuqiuluo commented 1 week ago

Try https://github.com/whitechi73/OpenShamrock/actions/runs/9957450140

SilianZ commented 1 week ago

Try https://github.com/whitechi73/OpenShamrock/actions/runs/9957450140

接口 /get_group_member_info 还是会调用超时。

luyanci commented 1 week ago

337 依旧存在

fuqiuluo commented 1 week ago
[00:00:01] WARN 消息element转换错误:java.lang.NoSuchMethodError: No virtual method getGrayTipElement()Lcom/tencent/qqnt/kernel/nativeinterface/GrayTipElement; in class Lcom/tencent/qqnt/kernel/nativeinterface/MsgElement; or its super classes (declaration of 'com.tencent.qqnt.kernel.nativeinterface.MsgElement' appears in /data/app/~~jPPVeMBUfMyyvcl5gSrRZg==/com.tencent.mobileqq-9ycN0CUi2kg9vbChd4qsfg==/base.apk), elementType: 8
[00:00:08] WARN 消息element转换错误:java.lang.NoSuchMethodError: No virtual method getGrayTipElement()Lcom/tencent/qqnt/kernel/nativeinterface/GrayTipElement; in class Lcom/tencent/qqnt/kernel/nativeinterface/MsgElement; or its super classes (declaration of 'com.tencent.qqnt.kernel.nativeinterface.MsgElement' appears in /data/app/~~jPPVeMBUfMyyvcl5gSrRZg==/com.tencent.mobileqq-9ycN0CUi2kg9vbChd4qsfg==/base.apk), elementType: 8

这个错误已经尝试修复了

rhwong commented 1 week ago

使用Shamrock-v1.1.1.onebot.r438.36ed55d-arm64 设备小米Mix2真机环境面具+LSPosed QQ版本9.0.71触发指令时闪退。降级至9.0.65无效。 如图,可以看到,触发指令后立即去世,然后原地重启惹 image 真是见鬼了,之前能用的9.0.25也会闪退了,设备坏了...? 尝试给shamrock降级v1.0.9也无效,尝试使用ping命令也无效,但是没闪退。调试日志错误如下 image image

yixinNB commented 1 week ago

我也遇到了类似的问题, 在切换账号或者清除qq数据以后登录均出现问题

点击登陆后qq闪退, 大概率接下来是输入验证码的那个界面

安卓10 + lspatch + qqv9.0.71+ https://github.com/whitechi73/OpenShamrock/actions/runs/9971688203

SEVEN-6174 commented 6 days ago

+1 qq 9.0.65 + LsPatch shamrock是当前最新(https://github.com/whitechi73/OpenShamrock/actions/runs/10052537788)