Merge pull request #25 from supermoonie/master

更新至 v3.7.0.30.25 (2023.05.05)
This commit is contained in:
Changhua 2023-05-08 09:13:01 +08:00 committed by GitHub
commit 0e89f2c01a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 268 additions and 50 deletions

View File

@ -1,25 +1,8 @@
syntax = "proto3"; syntax = "proto3";
package wcf; package wcf;
option java_package = "com.iamteer"; option java_package = "com.iamteer";
/*
service Wcf {
rpc RpcIsLogin(Empty) returns (Response) {}
rpc RpcGetSelfWxid(Empty) returns (String) {}
rpc RpcEnableRecvMsg(Empty) returns (stream WxMsg) {}
rpc RpcDisableRecvMsg(Empty) returns (Response) {}
rpc RpcSendTextMsg(TextMsg) returns (Response) {}
rpc RpcSendPathMsg(PathMsg) returns (Response) {}
rpc RpcGetMsgTypes(Empty) returns (MsgTypes) {}
rpc RpcGetContacts(Empty) returns (Contacts) {}
rpc RpcGetDbNames(Empty) returns (DbNames) {}
rpc RpcGetDbTables(String) returns (DbTables) {}
rpc RpcExecDbQuery(DbQuery) returns (DbRows) {}
rpc RpcAcceptNewFriend(Verification) returns (Response) {}
}
*/
enum Functions { enum Functions {
FUNC_RESERVED = 0x00; FUNC_RESERVED = 0x00;
FUNC_IS_LOGIN = 0x01; FUNC_IS_LOGIN = 0x01;
@ -28,6 +11,7 @@ enum Functions {
FUNC_GET_CONTACTS = 0x12; FUNC_GET_CONTACTS = 0x12;
FUNC_GET_DB_NAMES = 0x13; FUNC_GET_DB_NAMES = 0x13;
FUNC_GET_DB_TABLES = 0x14; FUNC_GET_DB_TABLES = 0x14;
FUNC_GET_USER_INFO = 0x15;
FUNC_SEND_TXT = 0x20; FUNC_SEND_TXT = 0x20;
FUNC_SEND_IMG = 0x21; FUNC_SEND_IMG = 0x21;
FUNC_SEND_FILE = 0x22; FUNC_SEND_FILE = 0x22;
@ -38,6 +22,8 @@ enum Functions {
FUNC_EXEC_DB_QUERY = 0x50; FUNC_EXEC_DB_QUERY = 0x50;
FUNC_ACCEPT_FRIEND = 0x51; FUNC_ACCEPT_FRIEND = 0x51;
FUNC_ADD_ROOM_MEMBERS = 0x52; FUNC_ADD_ROOM_MEMBERS = 0x52;
FUNC_RECV_TRANSFER = 0x53;
FUNC_DECRYPT_IMAGE = 0x60;
} }
message Request message Request
@ -53,6 +39,8 @@ message Request
Verification v = 7; Verification v = 7;
AddMembers m = 8; AddMembers m = 8;
XmlMsg xml = 9; XmlMsg xml = 9;
DecPath dec = 10;
Transfer tf = 11;
} }
} }
@ -61,14 +49,15 @@ message Response
Functions func = 1; Functions func = 1;
oneof msg oneof msg
{ {
int32 status = 2; int32 status = 2; // Int
string str = 3; string str = 3; //
WxMsg wxmsg = 4; WxMsg wxmsg = 4; //
MsgTypes types = 5; MsgTypes types = 5; //
RpcContacts contacts = 6; RpcContacts contacts = 6; //
DbNames dbs = 7; DbNames dbs = 7; //
DbTables tables = 8; DbTables tables = 8; //
DbRows rows = 9; DbRows rows = 9; //
UserInfo ui = 10; //
}; };
} }
@ -84,6 +73,8 @@ message WxMsg
string sender = 6; // string sender = 6; //
string roomid = 7; // id string roomid = 7; // id
string content = 8; // string content = 8; //
string thumb = 9; //
string extra = 10; //
} }
message TextMsg message TextMsg
@ -113,11 +104,12 @@ message RpcContact
{ {
string wxid = 1; // id string wxid = 1; // id
string code = 2; // string code = 2; //
string name = 3; // string remark = 3; //
string country = 4; // string name = 4; //
string province = 5; // / string country = 5; //
string city = 6; // string province = 6; // /
int32 gender = 7; // string city = 7; //
int32 gender = 8; //
} }
message RpcContacts { repeated RpcContact contacts = 1; } message RpcContacts { repeated RpcContact contacts = 1; }
@ -147,8 +139,9 @@ message DbRows { repeated DbRow rows = 1; }
message Verification message Verification
{ {
string v3 = 1; string v3 = 1; //
string v4 = 2; string v4 = 2; // Ticket
int32 scene = 3; // 17 30
} }
message AddMembers message AddMembers
@ -156,3 +149,23 @@ message AddMembers
string roomid = 1; // ID string roomid = 1; // ID
string wxids = 2; // string wxids = 2; //
} }
message UserInfo
{
string wxid = 1; // ID
string name = 2; //
string mobile = 3; //
string home = 4; // /
}
message DecPath
{
string src = 1; //
string dst = 2; //
}
message Transfer
{
string wxid = 1; //
string tid = 2; // id transferid
}

View File

@ -3,7 +3,7 @@
pub struct Request { pub struct Request {
#[prost(enumeration = "Functions", tag = "1")] #[prost(enumeration = "Functions", tag = "1")]
pub func: i32, pub func: i32,
#[prost(oneof = "request::Msg", tags = "2, 3, 4, 5, 6, 7, 8, 9")] #[prost(oneof = "request::Msg", tags = "2, 3, 4, 5, 6, 7, 8, 9, 10, 11")]
pub msg: ::core::option::Option<request::Msg>, pub msg: ::core::option::Option<request::Msg>,
} }
/// Nested message and enum types in `Request`. /// Nested message and enum types in `Request`.
@ -27,6 +27,10 @@ pub mod request {
M(super::AddMembers), M(super::AddMembers),
#[prost(message, tag = "9")] #[prost(message, tag = "9")]
Xml(super::XmlMsg), Xml(super::XmlMsg),
#[prost(message, tag = "10")]
Dec(super::DecPath),
#[prost(message, tag = "11")]
Tf(super::Transfer),
} }
} }
#[allow(clippy::derive_partial_eq_without_eq)] #[allow(clippy::derive_partial_eq_without_eq)]
@ -34,7 +38,7 @@ pub mod request {
pub struct Response { pub struct Response {
#[prost(enumeration = "Functions", tag = "1")] #[prost(enumeration = "Functions", tag = "1")]
pub func: i32, pub func: i32,
#[prost(oneof = "response::Msg", tags = "2, 3, 4, 5, 6, 7, 8, 9")] #[prost(oneof = "response::Msg", tags = "2, 3, 4, 5, 6, 7, 8, 9, 10")]
pub msg: ::core::option::Option<response::Msg>, pub msg: ::core::option::Option<response::Msg>,
} }
/// Nested message and enum types in `Response`. /// Nested message and enum types in `Response`.
@ -42,22 +46,33 @@ pub mod response {
#[allow(clippy::derive_partial_eq_without_eq)] #[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)] #[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Msg { pub enum Msg {
/// Int 状态,通用
#[prost(int32, tag = "2")] #[prost(int32, tag = "2")]
Status(i32), Status(i32),
/// 字符串
#[prost(string, tag = "3")] #[prost(string, tag = "3")]
Str(::prost::alloc::string::String), Str(::prost::alloc::string::String),
/// 微信消息
#[prost(message, tag = "4")] #[prost(message, tag = "4")]
Wxmsg(super::WxMsg), Wxmsg(super::WxMsg),
/// 消息类型
#[prost(message, tag = "5")] #[prost(message, tag = "5")]
Types(super::MsgTypes), Types(super::MsgTypes),
/// 联系人
#[prost(message, tag = "6")] #[prost(message, tag = "6")]
Contacts(super::RpcContacts), Contacts(super::RpcContacts),
/// 数据库列表
#[prost(message, tag = "7")] #[prost(message, tag = "7")]
Dbs(super::DbNames), Dbs(super::DbNames),
/// 表列表
#[prost(message, tag = "8")] #[prost(message, tag = "8")]
Tables(super::DbTables), Tables(super::DbTables),
/// 行列表
#[prost(message, tag = "9")] #[prost(message, tag = "9")]
Rows(super::DbRows), Rows(super::DbRows),
/// 个人信息
#[prost(message, tag = "10")]
Ui(super::UserInfo),
} }
} }
#[allow(clippy::derive_partial_eq_without_eq)] #[allow(clippy::derive_partial_eq_without_eq)]
@ -90,6 +105,12 @@ pub struct WxMsg {
/// 消息内容 /// 消息内容
#[prost(string, tag = "8")] #[prost(string, tag = "8")]
pub content: ::prost::alloc::string::String, pub content: ::prost::alloc::string::String,
/// 缩略图
#[prost(string, tag = "9")]
pub thumb: ::prost::alloc::string::String,
/// 附加内容
#[prost(string, tag = "10")]
pub extra: ::prost::alloc::string::String,
} }
#[allow(clippy::derive_partial_eq_without_eq)] #[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
@ -145,20 +166,23 @@ pub struct RpcContact {
/// 微信号 /// 微信号
#[prost(string, tag = "2")] #[prost(string, tag = "2")]
pub code: ::prost::alloc::string::String, pub code: ::prost::alloc::string::String,
/// 微信昵称 /// 备注
#[prost(string, tag = "3")] #[prost(string, tag = "3")]
pub remark: ::prost::alloc::string::String,
/// 微信昵称
#[prost(string, tag = "4")]
pub name: ::prost::alloc::string::String, pub name: ::prost::alloc::string::String,
/// 国家 /// 国家
#[prost(string, tag = "4")] #[prost(string, tag = "5")]
pub country: ::prost::alloc::string::String, pub country: ::prost::alloc::string::String,
/// 省/州 /// 省/州
#[prost(string, tag = "5")] #[prost(string, tag = "6")]
pub province: ::prost::alloc::string::String, pub province: ::prost::alloc::string::String,
/// 城市 /// 城市
#[prost(string, tag = "6")] #[prost(string, tag = "7")]
pub city: ::prost::alloc::string::String, pub city: ::prost::alloc::string::String,
/// 性别 /// 性别
#[prost(int32, tag = "7")] #[prost(int32, tag = "8")]
pub gender: i32, pub gender: i32,
} }
#[allow(clippy::derive_partial_eq_without_eq)] #[allow(clippy::derive_partial_eq_without_eq)]
@ -227,10 +251,15 @@ pub struct DbRows {
#[allow(clippy::derive_partial_eq_without_eq)] #[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct Verification { pub struct Verification {
/// 加密的用户名
#[prost(string, tag = "1")] #[prost(string, tag = "1")]
pub v3: ::prost::alloc::string::String, pub v3: ::prost::alloc::string::String,
/// Ticket
#[prost(string, tag = "2")] #[prost(string, tag = "2")]
pub v4: ::prost::alloc::string::String, pub v4: ::prost::alloc::string::String,
/// 添加方式17 名片30 扫码
#[prost(int32, tag = "3")]
pub scene: i32,
} }
#[allow(clippy::derive_partial_eq_without_eq)] #[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
@ -242,6 +271,42 @@ pub struct AddMembers {
#[prost(string, tag = "2")] #[prost(string, tag = "2")]
pub wxids: ::prost::alloc::string::String, pub wxids: ::prost::alloc::string::String,
} }
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UserInfo {
/// 微信ID
#[prost(string, tag = "1")]
pub wxid: ::prost::alloc::string::String,
/// 昵称
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
/// 手机号
#[prost(string, tag = "3")]
pub mobile: ::prost::alloc::string::String,
/// 文件/图片等父路径
#[prost(string, tag = "4")]
pub home: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DecPath {
/// 源路径
#[prost(string, tag = "1")]
pub src: ::prost::alloc::string::String,
/// 目标路径
#[prost(string, tag = "2")]
pub dst: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Transfer {
/// 转账人
#[prost(string, tag = "1")]
pub wxid: ::prost::alloc::string::String,
/// 转账id transferid
#[prost(string, tag = "2")]
pub tid: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)] #[repr(i32)]
pub enum Functions { pub enum Functions {
@ -252,6 +317,7 @@ pub enum Functions {
FuncGetContacts = 18, FuncGetContacts = 18,
FuncGetDbNames = 19, FuncGetDbNames = 19,
FuncGetDbTables = 20, FuncGetDbTables = 20,
FuncGetUserInfo = 21,
FuncSendTxt = 32, FuncSendTxt = 32,
FuncSendImg = 33, FuncSendImg = 33,
FuncSendFile = 34, FuncSendFile = 34,
@ -262,6 +328,8 @@ pub enum Functions {
FuncExecDbQuery = 80, FuncExecDbQuery = 80,
FuncAcceptFriend = 81, FuncAcceptFriend = 81,
FuncAddRoomMembers = 82, FuncAddRoomMembers = 82,
FuncRecvTransfer = 83,
FuncDecryptImage = 96,
} }
impl Functions { impl Functions {
/// String value of the enum field names used in the ProtoBuf definition. /// String value of the enum field names used in the ProtoBuf definition.
@ -277,6 +345,7 @@ impl Functions {
Functions::FuncGetContacts => "FUNC_GET_CONTACTS", Functions::FuncGetContacts => "FUNC_GET_CONTACTS",
Functions::FuncGetDbNames => "FUNC_GET_DB_NAMES", Functions::FuncGetDbNames => "FUNC_GET_DB_NAMES",
Functions::FuncGetDbTables => "FUNC_GET_DB_TABLES", Functions::FuncGetDbTables => "FUNC_GET_DB_TABLES",
Functions::FuncGetUserInfo => "FUNC_GET_USER_INFO",
Functions::FuncSendTxt => "FUNC_SEND_TXT", Functions::FuncSendTxt => "FUNC_SEND_TXT",
Functions::FuncSendImg => "FUNC_SEND_IMG", Functions::FuncSendImg => "FUNC_SEND_IMG",
Functions::FuncSendFile => "FUNC_SEND_FILE", Functions::FuncSendFile => "FUNC_SEND_FILE",
@ -287,6 +356,8 @@ impl Functions {
Functions::FuncExecDbQuery => "FUNC_EXEC_DB_QUERY", Functions::FuncExecDbQuery => "FUNC_EXEC_DB_QUERY",
Functions::FuncAcceptFriend => "FUNC_ACCEPT_FRIEND", Functions::FuncAcceptFriend => "FUNC_ACCEPT_FRIEND",
Functions::FuncAddRoomMembers => "FUNC_ADD_ROOM_MEMBERS", Functions::FuncAddRoomMembers => "FUNC_ADD_ROOM_MEMBERS",
Functions::FuncRecvTransfer => "FUNC_RECV_TRANSFER",
Functions::FuncDecryptImage => "FUNC_DECRYPT_IMAGE",
} }
} }
/// Creates an enum from field names used in the ProtoBuf definition. /// Creates an enum from field names used in the ProtoBuf definition.
@ -299,6 +370,7 @@ impl Functions {
"FUNC_GET_CONTACTS" => Some(Self::FuncGetContacts), "FUNC_GET_CONTACTS" => Some(Self::FuncGetContacts),
"FUNC_GET_DB_NAMES" => Some(Self::FuncGetDbNames), "FUNC_GET_DB_NAMES" => Some(Self::FuncGetDbNames),
"FUNC_GET_DB_TABLES" => Some(Self::FuncGetDbTables), "FUNC_GET_DB_TABLES" => Some(Self::FuncGetDbTables),
"FUNC_GET_USER_INFO" => Some(Self::FuncGetUserInfo),
"FUNC_SEND_TXT" => Some(Self::FuncSendTxt), "FUNC_SEND_TXT" => Some(Self::FuncSendTxt),
"FUNC_SEND_IMG" => Some(Self::FuncSendImg), "FUNC_SEND_IMG" => Some(Self::FuncSendImg),
"FUNC_SEND_FILE" => Some(Self::FuncSendFile), "FUNC_SEND_FILE" => Some(Self::FuncSendFile),
@ -309,6 +381,8 @@ impl Functions {
"FUNC_EXEC_DB_QUERY" => Some(Self::FuncExecDbQuery), "FUNC_EXEC_DB_QUERY" => Some(Self::FuncExecDbQuery),
"FUNC_ACCEPT_FRIEND" => Some(Self::FuncAcceptFriend), "FUNC_ACCEPT_FRIEND" => Some(Self::FuncAcceptFriend),
"FUNC_ADD_ROOM_MEMBERS" => Some(Self::FuncAddRoomMembers), "FUNC_ADD_ROOM_MEMBERS" => Some(Self::FuncAddRoomMembers),
"FUNC_RECV_TRANSFER" => Some(Self::FuncRecvTransfer),
"FUNC_DECRYPT_IMAGE" => Some(Self::FuncDecryptImage),
_ => None, _ => None,
} }
} }

View File

@ -22,6 +22,14 @@ pub struct WeChat {
pub enable_accept_firend: bool, pub enable_accept_firend: bool,
} }
#[derive(Clone, Debug)]
pub struct UserInfo {
pub wxid: String,
pub name: String,
pub mobile: String,
pub home: String,
}
impl Default for WeChat { impl Default for WeChat {
fn default() -> Self { fn default() -> Self {
WeChat::new(false) WeChat::new(false)
@ -202,6 +210,36 @@ pub fn get_self_wx_id(wechat: &mut WeChat) -> Result<Option<String>, Box<dyn std
}; };
} }
pub fn get_user_info(wechat: &mut WeChat) -> Result<Option<UserInfo>, Box<dyn std::error::Error>> {
let req = wcf::Request {
func: wcf::Functions::FuncGetUserInfo.into(),
msg: None,
};
let response = match send_cmd(wechat, req) {
Ok(res) => res,
Err(e) => {
error!("命令发送失败: {}", e);
return Err("获取用户信息失败".into());
}
};
if response.is_none() {
return Ok(None);
}
match response.unwrap() {
wcf::response::Msg::Ui(user_info) => {
return Ok(Some(UserInfo {
wxid: user_info.wxid,
name: user_info.name,
mobile: user_info.mobile,
home: user_info.home,
}));
}
_ => {
return Ok(None);
}
};
}
pub fn get_contacts( pub fn get_contacts(
wechat: &mut WeChat, wechat: &mut WeChat,
) -> Result<Option<wcf::RpcContacts>, Box<dyn std::error::Error>> { ) -> Result<Option<wcf::RpcContacts>, Box<dyn std::error::Error>> {
@ -605,11 +643,12 @@ pub fn get_msg_types(
pub fn accept_new_friend( pub fn accept_new_friend(
v3: String, v3: String,
v4: String, v4: String,
scene: i32,
wechat: &mut WeChat, wechat: &mut WeChat,
) -> Result<bool, Box<dyn std::error::Error>> { ) -> Result<bool, Box<dyn std::error::Error>> {
let req = wcf::Request { let req = wcf::Request {
func: wcf::Functions::FuncAcceptFriend.into(), func: wcf::Functions::FuncAcceptFriend.into(),
msg: Some(wcf::request::Msg::V(wcf::Verification { v3, v4 })), msg: Some(wcf::request::Msg::V(wcf::Verification { v3, v4, scene })),
}; };
let response = match send_cmd(wechat, req) { let response = match send_cmd(wechat, req) {
Ok(res) => res, Ok(res) => res,
@ -660,6 +699,67 @@ pub fn add_chatroom_members(
}; };
} }
pub fn decrypt_image(
src: String,
dst: String,
wechat: &mut WeChat,
) -> Result<bool, Box<dyn std::error::Error>> {
let req = wcf::Request {
func: wcf::Functions::FuncDecryptImage.into(),
msg: Some(wcf::request::Msg::Dec(wcf::DecPath { src, dst })),
};
let response = match send_cmd(wechat, req) {
Ok(res) => res,
Err(e) => {
error!("命令发送失败: {}", e);
return Err("图片解密失败".into());
}
};
if response.is_none() {
return Ok(false);
}
match response.unwrap() {
wcf::response::Msg::Status(status) => {
return Ok(status == 1);
}
_ => {
return Ok(false);
}
};
}
pub fn recv_transfer(
wxid: String,
transferid: String,
wechat: &mut WeChat,
) -> Result<bool, Box<dyn std::error::Error>> {
let req = wcf::Request {
func: wcf::Functions::FuncRecvTransfer.into(),
msg: Some(wcf::request::Msg::Tf(wcf::Transfer {
wxid,
tid: transferid,
})),
};
let response = match send_cmd(wechat, req) {
Ok(res) => res,
Err(e) => {
error!("命令发送失败: {}", e);
return Err("接收转账失败".into());
}
};
if response.is_none() {
return Ok(false);
}
match response.unwrap() {
wcf::response::Msg::Status(status) => {
return Ok(status == 1);
}
_ => {
return Ok(false);
}
};
}
mod test { mod test {
#[test] #[test]
@ -743,7 +843,7 @@ mod test {
let mut wechat = crate::wechat::WeChat::default(); let mut wechat = crate::wechat::WeChat::default();
let v3 = String::from("v3_020b3826fd03010000000000d65613e9435fd2000000501ea9a3dba12f95f6b60a0536a1adb6b4e20a513856625d11892e0635fe745d9c7ee96937f341a860c34107c6417414e5b41e427fc3d26a6af2590a1f@stranger"); let v3 = String::from("v3_020b3826fd03010000000000d65613e9435fd2000000501ea9a3dba12f95f6b60a0536a1adb6b4e20a513856625d11892e0635fe745d9c7ee96937f341a860c34107c6417414e5b41e427fc3d26a6af2590a1f@stranger");
let v4 = String::from("v4_000b708f0b0400000100000000003c3767b326120d5b5795b98031641000000050ded0b020927e3c97896a09d47e6e9eac7eea28e4a39b49644b3b702b82268c1d40370261e3ae6eb543d231fbd29ee7a326598ba810316c10171871103ad967ca4d147d9f6dd8fa5ccd4986042520a1173c8138e5afe21f795ee50fecf58b4ac5269acd80028627dbf65fd17ca57c0e479fbe0392288a6f42@stranger"); let v4 = String::from("v4_000b708f0b0400000100000000003c3767b326120d5b5795b98031641000000050ded0b020927e3c97896a09d47e6e9eac7eea28e4a39b49644b3b702b82268c1d40370261e3ae6eb543d231fbd29ee7a326598ba810316c10171871103ad967ca4d147d9f6dd8fa5ccd4986042520a1173c8138e5afe21f795ee50fecf58b4ac5269acd80028627dbf65fd17ca57c0e479fbe0392288a6f42@stranger");
let status = crate::wechat::accept_new_friend(v3, v4, &mut wechat).unwrap(); let status = crate::wechat::accept_new_friend(v3, v4, 17, &mut wechat).unwrap();
println!("Status: {}", status); println!("Status: {}", status);
} }
@ -758,4 +858,35 @@ mod test {
.unwrap(); .unwrap();
println!("Status: {}", status); println!("Status: {}", status);
} }
#[test]
fn test_get_user_info() {
let mut wechat = crate::wechat::WeChat::default();
let user_info = crate::wechat::get_user_info(&mut wechat).unwrap();
println!("UserInfo: {:?}", user_info);
}
#[test]
fn test_recv_transfer() {
let mut wechat = crate::wechat::WeChat::default();
let status = crate::wechat::recv_transfer(
String::from("****"),
String::from("1000050001202305070217704377865"),
&mut wechat,
)
.unwrap();
println!("Status: {}", status);
}
#[test]
fn test_decrypt_image() {
let mut wechat = crate::wechat::WeChat::default();
let status = crate::wechat::decrypt_image(
String::from("C:\\Users\\Administrator\\Documents\\WeChat Files\\****\\FileStorage\\MsgAttach\\c963b851e0578c320c2966c6fc49e35c\\Image\\2023-05\\c66044e188c64452e236e53eff73324b.dat"),
String::from("C:\\foo"),
&mut wechat,
)
.unwrap();
println!("Status: {}", status);
}
} }