RiskDetector 风控检测
-
这是一个为mirai-console定制的风控检测插件
他会每隔一段时间检测风控,并在疑似遇到风控时自动尝试解决
本插件已适配多Bot
使用指令
/risk d
立刻对所有已登录的Bot执行风控检测
使用指令/risk re <bot>
对一个Bot执行删除缓存并重新登录的操作,若在聊天环境执行,可以省略参数bot配置文件:
# 风控测试群号 # 机器人会将风控测试消息发至此群 (未找到则会另外随机选择) groupId: 123456 # 检测间隔 (单位: 分) # 目前自动检测暂未完善,请酌情开启,遇到问题请及时反馈 interval: 0 (为0时不开启)
本插件的原理:发送一条消息立刻撤回,若消息并未发出,撤回失败就清理缓存重新登录
注意: 本插件并不能解决如封号等的实际性问题, 也不保证100%解决风控
请参考此处解决由
device.json
导致的风控问题
https://mirai.mamoe.net/topic/951
https://mirai.mamoe.net/topic/952 -
-
-
2022-01-28 03:39:22 E/RiskDetector: java.lang.NoSuchMethodError: 'kotlin.reflect.KType kotlin.jvm.internal.Reflection.mutableCollectionType(kotlin.reflect.KType)'
java.lang.NoSuchMethodError: 'kotlin.reflect.KType kotlin.jvm.internal.Reflection.mutableCollectionType(kotlin.reflect.KType)'
at org.laolittle.plugin.AutoLoginData.<clinit>(AutoLoginData.kt:40)
at org.laolittle.plugin.RiskDetector.onEnable(RiskDetector.kt:81)
at net.mamoe.mirai.console.internal.plugin.JvmPluginInternal.internalOnEnable$mirai_console(JvmPluginInternal.kt:113)
at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.enable(BuiltInJvmPluginLoaderImpl.kt:158)
at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt)
at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt:36)
at net.mamoe.mirai.console.plugin.PluginManager.enablePlugin(PluginManager.kt:129)
at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.enableAllLoadedPlugins$mirai_console(PluginManagerImpl.kt:172)
at net.mamoe.mirai.console.internal.MiraiConsoleImplementationBridge.doStart$mirai_console(MiraiConsoleImplementationBridge.kt:214)
at net.mamoe.mirai.console.MiraiConsoleImplementation$Companion.start(MiraiConsoleImplementation.kt:277)
at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon(MiraiConsoleTerminalLoader.kt:156)
at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon$default(MiraiConsoleTerminalLoader.kt:155)
at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.main(MiraiConsoleTerminalLoader.kt:47)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.itxtech.mcl.Utility.bootMirai(Utility.java:83)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:138) at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:226)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1692)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1013)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:412)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3578)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:107)
at org.mozilla.javascript.ArrowFunction.call(ArrowFunction.java:43)
at org.mozilla.javascript.InterfaceAdapter.invokeImpl(InterfaceAdapter.java:155)
at org.mozilla.javascript.InterfaceAdapter.lambda$invoke$0(InterfaceAdapter.java:105)
at org.mozilla.javascript.Context.call(Context.java:554)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:522)
at org.mozilla.javascript.InterfaceAdapter.invoke(InterfaceAdapter.java:105)
at org.mozilla.javascript.jdk18.VMBridge_jdk18$1.invoke(VMBridge_jdk18.java:126)
at com.sun.proxy.$Proxy4.run(Unknown Source)
at org.itxtech.mcl.script.ScriptManager.phaseBoot(ScriptManager.java:106)
at org.itxtech.mcl.Loader.lambda$start$3(Loader.java:176)
at org.itxtech.mcl.Loader.tryCatching(Loader.java:145)
at org.itxtech.mcl.Loader.start(Loader.java:176)
at org.itxtech.mcl.Loader.main(Loader.java:68) -
启动报错
2022-01-28 12:34:19 E/RiskDetector: net.mamoe.yamlkt.YamlDecodingException: Top-level decoder: deserializing nested class for 'accounts' in 'AutoLogin' configuration: {} ^ at line 13, column 22 net.mamoe.yamlkt.YamlDecodingException: Top-level decoder: deserializing nested class for 'accounts' in 'AutoLogin' configuration: {} ^ at line 13, column 22 at net.mamoe.yamlkt.internal.YamlUtils__ContextualExceptionKt.contextualDecodingException(ContextualException.kt:154) at net.mamoe.yamlkt.internal.YamlUtils.contextualDecodingException(Unknown Source) at net.mamoe.yamlkt.internal.YamlDecoder$AbstractDecoder.decodeSerializableElement(YamlDecoder.kt:181) at kotlinx.serialization.encoding.CompositeDecoder$DefaultImpls.decodeSerializableElement$default(Decoding.kt:535) at net.mamoe.mirai.console.internal.data.PluginDataImpl$updaterSerializer$1.deserialize(PluginDataImpl.kt:85) at net.mamoe.mirai.console.internal.data.PluginDataImpl$updaterSerializer$1.deserialize(PluginDataImpl.kt:47) at net.mamoe.yamlkt.Yaml.decodeFromString(Yaml.kt:162) at net.mamoe.mirai.console.internal.data.MultiFilePluginDataStorageImpl.load(MultiFilePluginDataStorageImpl.kt:39) at net.mamoe.mirai.console.plugin.jvm.AbstractJvmPlugin.reloadPluginData(AbstractJvmPlugin.kt:50) at org.laolittle.plugin.RiskDetector.onEnable(RiskDetector.kt:81) at net.mamoe.mirai.console.internal.plugin.JvmPluginInternal.internalOnEnable$mirai_console(JvmPluginInternal.kt:117) at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.enable(BuiltInJvmPluginLoaderImpl.kt:164) at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.enable(BuiltInJvmPluginLoaderImpl.kt:36) at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt) at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt:47) at net.mamoe.mirai.console.plugin.PluginManager.enablePlugin(PluginManager.kt:135) at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.enableAllLoadedPlugins$mirai_console(PluginManagerImpl.kt:177) at net.mamoe.mirai.console.internal.MiraiConsoleImplementationBridge.doStart$mirai_console(MiraiConsoleImplementationBridge.kt:202) at net.mamoe.mirai.console.MiraiConsoleImplementation$Companion.start(MiraiConsoleImplementation.kt:392) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon(MiraiConsoleTerminalLoader.kt:156) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon$default(MiraiConsoleTerminalLoader.kt:155) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.main(MiraiConsoleTerminalLoader.kt:47) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.itxtech.mcl.Utility.bootMirai(Utility.java:83) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:138) at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:226) at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1692) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1013) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:412) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3578) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:107) at org.mozilla.javascript.ArrowFunction.call(ArrowFunction.java:43) at org.mozilla.javascript.InterfaceAdapter.invokeImpl(InterfaceAdapter.java:155) at org.mozilla.javascript.InterfaceAdapter.lambda$invoke$0(InterfaceAdapter.java:105) at org.mozilla.javascript.Context.call(Context.java:554) at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:522) at org.mozilla.javascript.InterfaceAdapter.invoke(InterfaceAdapter.java:105) at org.mozilla.javascript.jdk18.VMBridge_jdk18$1.invoke(VMBridge_jdk18.java:126) at com.sun.proxy.$Proxy4.run(Unknown Source) at org.itxtech.mcl.script.ScriptManager.phaseBoot(ScriptManager.java:106) at org.itxtech.mcl.Loader.lambda$start$3(Loader.java:176) at org.itxtech.mcl.Loader.tryCatching(Loader.java:145) at org.itxtech.mcl.Loader.start(Loader.java:176) at org.itxtech.mcl.Loader.main(Loader.java:68) Caused by: net.mamoe.yamlkt.YamlDecodingException: Top-level decoder: deserializing nested class for '0' in 'kotlin.collections.ArrayList' configuration: {} ^ at line 13, column 22 at net.mamoe.yamlkt.internal.YamlUtils__ContextualExceptionKt.contextualDecodingException(ContextualException.kt:154) at net.mamoe.yamlkt.internal.YamlUtils.contextualDecodingException(Unknown Source) at net.mamoe.yamlkt.internal.YamlDecoder$AbstractDecoder.decodeSerializableElement(YamlDecoder.kt:181) at kotlinx.serialization.encoding.CompositeDecoder$DefaultImpls.decodeSerializableElement$default(Decoding.kt:535) at kotlinx.serialization.internal.ListLikeSerializer.readElement(CollectionSerializers.kt:80) at kotlinx.serialization.internal.AbstractCollectionSerializer.readElement$default(CollectionSerializers.kt:51) at kotlinx.serialization.internal.AbstractCollectionSerializer.merge(CollectionSerializers.kt:36) at kotlinx.serialization.internal.AbstractCollectionSerializer.deserialize(CollectionSerializers.kt:43) at net.mamoe.mirai.console.data.SerializableValue$Companion$serializableValueWith$$inlined$map$1.deserialize(serializerHelper.kt:163) at net.mamoe.yamlkt.internal.YamlDecoder$AbstractDecoder.decodeSerializableElement(YamlDecoder.kt:179) ... 49 more Caused by: net.mamoe.yamlkt.YamlDecodingException: Top-level decoder: deserializing nested class for 'configuration' in 'org.laolittle.plugin.BotConfiguration' configuration: {} ^ at line 13, column 22 at net.mamoe.yamlkt.internal.YamlUtils__ContextualExceptionKt.contextualDecodingException(ContextualException.kt:154) at net.mamoe.yamlkt.internal.YamlUtils.contextualDecodingException(Unknown Source) at net.mamoe.yamlkt.internal.YamlDecoder$AbstractDecoder.decodeSerializableElement(YamlDecoder.kt:181) at org.laolittle.plugin.BotConfiguration$$serializer.deserialize(AutoLoginData.kt:17) at org.laolittle.plugin.BotConfiguration$$serializer.deserialize(AutoLoginData.kt:17) at net.mamoe.yamlkt.internal.YamlDecoder$AbstractDecoder.decodeSerializableElement(YamlDecoder.kt:179) ... 56 more Caused by: kotlinx.serialization.MissingFieldException: Fields [protocol, device, enable] are required for type with serial name 'org.laolittle.plugin.Configuration', but they were missing at kotlinx.serialization.internal.PluginExceptionsKt.throwMissingFieldException(PluginExceptions.kt:20) at org.laolittle.plugin.Configuration.<init>(AutoLoginData.kt:30) at org.laolittle.plugin.Configuration$$serializer.deserialize(AutoLoginData.kt:30) at org.laolittle.plugin.Configuration$$serializer.deserialize(AutoLoginData.kt:30) at net.mamoe.yamlkt.internal.YamlDecoder$AbstractDecoder.decodeSerializableElement(YamlDecoder.kt:179) ... 59 more
-
更新1.0.1
桥接
内建指令
而不是自行读取AutoLogin
配置 by @cssxsh修复可能的无法加载配置的问题
https://github.com/LaoLittle/RiskDetector/releases/tag/1.0.1
-
请问一下大佬,这个自动检测到风控之后就不会再自动检测了吗,因为我设置的间隔是10分钟,重新登录之后已经不止10分钟了;还有就是我本来登录渠道是设置了ANDROID_PAD,但是自动重新登录之后应该变成了ANDROID_PHONE,跟我手机QQ登录冲突了,这个登录渠道能不能自定义呢
-
@Tio-Yae 协议并不会改变
-
@tsudzuki 那重新登录之后跟我手机登录冲突是什么情况,重登之前一直不冲突
-
@Tio-Yae 使用的插件版本为?
-
@tsudzuki 1.0.1