Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ioc_sixiang_license
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zengtianlai3
ioc_sixiang_license
Commits
c68f08a2
Commit
c68f08a2
authored
Jun 11, 2022
by
zengtianlai3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
公网不存在动态库,部署失败,屏蔽动态库鉴权功能,统一放行
parent
f40088ce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
13 deletions
+18
-13
DeviceManager.java
...c/main/java/iot/sixiang/license/device/DeviceManager.java
+2
-4
DeviceServerHandler.java
.../java/iot/sixiang/license/device/DeviceServerHandler.java
+11
-3
Safety.java
...se/src/main/java/iot/sixiang/license/idreader/Safety.java
+5
-6
No files found.
license/src/main/java/iot/sixiang/license/device/DeviceManager.java
View file @
c68f08a2
package
iot
.
sixiang
.
license
.
device
;
import
iot.sixiang.license.forward.ForwardManager
;
import
iot.sixiang.license.model.PageInfoModel
;
import
iot.sixiang.license.model.SessionContext
;
import
iot.sixiang.license.model.vo.DeviceVo
;
...
...
@@ -32,7 +31,6 @@ public class DeviceManager {
@Autowired
private
DeviceServerHandler
handler
;
public
DeviceManager
()
{
sessionContexts
=
new
HashMap
<
String
,
SessionContext
>();
allDevice
=
new
HashMap
<
String
,
DeviceVo
>();
...
...
@@ -40,8 +38,8 @@ public class DeviceManager {
@PostConstruct
public
void
init
()
{
startTcpService
();
initDevices
();
//
startTcpService();
//
initDevices();
}
private
void
startTcpService
()
{
...
...
license/src/main/java/iot/sixiang/license/device/DeviceServerHandler.java
View file @
c68f08a2
...
...
@@ -155,11 +155,19 @@ public class DeviceServerHandler extends SimpleChannelInboundHandler<Object> {
private
boolean
handlerLicense
(
SocketChannel
channel
,
String
remoteIp
,
int
remotePort
,
DeviceProtocol
protocol
)
{
byte
[]
bytes
=
safety
.
decodeExtendedPayload
(
protocol
.
getContent
(),
0
,
protocol
.
getContent
().
length
);
if
(
bytes
==
null
){
return
false
;
// TODO 先统一放行,部署需要在公网服务器放置动态库
if
(
1
==
1
)
{
return
true
;
}
byte
[]
bytes
=
null
;
//TODO 正式代码要放开
// byte[] bytes = safety.decodeExtendedPayload(protocol.getContent(), 0, protocol.getContent().length);
// if(bytes==null){
// return false;
// }
String
decodeInfo
=
new
String
(
bytes
,
0
,
bytes
.
length
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
decodeInfo
);
...
...
license/src/main/java/iot/sixiang/license/idreader/Safety.java
View file @
c68f08a2
package
iot
.
sixiang
.
license
.
idreader
;
import
lombok.Data
;
import
org.springframework.stereotype.Component
;
@Component
public
class
Safety
{
static
{
System
.
loadLibrary
(
"IdReaderSafetyLib"
);
}
public
native
byte
[]
decodeExtendedPayload
(
byte
[]
data
,
int
offset
,
int
length
);
//
static {
//
System.loadLibrary("IdReaderSafetyLib");
//
}
//
//
public native byte[] decodeExtendedPayload(byte[] data, int offset, int length);
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment