diff --git a/src/main/java/com/free/bsf/jarprotect/core/encrypt/EncryptFactory.java b/src/main/java/com/free/bsf/jarprotect/core/encrypt/EncryptFactory.java index 94b6e01f596dfdfc503b5f755270b5f4cc989c8c..35f0cfa0c5368a5753a445b39a80ce259bc5c249 100644 --- a/src/main/java/com/free/bsf/jarprotect/core/encrypt/EncryptFactory.java +++ b/src/main/java/com/free/bsf/jarprotect/core/encrypt/EncryptFactory.java @@ -10,8 +10,7 @@ public class EncryptFactory { public static synchronized IEncrypt get(){ if(OBJ!=null){ return OBJ; - } - if(!StringUtils.isEmpty(Context.Default.getMyEncryptCodeFile())) { + }else if(!StringUtils.isEmpty(Context.Default.getMyEncryptCodeFile())) { File file = new File(Context.Default.getMyEncryptCodeFile()); String code=null; if(file.exists()) { @@ -26,8 +25,7 @@ public class EncryptFactory { }catch (Exception e){ throw new BsfException("初始化动态加密算法失败",e); } - } - if(!StringUtils.isEmpty(Context.Default.getMyDecryptCode())) { + }else if(!StringUtils.isEmpty(Context.Default.getMyDecryptCode())) { byte[] classBytes =CommonUtils.decryptCode(Context.Default.getMyDecryptCode());; try { Object encrypt = CommonUtils.loadClass(Context.Default.Pool,classBytes).toClass().newInstance(); @@ -35,8 +33,9 @@ public class EncryptFactory { }catch (Exception e){ throw new BsfException("初始化动态解密算法失败",e); } + }else{ + OBJ = new EncryptDES(); } - OBJ = new EncryptDES(); return OBJ; } }