|
@@ -25,7 +25,7 @@ public class RegCodeUtil {
|
|
|
* @return:
|
|
|
**/
|
|
|
public static String GenRegeditCode(String machineCode){
|
|
|
- String s = Crypt.encryptAES(machineCode, true);
|
|
|
+ String s = Crypt.encryptAES(machineCode.trim(), true);
|
|
|
log.info("安装注册码:{}",s);
|
|
|
return s;
|
|
|
}
|
|
@@ -38,7 +38,7 @@ public class RegCodeUtil {
|
|
|
* @return:
|
|
|
**/
|
|
|
public static String GenRegeditCamCode(String plaintext){
|
|
|
- String s = Crypt.encryptAES(plaintext, true);
|
|
|
+ String s = Crypt.encryptAES(plaintext.trim(), true);
|
|
|
log.info("相机注册码:{}",s);
|
|
|
log.info("相机注册码原始长度:{}",s.length());
|
|
|
String code = DeflaterUtil.zipString(s);
|
|
@@ -56,7 +56,7 @@ public class RegCodeUtil {
|
|
|
**/
|
|
|
public static MachineRegDto ParseMachineCode(String plaintext){
|
|
|
try {
|
|
|
- String source = Crypt.decryptAES(plaintext, true);
|
|
|
+ String source = Crypt.decryptAES(plaintext.trim(), true);
|
|
|
log.info("相机注册码解密:{}",source);
|
|
|
MachineRegDto t = JSON.toJavaObject(JSONObject.parseObject(source) , MachineRegDto.class);
|
|
|
return t;
|
|
@@ -111,11 +111,11 @@ public class RegCodeUtil {
|
|
|
public static CamRegSDto BatchParseRegeditCamCode(String machineCode,String plaintext){
|
|
|
try {
|
|
|
//解压
|
|
|
- String code = DeflaterUtil.unzipString(plaintext);
|
|
|
+ String code = DeflaterUtil.unzipString(plaintext.trim());
|
|
|
log.info("批量生成相机码解压:{}",code);
|
|
|
String source = Crypt.decryptAES(code, true);
|
|
|
CamRegSDto t = JSON.toJavaObject(JSONObject.parseObject(source) , CamRegSDto.class);
|
|
|
- if (ObjUtil.isNull(t.getMachineCode()) && !t.getMachineCode().equals(machineCode)){
|
|
|
+ if (ObjUtil.isNull(t.getMachineCode()) && !t.getMachineCode().equals(machineCode.trim())){
|
|
|
throw new RuntimeException("校验失败");
|
|
|
}
|
|
|
return t;
|