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
658eb93b
Commit
658eb93b
authored
Jun 13, 2022
by
zengtianlai3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
鉴权,Linux服务器本地动态库加载
parent
ca00070b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
17 deletions
+12
-17
DeviceManager.java
...c/main/java/iot/sixiang/license/device/DeviceManager.java
+2
-2
DeviceServerHandler.java
.../java/iot/sixiang/license/device/DeviceServerHandler.java
+4
-10
Safety.java
...se/src/main/java/iot/sixiang/license/idreader/Safety.java
+6
-5
No files found.
license/src/main/java/iot/sixiang/license/device/DeviceManager.java
View file @
658eb93b
...
@@ -38,8 +38,8 @@ public class DeviceManager {
...
@@ -38,8 +38,8 @@ public class DeviceManager {
@PostConstruct
@PostConstruct
public
void
init
()
{
public
void
init
()
{
//
startTcpService();
startTcpService
();
//
initDevices();
initDevices
();
}
}
private
void
startTcpService
()
{
private
void
startTcpService
()
{
...
...
license/src/main/java/iot/sixiang/license/device/DeviceServerHandler.java
View file @
658eb93b
...
@@ -156,17 +156,11 @@ public class DeviceServerHandler extends SimpleChannelInboundHandler<Object> {
...
@@ -156,17 +156,11 @@ public class DeviceServerHandler extends SimpleChannelInboundHandler<Object> {
private
boolean
handlerLicense
(
SocketChannel
channel
,
String
remoteIp
,
int
remotePort
,
DeviceProtocol
protocol
)
{
private
boolean
handlerLicense
(
SocketChannel
channel
,
String
remoteIp
,
int
remotePort
,
DeviceProtocol
protocol
)
{
// TODO 先统一放行,部署需要在公网服务器放置动态库
if
(
1
==
1
)
{
return
true
;
}
byte
[]
bytes
=
null
;
//TODO 正式代码要放开
//TODO 正式代码要放开
//
byte[] bytes = safety.decodeExtendedPayload(protocol.getContent(), 0, protocol.getContent().length);
byte
[]
bytes
=
safety
.
decodeExtendedPayload
(
protocol
.
getContent
(),
0
,
protocol
.
getContent
().
length
);
// if(bytes==null)
{
if
(
bytes
==
null
)
{
//
return false;
return
false
;
//
}
}
String
decodeInfo
=
new
String
(
bytes
,
0
,
bytes
.
length
);
String
decodeInfo
=
new
String
(
bytes
,
0
,
bytes
.
length
);
...
...
license/src/main/java/iot/sixiang/license/idreader/Safety.java
View file @
658eb93b
...
@@ -4,9 +4,10 @@ import org.springframework.stereotype.Component;
...
@@ -4,9 +4,10 @@ import org.springframework.stereotype.Component;
@Component
@Component
public
class
Safety
{
public
class
Safety
{
// static {
static
{
// System.loadLibrary("IdReaderSafetyLib");
// System.load("C:\\Program Files\\Java\\jdk1.8.0_231\\jre\\bin\\IdReaderSafetyLib.dll");//Windwos
// }
System
.
load
(
"/home/acc/server/license/file/libs/IdReaderSafetyLib.so"
);
//Linux
//
}
// public native byte[] decodeExtendedPayload(byte[] data, int offset, int length);
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