1. 修改win助手,支持远程连接时用户手动输入密码;

2. 版本号升级到3.6.3-b2。
feature/assist-websocket
Apex Liu 2022-06-02 01:00:14 +08:00
parent 9df6e8c232
commit 2d701bfc09
13 changed files with 1188 additions and 1098 deletions

View File

@ -1,4 +1,4 @@
# -*- coding: utf8 -*-
VER_TP_SERVER = "3.6.2"
VER_TP_ASSIST = "3.6.1"
VER_TP_STATE = "b1"
VER_TP_SERVER = "3.6.3"
VER_TP_ASSIST = "3.6.3"
VER_TP_STATE = "b2"

View File

@ -599,7 +599,7 @@
buildSettings = {
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3.6.1;
CURRENT_PROJECT_VERSION = 3.6.3;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "src/TP-Assist-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
@ -617,7 +617,7 @@
INFOPLIST_FILE = "src/TP-Assist-Info.plist";
LIBRARY_SEARCH_PATHS = ../../external/macos/release/lib;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 3.6.1;
MARKETING_VERSION = 3.6.3;
PRODUCT_BUNDLE_IDENTIFIER = "teleport.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
VALID_ARCHS = x86_64;
@ -630,7 +630,7 @@
buildSettings = {
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3.6.1;
CURRENT_PROJECT_VERSION = 3.6.3;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "src/TP-Assist-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
@ -647,7 +647,7 @@
INFOPLIST_FILE = "src/TP-Assist-Info.plist";
LIBRARY_SEARCH_PATHS = ../../external/macos/release/lib;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 3.6.1;
MARKETING_VERSION = 3.6.3;
PRODUCT_BUNDLE_IDENTIFIER = "teleport.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
VALID_ARCHS = x86_64;

View File

@ -1,6 +1,6 @@
#ifndef __TS_ASSIST_VER_H__
#define __TS_ASSIST_VER_H__
#define TP_ASSIST_VER L"3.6.1"
#define TP_ASSIST_VER L"3.6.3"
#endif // __TS_ASSIST_VER_H__

Binary file not shown.

View File

@ -1,6 +1,6 @@
#ifndef __TS_ASSIST_VER_H__
#define __TS_ASSIST_VER_H__
#define TP_ASSIST_VER L"3.6.1"
#define TP_ASSIST_VER L"3.6.3"
#endif // __TS_ASSIST_VER_H__

View File

@ -490,6 +490,8 @@ void TsWsClient::_on_message(const std::string& message, std::string& buf)
// }
// }
EXLOGW("on-message:\n", message.c_str());
AssistMessage msg_req;
Json::CharReaderBuilder jrb;
@ -761,6 +763,22 @@ void TsWsClient::_rpc_func_run_client(ex_astr& buf, AssistMessage& msg_req, Json
return;
}
const char* interactive_mode = "no";
bool is_interactive_mode = false;
if (!js_param["is_interactive"].isNull())
{
if (!js_param["is_interactive"].isBool())
{
_create_response(buf, msg_req, TPE_PARAM);
return;
}
if (js_param["is_interactive"].asBool())
{
interactive_mode = "yes";
is_interactive_mode = true;
}
}
int pro_type = js_param["protocol_type"].asUInt();
int pro_sub = js_param["protocol_sub_type"].asInt();
ex_u32 protocol_flag = js_param["protocol_flag"].asUInt();
@ -836,18 +854,18 @@ void TsWsClient::_rpc_func_run_client(ex_astr& buf, AssistMessage& msg_req, Json
rdp_console = false;
int split_pos = sid.length() - 2;
ex_astr real_sid = sid.substr(0, split_pos);
ex_astr str_pwd_len = sid.substr(split_pos, sid.length());
int n_pwd_len = strtol(str_pwd_len.c_str(), nullptr, 16);
n_pwd_len -= real_sid.length();
n_pwd_len -= 2;
char szPwd[256] = { 0 };
for (int i = 0; i < n_pwd_len; i++) {
szPwd[i] = '*';
}
//int split_pos = sid.length() - 2;
//ex_astr real_sid = sid.substr(0, split_pos);
//ex_astr str_pwd_len = sid.substr(split_pos, sid.length());
//int n_pwd_len = strtol(str_pwd_len.c_str(), nullptr, 16);
//n_pwd_len -= real_sid.length();
//n_pwd_len -= 2;
//char szPwd[256] = { 0 };
//for (int i = 0; i < n_pwd_len; i++) {
// szPwd[i] = '*';
//}
ex_astr2wstr(real_sid, w_sid);
//ex_astr2wstr(real_sid, w_sid);
w_exe_path = _T("\"");
w_exe_path += g_cfg.rdp.application + _T("\" ");
@ -891,13 +909,14 @@ void TsWsClient::_rpc_func_run_client(ex_astr& buf, AssistMessage& msg_req, Json
// console_mode = 1;
std::string psw51b;
if (!calc_psw51b(szPwd, psw51b)) {
// if (!calc_psw51b(szPwd, psw51b))
if (!calc_psw51b("******", psw51b)) {
EXLOGE("calc password failed.\n");
_create_response(buf, msg_req, TPE_PARAM);
return;
}
real_sid = "01" + real_sid;
//real_sid = "01" + real_sid;
char sz_rdp_file_content[4096] = { 0 };
sprintf_s(sz_rdp_file_content, 4096, rdp_content.c_str()
@ -907,7 +926,8 @@ void TsWsClient::_rpc_func_run_client(ex_astr& buf, AssistMessage& msg_req, Json
, teleport_ip.c_str(), teleport_port
, flag_clipboard ? 1 : 0
, flag_disk ? "*" : ""
, real_sid.c_str()
//, real_sid.c_str()
, sid.c_str()
, psw51b.c_str()
);
@ -967,8 +987,9 @@ void TsWsClient::_rpc_func_run_client(ex_astr& buf, AssistMessage& msg_req, Json
// }
ex_wstr w_password;
ex_astr2wstr(szPwd, w_password);
w_exe_path += L" /p:";
//ex_astr2wstr(szPwd, w_password);
//w_exe_path += L" /p:";
w_exe_path += L" /p:******";
w_exe_path += w_password;
w_sid = L"02" + w_sid;
@ -1026,6 +1047,75 @@ void TsWsClient::_rpc_func_run_client(ex_astr& buf, AssistMessage& msg_req, Json
w_exe_path += g_cfg.telnet.cmdline;
}
//---- split s_arg and push to s_argv ---
ex_wstr::size_type p1 = 0;
ex_wstr::size_type p2 = 0;
int i = 0;
// 防止死循环替换10个应该够了
for (i = 0; i < 10; ++i)
{
p1 = w_exe_path.find(L"{password:");
if (p1 != ex_wstr::npos)
{
p2 = w_exe_path.find(L'}', p1 + 10);
if (p2 == ex_wstr::npos)
{
_create_response(buf, msg_req, TPE_PARAM);
return;
}
if (is_interactive_mode)
{
// 如果需要用户自己输入密码,则客户端命令行就不能带密码字段,需要抹去这个参数
w_exe_path.erase(p1, p2 - p1 + 1);
}
else
{
w_exe_path.erase(p2, 1);
w_exe_path.erase(p1, 10);
}
}
else
{
break;
}
}
for (i = 0; i < 10; ++i)
{
p1 = w_exe_path.find(L"{interactive:");
if (p1 != ex_wstr::npos)
{
p2 = w_exe_path.find('}', p1 + 13);
if (p2 == ex_wstr::npos)
{
_create_response(buf, msg_req, TPE_PARAM);
return;
}
if (!is_interactive_mode)
{
// 如果无需用户自己输入密码,则需要抹去这个参数
w_exe_path.erase(p1, p2 - p1 + 1);
}
else
{
w_exe_path.erase(p2, 1);
w_exe_path.erase(p1, 13);
}
}
else
{
break;
}
}
ex_replace_all(w_exe_path, _T("{host_ip}"), w_teleport_ip.c_str());
ex_replace_all(w_exe_path, _T("{host_port}"), w_port);
ex_replace_all(w_exe_path, _T("{user_name}"), w_sid.c_str());

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,6 @@
#ifndef __TS_SERVER_VER_H__
#define __TS_SERVER_VER_H__
#define TP_SERVER_VER L"3.6.2"
#define TP_SERVER_VER L"3.6.3"
#endif // __TS_SERVER_VER_H__

Binary file not shown.

View File

@ -1,6 +1,6 @@
#ifndef __TS_SERVER_VER_H__
#define __TS_SERVER_VER_H__
#define TP_SERVER_VER L"3.1.0"
#define TP_SERVER_VER L"3.1.1"
#endif // __TS_SERVER_VER_H__

View File

@ -1,4 +1,4 @@
# -*- coding: utf8 -*-
TP_SERVER_VER = "3.6.2"
TP_ASSIST_REQUIRE_VER = "3.6.1"
TP_STATE_VER = "b1"
TP_SERVER_VER = "3.6.3"
TP_ASSIST_REQUIRE_VER = "3.6.3"
TP_STATE_VER = "b2"

View File

@ -10,9 +10,9 @@ Minor: 次版本号。如果两个程序集的名称和主版本号相同,而
Revision: 修订号。主版本号和次版本号都相同但修订号不同的程序集应是完全可互换的。
这适用于修复以前发布的程序集中的错误或安全漏洞。
TP_SERVER 3.6.2 # 整个服务端打包的版本
TP_TPCORE 3.6.2 # 核心服务 tp_core 的版本
TP_TPWEB 3.1.0 # web服务 tp_web 的版本一般除非升级Python否则不会变化
TP_ASSIST 3.6.1 # 助手版本
TP_ASSIST_REQUIRE 3.6.1 # 适配的助手最低版本
TP_STATE b1 # 版本状态,可以是 beta1rc2 等,用于打包文件名及部分界面。如果是 release 则界面上不显示。
TP_SERVER 3.6.3 # 整个服务端打包的版本
TP_TPCORE 3.6.3 # 核心服务 tp_core 的版本
TP_TPWEB 3.1.1 # web服务 tp_web 的版本一般除非升级Python否则不会变化
TP_ASSIST 3.6.3 # 助手版本
TP_ASSIST_REQUIRE 3.6.3 # 适配的助手最低版本
TP_STATE b2 # 版本状态,可以是 beta1rc2 等,用于打包文件名及部分界面。如果是 release 则界面上不显示。