Commit 658eb93b authored by zengtianlai3's avatar zengtianlai3

鉴权,Linux服务器本地动态库加载

parent ca00070b
...@@ -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() {
......
...@@ -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);
......
...@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment