Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
haikang-client
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
杨立
haikang-client
Commits
2f7cf16c
提交
2f7cf16c
authored
3月 17, 2022
作者:
wangqiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
客户端更新
上级
394317ef
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
37 行增加
和
26 行删除
+37
-26
InstalledProgramCache.java
...rc/main/java/com/priusis/cache/InstalledProgramCache.java
+18
-12
MqttServiceImpl.java
...java/com/priusis/client/service/core/MqttServiceImpl.java
+9
-7
FacilityController.java
.../main/java/com/priusis/controller/FacilityController.java
+1
-0
ProgramController.java
...c/main/java/com/priusis/controller/ProgramController.java
+3
-1
MacAddrUtil.java
...c-common/src/main/java/com/priusis/utils/MacAddrUtil.java
+4
-4
apq-client-x32.iss
tools/install-package/boot/apq-client/apq-client-x32.iss
+2
-2
app.asar
...install-package/client/x32/client-soft/resources/app.asar
+0
-0
没有找到文件。
apq-pc-client/src/main/java/com/priusis/cache/InstalledProgramCache.java
浏览文件 @
2f7cf16c
...
...
@@ -32,30 +32,36 @@ public class InstalledProgramCache {
}
// @Scheduled(fixedDelay = 1800000)
// @Scheduled(fixedDelay = 1800000)
@Scheduled
(
fixedDelay
=
180000
)
public
void
loadProgramListJob
()
throws
IOException
{
public
void
loadProgramListJob
()
{
log
.
info
(
"load安装程序开始"
);
programInfoKey4NameCache
.
clear
();
List
<
Map
<
String
,
String
>>
programs
=
new
ArrayList
<>();
String
[]
regPaths
=
{
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\"
,
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\"
};
for
(
String
regPath
:
regPaths
)
{
Process
process
=
Runtime
.
getRuntime
().
exec
(
"cmd /c reg query "
+
regPath
);
try
(
BufferedReader
reader
=
new
BufferedReader
(
new
InputStreamReader
(
process
.
getInputStream
(),
"GBK"
)))
{
String
key
;
while
((
key
=
reader
.
readLine
())
!=
null
)
{
if
(
StrUtil
.
isBlank
(
key
))
{
continue
;
try
{
for
(
String
regPath
:
regPaths
)
{
Process
process
=
Runtime
.
getRuntime
().
exec
(
"cmd /c reg query "
+
regPath
);
try
(
BufferedReader
reader
=
new
BufferedReader
(
new
InputStreamReader
(
process
.
getInputStream
(),
"GBK"
)))
{
String
key
;
while
((
key
=
reader
.
readLine
())
!=
null
)
{
if
(
StrUtil
.
isBlank
(
key
))
{
continue
;
}
Map
<
String
,
String
>
info
=
queryProgramInfo
(
key
);
if
(
null
!=
info
)
programs
.
add
(
info
);
}
Map
<
String
,
String
>
info
=
queryProgramInfo
(
key
);
if
(
null
!=
info
)
programs
.
add
(
info
);
process
.
destroy
();
}
process
.
destroy
();
}
}
catch
(
IOException
e
)
{
log
.
error
(
"load安装程序异常"
,
e
);
}
programList
=
programs
;
log
.
info
(
"load安装程序结束,programs:{}"
,
programs
);
}
private
static
final
Map
<
String
,
Map
<
String
,
String
>>
programInfoCache
=
new
ConcurrentHashMap
<>();
...
...
apq-pc-client/src/main/java/com/priusis/client/service/core/MqttServiceImpl.java
浏览文件 @
2f7cf16c
...
...
@@ -14,11 +14,9 @@ import com.priusis.client.service.conf.*;
import
com.priusis.client.service.data.*
;
import
com.priusis.controller.ProgramController
;
import
com.priusis.controller.RemoteControlController
;
import
com.priusis.lib.R
;
import
com.priusis.monitor.mqtt.*
;
import
com.priusis.utils.MacAddrUtil
;
import
com.priusis.utils.ParseUrlUtil
;
import
com.priusis.utils.ProcessExtensionsApqUtil
;
import
com.priusis.utils.SysConfigUtil
;
import
com.priusis.utils.*
;
import
io.netty.buffer.ByteBuf
;
import
io.netty.channel.nio.NioEventLoopGroup
;
import
io.netty.handler.ssl.SslContext
;
...
...
@@ -396,7 +394,8 @@ public class MqttServiceImpl implements MqttService, MqttHandler, MqttClientCall
return
;
}
else
{
Long
minutes
=
Convert
.
toLong
(
mqttRpcDataMessage
.
getParams
());
remoteControlController
.
startVncServer
(
minutes
);
R
<
Void
>
startVncResult
=
remoteControlController
.
startVncServer
(
minutes
);
log
.
info
(
"远程控制请求接受!!! startVncResult: {}"
,
startVncResult
.
getMsg
());
return
;
}
}
...
...
@@ -408,8 +407,11 @@ public class MqttServiceImpl implements MqttService, MqttHandler, MqttClientCall
if
(
"remote_rtc"
.
equals
(
mqttRpcDataMessage
.
getMethod
()))
{
log
.
info
(
"收到语音通话请求"
);
try
{
String
apqExePath
=
ParseUrlUtil
.
parseAbsolutePath
(
"apq.exe"
,
"../../../tools/install-package/client/x64/client-soft"
,
"../client-soft"
);
ProcessExtensionsApqUtil
.
apq_CreateProcessAsUser
(
apqExePath
);
boolean
hasApqExeProcess
=
WinExecuteUtils
.
findProcess
(
"apq.exe"
);
if
(!
hasApqExeProcess
)
{
String
apqExePath
=
ParseUrlUtil
.
parseAbsolutePath
(
"apq.exe"
,
"../../../tools/install-package/client/x64/client-soft"
,
"../client-soft"
);
ProcessExtensionsApqUtil
.
apq_CreateProcessAsUser
(
apqExePath
);
}
SysConfigUtil
.
saveProperty
(
"control.request"
,
"2"
);
}
catch
(
Exception
e
)
{
log
.
error
(
"语音通话请求异常"
,
e
);
...
...
apq-pc-client/src/main/java/com/priusis/controller/FacilityController.java
浏览文件 @
2f7cf16c
...
...
@@ -33,6 +33,7 @@ public class FacilityController {
public
R
voiceCall
()
{
String
reqUrl
=
gateway
+
voiceCallUrl
;
String
mac
=
MacAddrUtil
.
get
();
// String mac = "68:ED:A4:1D:E8:00";
JSONObject
rsp
=
JSONUtil
.
parseObj
(
HttpUtil
.
post
(
reqUrl
,
JSONUtil
.
createObj
().
set
(
"macAddress"
,
mac
).
toString
()));
if
(
ObjectUtil
.
notEqual
(
rsp
.
getInt
(
"code"
),
0
))
return
R
.
error
(
rsp
.
getStr
(
"msg"
));
...
...
apq-pc-client/src/main/java/com/priusis/controller/ProgramController.java
浏览文件 @
2f7cf16c
...
...
@@ -310,6 +310,7 @@ public class ProgramController {
// 已安装软件列表
List
<
FacilityProgramVo
>
programNames
=
installedProgramCache
.
getPrograms
()
.
stream
().
map
(
FacilityProgramVo:
:
toFacilityProgramVoFromCache
).
sorted
().
collect
(
Collectors
.
toList
());
log
.
info
(
"收到平台扫描软件请求,已安装软件:{}"
,
programNames
.
size
());
// 扫描进程列表
Set
<
String
>
processNames
=
new
HashSet
<>();
Process
process
=
Runtime
.
getRuntime
().
exec
(
"cmd /c tasklist"
...
...
@@ -337,13 +338,14 @@ public class ProgramController {
for
(
String
processName
:
processNames
)
{
processNameVos
.
add
(
FacilityProgramVo
.
toFacilityProgramVoFromProcessName
(
processName
));
}
log
.
info
(
"收到平台扫描软件请求,扫描进程列表:{}"
,
processNameVos
.
size
());
String
postResult
=
HttpUtil
.
post
(
gateway
+
addProgramUrl
,
JSONUtil
.
createObj
()
.
set
(
"macAddress"
,
mac
)
.
set
(
"programList"
,
programNames
)
.
set
(
"processList"
,
processNameVos
)
.
toString
());
log
.
info
(
"设备软件扫描,result:{}
"
,
postResult
);
log
.
info
(
"设备软件扫描,result:{}
,programList:{},processList:{}"
,
postResult
,
programNames
.
size
(),
processNameVos
.
size
()
);
}
private
boolean
containsOfCache
(
String
taskProcess
)
{
...
...
apq-pc-common/src/main/java/com/priusis/utils/MacAddrUtil.java
浏览文件 @
2f7cf16c
package
com
.
priusis
.
utils
;
import
cn.hutool.core.util.ArrayUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.system.oshi.OshiUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.hyperic.sigar.NetFlags
;
import
org.hyperic.sigar.NetInterfaceConfig
;
import
org.hyperic.sigar.Sigar
;
import
org.hyperic.sigar.SigarException
;
import
oshi.hardware.NetworkIF
;
/**
* @author yangli
...
...
@@ -35,4 +31,8 @@ public final class MacAddrUtil {
}
return
null
;
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
MacAddrUtil
.
get
());
}
}
tools/install-package/boot/apq-client/apq-client-x32.iss
浏览文件 @
2f7cf16c
...
...
@@ -2,8 +2,8 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "阿普奇检测客户端"
#define MyAppVersion "V1.0"
#define MyAppPublisher "阿普奇"
#define MyAppVersion "V1.0"
#define MyAppPublisher "阿普奇"
#define MyAppURL "https://www.apq.com/"
#define MyAppDirName "apq-client"
#define MyAppEnName "apq-client"
...
...
tools/install-package/client/x32/client-soft/resources/app.asar
浏览文件 @
2f7cf16c
No preview for this file type
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论