Compare commits

...

26 Commits

Author SHA1 Message Date
ttttupup
24bb7212fa
Merge pull request #505 from FantasyZhou/main
fix:修正GetPIDForProcess获取不到进程ID的bug
2025-01-20 08:41:25 +08:00
Ferris
1528b66b94 fix:修正GetPIDForProcess获取不到进程ID的bug 2025-01-17 10:24:45 +08:00
ttttupup
62a641d7f7
Merge pull request #446 from aiwillcoming/main
add postman doc
2024-07-31 20:58:02 +08:00
aiwillcoming
49188b7ef0
add postman doc 2024-07-28 23:13:11 +08:00
ttttupup
e4656e5139
Merge pull request #373 from sglmsn/main
适配3.9.8.25部分接口
2024-03-08 17:02:54 +08:00
sg
0bd8b47da0 适配新版本 2024-03-08 16:54:42 +08:00
sg
7a5a8a90df 适配新版本 2024-03-08 15:44:50 +08:00
sg
b5cc83be77 适配新版本 2024-02-22 15:44:30 +08:00
ttttupup
3b5f191bf2
Merge pull request #352 from yzqzy/main
feat: add nodejs client
2024-02-06 20:15:06 +08:00
杨志强
dff024745c feat: add nodejs client 2024-02-02 17:08:06 +08:00
ttttupup
8b6e2d7160
Merge pull request #323 from ttttupup/dev-3.9.5.81
Dev 3.9.5.81
2023-11-14 20:50:21 +08:00
ttttupup
5d7c1d1d48 fix: ocr修复 closed issues #305 #321 2023-11-14 20:38:17 +08:00
hugy
d574af863a 'fix:debug环境定义' 2023-08-31 09:44:09 +08:00
ttttupup
632d4222fa
Merge pull request #274 from ttttupup/dev-3.9.5.81
Dev 3.9.5.81
2023-08-31 09:33:55 +08:00
ttttupup
3b76b2332c
Merge pull request #272 from terry-tt/main
go客户端
2023-08-29 13:33:23 +08:00
ttttupup
5088f5171b
Merge pull request #269 from ttttupup/dev-3.9.5.81
feat: 发送小程序(待完善)
2023-08-29 13:33:09 +08:00
litao
d8c8078f5c go客户端 2023-08-29 11:25:15 +08:00
ttttupup
212613e3b6
Merge pull request #250 from ttttupup/dev-3.9.5.81
feat:新增发送公众号消息,下载附件,图片解码,获取语音,发送自定义表情
2023-08-10 22:29:33 +08:00
ttttupup
2f6760e28e
Merge pull request #247 from ttttupup/dev-3.9.5.81
Dev 3.9.5.81
2023-08-08 20:53:03 +08:00
ttttupup
41b3b6b18d
Merge pull request #243 from ttttupup/dev-3.9.5.81
Dev 3.9.5.81
2023-08-05 10:56:09 +08:00
ttttupup
e6e72dd492
Merge pull request #234 from ttttupup/dev-3.9.5.81
Dev 3.9.5.81
2023-07-31 16:35:37 +08:00
ttttupup
f9b859baca
Merge pull request #233 from ttttupup/dev-3.9.5.81
fix:删除测试
2023-07-29 17:15:57 +08:00
ttttupup
4ab28cfc03
Merge pull request #230 from ttttupup/dev-3.9.5.81
feat: 建群
2023-07-29 10:07:41 +08:00
ttttupup
e6c57f8ede
Merge pull request #228 from ttttupup/dev-3.9.5.81
feat: 邀请入群,hook日志
2023-07-27 21:19:32 +08:00
ttttupup
51a4693330
Merge pull request #225 from ttttupup/dev-3.9.5.81
Dev 3.9.5.81
2023-07-22 09:19:20 +08:00
ttttupup
e0c946bf72
Merge pull request #214 from ttttupup/dev-3.9.5.81
Dev 3.9.5.81
2023-07-14 22:28:57 +08:00
18 changed files with 799 additions and 33 deletions

640
doc/postman.json Normal file
View File

@ -0,0 +1,640 @@
{
"info": {
"name": "Wechat Hook 395",
"_postman_id": "d2b6a4f2-6d7d-4a21-9bbf-65b5a5a3a5a",
"description": "A collection of Wechat Hook 395 API requests.",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "checkLogin",
"request": {
"url": {
"raw": "http://127.0.0.1:19088/api/checkLogin",
"protocol": "http",
"host": [
"127.0.0.1"
],
"port": "19088",
"path": [
"api",
"checkLogin"
]
},
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"description": "API to check login status."
}
},
{
"name": "userInfo",
"request": {
"url": {
"raw": "http://127.0.0.1:19088/api/userInfo",
"protocol": "http",
"host": [
"127.0.0.1"
],
"port": "19088",
"path": [
"api",
"userInfo"
]
},
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"description": "API to get user information."
}
},
{
"name": "sendTextMsg",
"request": {
"url": {
"raw": "http://127.0.0.1:19088/api/sendTextMsg",
"protocol": "http",
"host": [
"127.0.0.1"
],
"port": "19088",
"path": [
"api",
"sendTextMsg"
]
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\"wxid\": \"filehelper\",\"msg\": \"12www\"}"
},
"description": "API to send text messages."
}
},
{
"name": "sendImagesMsg",
"request": {
"url": "http://127.0.0.1:19088/api/sendImagesMsg",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": "Specify that the request body is in JSON format."
}
],
"body": {
"mode": "raw",
"raw": "{\"wxid\": \"filehelper\",\"imagePath\": \"C:\\pic.png\"}"
},
"description": "API to send image messages."
}
},
{
"name": "sendFileMsg",
"request": {
"url": "http://127.0.0.1:19088/api/sendFileMsg",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": "Specify that the request body is in JSON format."
}
],
"body": {
"mode": "raw",
"raw": "{\"wxid\": \"filehelper\",\"filePath\": \"C:\\test.zip\"}"
},
"description": "API to send file messages."
}
},
{
"name": "hookSyncMsg",
"request": {
"url": "http://127.0.0.1:19088/api/hookSyncMsg",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": "Specify that the request body is in JSON format."
}
],
"body": {
"mode": "raw",
"raw": "{\"port\": \"19099\",\"ip\": \"127.0.0.1\",\"url\": \"http://localhost:8080\",\"timeout\": \"3000\",\"enableHttp\": \"0\"}"
},
"description": "API to hook sync messages."
}
},
{
"name": "unhookSyncMsg",
"request": {
"url": "http://127.0.0.1:19088/api/unhookSyncMsg",
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"description": "API to unhook sync messages."
}
},
{
"name": "getContactList",
"request": {
"url": "http://127.0.0.1:19088/api/getContactList",
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"description": "API to get the contact list."
}
},
{
"name": "getDBInfo",
"request": {
"url": "http://127.0.0.1:19088/api/getDBInfo",
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"description": "API to get database information."
}
},
{
"name": "execSql",
"request": {
"url": "http://127.0.0.1:19088/api/execSql",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": "Specify that the request body is in JSON format."
}
],
"body": {
"mode": "raw",
"raw": "{\"dbHandle\": 1713425147584,\"sql\": \"select * from MSG where localId =100;\"}"
},
"description": "API to execute SQL queries."
}
},
{
"name": "getChatRoomDetailInfo",
"request": {
"url": "http://127.0.0.1:19088/api/getChatRoomDetailInfo",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": "Specify that the request body is in JSON format."
}
],
"body": {
"mode": "raw",
"raw": "{\"chatRoomId\": \"123333@chatroom\"}"
},
"description": "API to get chat room detail information."
}
},
{
"name": "addMemberToChatRoom",
"request": {
"url": "http://127.0.0.1:19088/api/addMemberToChatRoom",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": "Specify that the request body is in JSON format."
}
],
"body": {
"mode": "raw",
"raw": "{\"chatRoomId\": \"123@chatroom\",\"memberIds\": \"wxid_123\"}"
},
"description": "API to add member to chat room."
}
},
{
"name": "delMemberFromChatRoom",
"request": {
"url": "http://127.0.0.1:19088/api/delMemberFromChatRoom",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": "Specify that the request body is in JSON format."
}
],
"body": {
"mode": "raw",
"raw": "{\"chatRoomId\": \"21363231004@chatroom\",\"memberIds\": \"wxid_123\"}"
},
"description": "API to delete member from chat room."
}
},
{
"name": "modifyNickname",
"request": {
"url": "http://127.0.0.1:19088/api/modifyNickname",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": "Specify that the request body is in JSON format."
}
],
"body": {
"mode": "raw",
"raw": "{\"chatRoomId\": \"123@chatroom\",\"wxid\": \"wxid_123\",\"nickName\": \"test\"}"
},
"description": "API to modify a nickname in a chat room."
}
},
{
"name": "getMemberFromChatRoom",
"request": {
"url": "http://127.0.0.1:19088/api/getMemberFromChatRoom",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": "Specify that the request body is in JSON format."
}
],
"body": {
"mode": "raw",
"raw": "{\"chatRoomId\": \"123@chatroom\"}"
},
"description": "API to get members from a chat room."
}
},
{
"name": "topMsg",
"request": {
"url": "http://127.0.0.1:19088/api/topMsg",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": "Specify that the request body is in JSON format."
}
],
"body": {
"mode": "raw",
"raw": "{\"msgId\": 1222222}"
},
"description": "API to top a message."
}
},
{
"name": "removeTopMsg",
"request": {
"url": "http://127.0.0.1:19088/api/removeTopMsg",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": "Specify that the request body is in JSON format."
}
],
"body": {
"mode": "raw",
"raw": "{\"chatRoomId\": \"123@chatroom\",\"msgId\": 123}"
},
"description": "API to remove a topped message."
}
},
{
"name": "InviteMemberToChatRoom",
"request": {
"url": "http://127.0.0.1:19088/api/InviteMemberToChatRoom",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": "Specify that the request body is in JSON format."
}
],
"body": {
"mode": "raw",
"raw": "{\"chatRoomId\": \"123@chatroom\",\"memberIds\": \"wxid_123\"}"
},
"description": "API to invite members to a chat room."
}
},
{
"name": "hookLog",
"request": {
"url": "http://127.0.0.1:19088/api/hookLog",
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"description": "API to hook logs."
}
},
{
"name": "unhookLog",
"request": {
"url": "http://127.0.0.1:19088/api/unhookLog",
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"description": "API to unhook logs."
}
},
{
"name": "createChatRoom",
"request": {
"url": "http://127.0.0.1:19088/api/createChatRoom",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": "Specify that the request body is in JSON format."
}
],
"body": {
"mode": "raw",
"raw": "{\"memberIds\": \"wxid_8yn4k908tdqp22,wxid_oyb662qhop4422\"}"
},
"description": "API to create a chat room."
}
},
{
"name": "quitChatRoom",
"request": {
"url": "http://127.0.0.1:19088/api/quitChatRoom",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": "Specify that the request body is in JSON format."
}
],
"body": {
"mode": "raw",
"raw": "{\"chatRoomId\": \"123@chatroom\"}"
},
"description": "API to quit a chat room."
}
},
{
"name": "forwardMsg",
"request": {
"url": "http://127.0.0.1:19088/api/forwardMsg",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": "Specify that the request body is in JSON format."
}
],
"body": {
"mode": "raw",
"raw": "{\"wxid\": \"filehelper\",\"msgId\": \"12331\"}"
},
"description": "API to forward a message."
}
},
{
"name": "getSNSFirstPage",
"request": {
"url": "http://127.0.0.1:19088/api/getSNSFirstPage",
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"description": "API to get the first page of SNS data."
}
},
{
"name": "getSNSNextPage",
"request": {
"url": "http://127.0.0.1:19088/api/getSNSNextPage",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": "Specify that the request body is in JSON format."
}
],
"body": {
"mode": "raw",
"raw": "{\"snsId\": \"\"}"
},
"description": "API to get the next page of SNS data."
}
},
{
"name": "addFavFromMsg",
"request": {
"url": "http://127.0.0.1:19088/api/addFavFromMsg",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": "Specify that the request body is in JSON format."
}
],
"body": {
"mode": "raw",
"raw": "{\"msgId\": \"1222222\"}"
},
"description": "API to add a favorite from a message."
}
},
{
"name": "addFavFromImage",
"request": {
"url": "http://127.0.0.1:19088/api/addFavFromImage",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": "Specify that the request body is in JSON format."
}
],
"body": {
"mode": "raw",
"raw": "{\"wxid\": \"\",\"imagePath\": \"\"}"
},
"description": "API to add a favorite from an image."
}
},
{
"name": "getContactProfile",
"request": {
"url": "http://127.0.0.1:19088/api/getContactProfile",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": "Specify that the request body is in JSON format."
}
],
"body": {
"mode": "raw",
"raw": "{\"wxid\": \"\"}"
},
"description": "API to get contact profile."
}
},
{
"name": "sendAtText",
"request": {
"url": "http://127.0.0.1:19088/api/sendAtText",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": "Specify that the request body is in JSON format."
}
],
"body": {
"mode": "raw",
"raw": "{\"wxids\": \"notify@all\",\"chatRoomId\": \"123@chatroom\",\"msg\": \"你好啊\"}"
},
"description": "API to send an at-text message."
}
},
{
"name": "forwardPublicMsg",
"request": {
"url": "http://127.0.0.1:19088/api/forwardPublicMsg",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": "Specify that the request body is in JSON format."
}
],
"body": {
"mode": "raw",
"raw": "{\"appName\": \"\",\"userName\": \"\",\"title\": \"\",\"url\": \"\",\"thumbUrl\": \"\",\"digest\": \"\",\"wxid\": \"filehelper\"}"
},
"description": "API to forward a public message."
}
},
{
"name": "forwardPublicMsgByMsgId",
"request": {
"url": "http://127.0.0.1:19088/api/forwardPublicMsgByMsgId",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": "Specify that the request body is in JSON format."
}
],
"body": {
"mode": "raw",
"raw": "{\"msgId\": 123,\"wxid\": \"filehelper\"}"
},
"description": "API to forward a public message by message ID."
}
},
{
"name": "downloadAttach",
"request": {
"url": "http://127.0.0.1:19088/api/downloadAttach",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": "Specify that the request body is in JSON format."
}
],
"body": {
"mode": "raw",
"raw": "{\"msgId\": 123}"
},
"description": "API to download an attachment."
}
},
{
"name": "decodeImage",
"request": {
"url": "http://127.0.0.1:19088/api/decodeImage",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": "Specify that the request body is in JSON format."
}
],
"body": {
"mode": "raw",
"raw": "{\"filePath\": \"C:\\66664816980131.dat\",\"storeDir\": \"C:\\test\"}"
},
"description": "API to decode an image."
}
},
{
"name": "getVoiceByMsgId",
"request": {
"url": "http://127.0.0.1:19088/api/getVoiceByMsgId",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": "Specify that the request body is in JSON format."
}
],
"body": {
"mode": "raw",
"raw": "{\"msgId\": 7880439644200,\"storeDir\": \"c:\\test\"}"
},
"description": "API to get voice by message ID."
}
}
]
}

11
go_client/main.go Normal file
View File

@ -0,0 +1,11 @@
package main
import (
"go_client/tcpserver"
"log"
)
func main() {
log.SetFlags(log.LstdFlags | log.Lshortfile)
tcpserver.Listen(19099)
}

View File

@ -0,0 +1,44 @@
package tcpserver
import (
"bufio"
"log"
"net"
"strconv"
)
func Listen(port int) {
p := strconv.Itoa(port)
adress := "127.0.0.1:" + p
ln, err := net.Listen("tcp", adress)
if err != nil {
log.Fatal(err)
}
defer ln.Close()
log.Println("tcp server started")
for {
conn, err := ln.Accept()
if err != nil {
log.Println(err)
continue
}
go handle(conn)
}
}
func handle(conn net.Conn) {
defer func() {
if err := recover(); err != nil {
log.Println("发生了未处理的异常", err)
}
}()
defer conn.Close()
scanner := bufio.NewScanner(conn)
for scanner.Scan() {
line := scanner.Bytes()
log.Println("收到消息:", string(line))
}
if err := scanner.Err(); err != nil {
log.Println("错误:", err)
}
}

View File

@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.0</version>
<version>3.2.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
@ -14,7 +14,8 @@
<name>wxhk</name>
<description>wxhk</description>
<properties>
<java.version>17</java.version>
<java.version>21</java.version>
<vertx-web-client.version>4.5.3</vertx-web-client.version>
</properties>
<dependencies>
<dependency>
@ -39,7 +40,7 @@
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.92.Final</version>
<version>4.1.105.Final</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
@ -50,22 +51,22 @@
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-core</artifactId>
<version>4.4.2</version>
<version>${vertx-web-client.version}</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-web</artifactId>
<version>4.4.2</version>
<version>${vertx-web-client.version}</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-web-client</artifactId>
<version>4.4.2</version>
<version>${vertx-web-client.version}</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-mysql-client</artifactId>
<version>4.4.2</version>
<version>${vertx-web-client.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>

View File

@ -42,6 +42,11 @@ public class PrivateChatMsg implements Serializable {
private String signature;
private String time;
private Integer timestamp;
/**
* 对用户,如果是文件助手是filehelper
*/
private String toUser;
/**
* 类型
*/

View File

@ -15,4 +15,17 @@ import lombok.experimental.Accessors;
public class OpenHook implements SendMsg<OpenHook> {
String port;
String ip;
/**
* 0/1 1.启用http 0.不启用http
*/
boolean enableHttp;
/**
* 超时时间,单位ms
*/
String timeout;
/**
* http的请求地址enableHttp=1时不能为空
*/
String url;
}

View File

@ -18,6 +18,7 @@ import org.w3c.dom.NodeList;
import java.math.BigDecimal;
import java.util.Iterator;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.ReentrantReadWriteLock;
@ -50,7 +51,12 @@ public class WxMsgHandle {
@PostConstruct
public void init() {
add(chatMsg -> {
if(Objects.equals(chatMsg.getToUser(), FILEHELPER)){
wxSmgServer.文件助手(chatMsg);
}else{
wxSmgServer.私聊(chatMsg);
}
return null;
}, WxMsgType.私聊信息);
add(chatMsg -> {
@ -174,8 +180,8 @@ public class WxMsgHandle {
if (monery.startsWith("")) {
String substring = monery.substring(1);
BigDecimal decimal = new BigDecimal(substring);
log.info("收款:{},付款人:{},付款备注:{}", decimal.stripTrailingZeros().toPlainString(), chatMsg.getFromUser(), remark);
wxSmgServer.收款之后(new PayoutInformation(chatMsg.getFromUser(), decimal, remark));
log.info("收款:{},付款人:{},付款备注:{}", decimal.stripTrailingZeros().toPlainString(), receiver_username, remark);
wxSmgServer.收款之后(new PayoutInformation(receiver_username, decimal, remark));
return false;
};

View File

@ -32,12 +32,14 @@ public class WxSmgServerImpl implements com.example.wxhk.server.WxSmgServer {
public void 私聊(PrivateChatMsg chatMsg) {
if (Objects.equals(chatMsg.getIsSendMsg(), 1) && Objects.equals(chatMsg.getIsSendByPhone(), 1)) {
log.info("手机端对:{}发出:{}", chatMsg.getFromUser(), chatMsg.getContent());
}else{
log.info("收到私聊{}",chatMsg);
}
}
@Override
public void 文件助手(PrivateChatMsg chatMsg) {
log.info("文件助手:{}",chatMsg);
}
@Override

View File

@ -2,7 +2,8 @@ package com.example.wxhk.tcp.vertx;
import com.example.wxhk.WxhkApplication;
import com.example.wxhk.constant.WxMsgType;
import com.example.wxhk.util.HttpAsyncUtil;
import com.example.wxhk.model.request.OpenHook;
import com.example.wxhk.util.HttpSendUtil;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.DeploymentOptions;
import io.vertx.core.Future;
@ -75,7 +76,10 @@ public class VertxTcp extends AbstractVerticle implements CommandLineRunner {
listen.onComplete(event -> {
boolean succeeded = event.succeeded();
if (succeeded) {
HttpAsyncUtil.exec(HttpAsyncUtil.Type.开启hook, new JsonObject().put("port", InitWeChat.getVertxPort().toString()).put("ip", "127.0.0.1"));
HttpSendUtil.开启hook(new OpenHook().setPort(InitWeChat.getVertxPort().toString()).setIp("127.0.0.1")
.setEnableHttp(false)
.setTimeout("5000"));
// HttpAsyncUtil.exec(HttpAsyncUtil.Type.开启hook, new JsonObject().put("port", InitWeChat.getVertxPort().toString()).put("ip", "127.0.0.1"));
startPromise.complete();
} else {
startPromise.fail(event.cause());

View File

@ -24,7 +24,7 @@ public class HttpAsyncUtil {
protected static final Log log = Log.get();
public static Future<HttpResponse<Buffer>> exec(Type type, JsonObject object) {
return client.post(InitWeChat.wxPort, "localhost", "/api/?type=" + type.getType())
return client.post(InitWeChat.wxPort, "localhost", "/api/" + type.getType())
.sendJsonObject(object)
.onSuccess(event ->
{
@ -36,7 +36,7 @@ public class HttpAsyncUtil {
}
public static Future<HttpResponse<Buffer>> exec(Type type, JsonObject object, Handler<AsyncResult<HttpResponse<Buffer>>> handler) {
return client.post(InitWeChat.wxPort, "localhost", "/api/?type=" + type.getType())
return client.post(InitWeChat.wxPort, "localhost", "/api/" + type.getType())
.sendJsonObject(object)
.onComplete(handler)
;
@ -45,22 +45,31 @@ public class HttpAsyncUtil {
}
public enum Type {
检查微信登陆("0"),
获取登录信息("1"),
发送文本("2"),
发送at文本("3"),
检查微信登陆("checkLogin"),
获取登录信息("userInfo"),
发送文本("sendTextMsg"),
转发消息("forwardMsg"),
发送at文本("sendAtText"),
发送图片("5"),
发送文件("6"),
开启hook("9"),
关闭hook("10"),
发送文件("sendFileMsg"),
开启hook("hookSyncMsg"),
关闭hook("unhookSyncMsg"),
添加好友("20"),
通过好友申请("23"),
获取群成员("25"),
获取群成员昵称("26"),
删除群成员("27"),
获取群成员("getMemberFromChatRoom"),
获取群成员基础信息("getContactProfile"),
获取群详情("getChatRoomDetailInfo"),
添加群成员("addMemberToChatRoom"),
修改群昵称("modifyNickname"),
删除群成员("delMemberFromChatRoom"),
置顶群消息("topMsg"),
取消置顶群消息("removeTopMsg"),
邀请入群("InviteMemberToChatRoom"),
确认收款("45"),
联系人列表("46"),
联系人列表("getContactList"),
查询微信信息("55"),
下载附件("downloadAttach"),
解码("decodeImage"),
;

View File

@ -27,7 +27,7 @@ public class HttpSyncUtil {
}
public static JsonObject exec(HttpAsyncUtil.Type type, JsonObject obj) {
String post = engine.send(Request.of("http://localhost:" + InitWeChat.wxPort + "/api/?type=" + type.getType()).method(Method.POST).body(obj.encode())).bodyStr();
String post = engine.send(Request.of("http://localhost:" + InitWeChat.wxPort + "/api/" + type.getType()).method(Method.POST).body(obj.encode())).bodyStr();
if (log.isDebugEnabled()) {
log.debug("type:{},{}", type.getType(), post);
}

View File

@ -1,4 +1,4 @@
wx.path=D:\\Program Files (x86)\\Tencent\\WeChat\\[3.9.2.23]\\WeChat.exe
wx.path=D:\\Program Files (x86)\\Tencent\\WeChat\\WeChat.exe
wx.port=19088
spring.profiles.active=local
vertx.port=8080

View File

@ -7,6 +7,8 @@ import org.dromara.hutool.core.lang.Console;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import java.time.Duration;
import java.time.LocalDateTime;
import java.util.List;
@SpringBootTest
@ -41,5 +43,7 @@ class HttpSendUtilTest {
void 获取群成员() {
GroupMembers 获取群成员 = HttpSendUtil.获取群成员(new GetGroupMembers().setChatRoomId("24964676359@chatroom"));
Console.log(获取群成员);
Duration between = Duration.between(LocalDateTime.now(), LocalDateTime.now());
}
}

View File

@ -0,0 +1,26 @@
const net = require('net')
const server = net.createServer(socket => {
console.log('New client connected')
let data = Buffer.from('')
socket.on('data', data => {
data = Buffer.concat([data, chunk])
console.log(`Received data: ${data}`)
})
socket.on('end', () => {
const decodedData = data.toString('utf8')
console.log(`Received data: ${decodedData}`)
})
socket.on('close', () => {
console.log('Client disconnected')
})
})
const port = 19099
server.listen(port, () => {
console.log(`Server listening on port ${port}`)
})

View File

@ -526,7 +526,7 @@ DWORD GetPIDForProcess(wchar_t* process)
if (!hSnapshot) {
return 0;
}
pe32.dwSize = sizeof(PROCESSENTRY32);
pe32.dwSize = sizeof(PROCESSENTRY32W);
for (working = Process32FirstW(hSnapshot, &pe32); working; working = Process32NextW(hSnapshot, &pe32))
{
if (!wcscmp(pe32.szExeFile, process))

View File

@ -1165,8 +1165,9 @@ INT64 Manager::SendApplet(const std::wstring &recv_wxid,
common::VectorInner *list = (common::VectorInner *)temp;
prototype::WeChatString *member = BuildWechatString(recv_wxid);
#ifdef _DEBUG
list->head = reinterpret_cast<UINT64>(member);
#endif
list->start = reinterpret_cast<UINT64>(member);
list->finsh = reinterpret_cast<UINT64>(member) + 0x20;
list->end = reinterpret_cast<UINT64>(member) + 0x20;
@ -1245,8 +1246,8 @@ INT64 Manager::DoOCRTask(const std::wstring &img_path, std::string &result) {
reinterpret_cast<UINT64>(buff),reinterpret_cast<UINT64>(&unkonwn));
INT64 number = *(INT64 *)(buff + 0x8);
if (number > 0) {
INT64 header = list->start;
for (unsigned int i = 0; i < number - 1; i++) {
INT64 header = *(INT64 *)(buff);
for (unsigned int i = 0; i < number; i++) {
INT64 content = *(INT64 *)header;
result += Utils::ReadWstringThenConvert(content + 0x28);
result += "\r\n";