From b2ad4438ab746479490516421aa73e52e13dc6de Mon Sep 17 00:00:00 2001 From: WhiteChi Date: Fri, 1 Dec 2023 14:47:33 +0800 Subject: [PATCH] `Shamrock`: fix #114 --- .../fuqiuluo/shamrock/xposed/actions/InitRemoteService.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xposed/src/main/java/moe/fuqiuluo/shamrock/xposed/actions/InitRemoteService.kt b/xposed/src/main/java/moe/fuqiuluo/shamrock/xposed/actions/InitRemoteService.kt index b0d4da8..9d4398a 100644 --- a/xposed/src/main/java/moe/fuqiuluo/shamrock/xposed/actions/InitRemoteService.kt +++ b/xposed/src/main/java/moe/fuqiuluo/shamrock/xposed/actions/InitRemoteService.kt @@ -33,16 +33,21 @@ internal class InitRemoteService : IAction { if (!PlatformUtils.isMqqPackage()) return + if (ShamrockConfig.allowWebHook()) { HttpService.initTransmitter() } + val runtime = AppRuntimeFetcher.appRuntime + if (!runtime.isLogin) { + LogCenter.log("未登录,不启动任何WebSocket服务,登录完成后,请重新启动QQ。", Level.WARN) + return + } if (ShamrockConfig.openWebSocket()) { startWebSocketServer() } if (ShamrockConfig.openWebSocketClient()) { - val runtime = AppRuntimeFetcher.appRuntime val curUin = runtime.currentAccountUin val defaultToken = ShamrockConfig.getToken() ShamrockConfig.getWebSocketClientAddress().forEach { conn ->