From 1aa7182a9acdd2d5e980b51e661d927bff5a61b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=B6=9B?= <2450572350@qq.com> Date: Fri, 2 Jun 2023 14:22:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E6=97=B6=E4=B8=8D=E5=85=B3=E9=97=ADho?= =?UTF-8?q?ok=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/example/wxhk/tcp/vertx/InitWeChat.java | 5 ++--- .../test/java/com/example/wxhk/util/HttpSendUtilTest.java | 4 ++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/java_client/src/main/java/com/example/wxhk/tcp/vertx/InitWeChat.java b/java_client/src/main/java/com/example/wxhk/tcp/vertx/InitWeChat.java index 9c5eab5..fb3a231 100644 --- a/java_client/src/main/java/com/example/wxhk/tcp/vertx/InitWeChat.java +++ b/java_client/src/main/java/com/example/wxhk/tcp/vertx/InitWeChat.java @@ -150,9 +150,8 @@ public class InitWeChat implements CommandLineRunner { } }); - Runtime.getRuntime().addShutdownHook(new Thread(() -> { - HttpSyncUtil.exec(HttpAsyncUtil.Type.关闭hook, new JsonObject()); - })); + // FIXME: 2023/6/2 程序结束后关闭hook会偶尔出现微信闪退情况,暂时禁用 +// Runtime.getRuntime().addShutdownHook(new Thread(HttpSendUtil::关闭hook)); //netstat -aon|findstr "端口号" // c.exe -I 4568 -p D:\exec\wxhelper.dll -m 4568 } diff --git a/java_client/src/test/java/com/example/wxhk/util/HttpSendUtilTest.java b/java_client/src/test/java/com/example/wxhk/util/HttpSendUtilTest.java index 1b384e0..442acae 100644 --- a/java_client/src/test/java/com/example/wxhk/util/HttpSendUtilTest.java +++ b/java_client/src/test/java/com/example/wxhk/util/HttpSendUtilTest.java @@ -32,6 +32,10 @@ class HttpSendUtilTest { void 开启hook() { } + @Test + void 关闭ook() { + HttpSendUtil.关闭hook(); + } @Test void 获取群成员() {