Commit c68f08a2 authored by zengtianlai3's avatar zengtianlai3

公网不存在动态库,部署失败,屏蔽动态库鉴权功能,统一放行

parent f40088ce
package iot.sixiang.license.device; package iot.sixiang.license.device;
import iot.sixiang.license.forward.ForwardManager;
import iot.sixiang.license.model.PageInfoModel; import iot.sixiang.license.model.PageInfoModel;
import iot.sixiang.license.model.SessionContext; import iot.sixiang.license.model.SessionContext;
import iot.sixiang.license.model.vo.DeviceVo; import iot.sixiang.license.model.vo.DeviceVo;
...@@ -32,7 +31,6 @@ public class DeviceManager { ...@@ -32,7 +31,6 @@ public class DeviceManager {
@Autowired @Autowired
private DeviceServerHandler handler; private DeviceServerHandler handler;
public DeviceManager() { public DeviceManager() {
sessionContexts = new HashMap<String, SessionContext>(); sessionContexts = new HashMap<String, SessionContext>();
allDevice = new HashMap<String, DeviceVo>(); allDevice = new HashMap<String, DeviceVo>();
...@@ -40,8 +38,8 @@ public class DeviceManager { ...@@ -40,8 +38,8 @@ public class DeviceManager {
@PostConstruct @PostConstruct
public void init() { public void init() {
startTcpService(); // startTcpService();
initDevices(); // initDevices();
} }
private void startTcpService() { private void startTcpService() {
......
...@@ -155,11 +155,19 @@ public class DeviceServerHandler extends SimpleChannelInboundHandler<Object> { ...@@ -155,11 +155,19 @@ 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) {
byte[] bytes = safety.decodeExtendedPayload(protocol.getContent(), 0, protocol.getContent().length);
if(bytes==null){ // TODO 先统一放行,部署需要在公网服务器放置动态库
return false; 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); String decodeInfo = new String(bytes, 0, bytes.length);
JSONObject jsonObject = JSON.parseObject(decodeInfo); JSONObject jsonObject = JSON.parseObject(decodeInfo);
......
package iot.sixiang.license.idreader; package iot.sixiang.license.idreader;
import lombok.Data;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@Component @Component
public class Safety { public class Safety {
static { // static {
System.loadLibrary("IdReaderSafetyLib"); // System.loadLibrary("IdReaderSafetyLib");
} // }
//
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