Commit c68f08a2 authored by zengtianlai3's avatar zengtianlai3

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

parent f40088ce
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() {
......
......@@ -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);
......
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
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