|
|
@@ -644,9 +644,8 @@ public class EncryptExecutor {
|
|
|
* @return 密码
|
|
|
*/
|
|
|
private char[] obtainPassword() {
|
|
|
- if (Cache.passwordCache != null) {
|
|
|
- // 从缓存读取
|
|
|
- return Cache.passwordCache;
|
|
|
+ if (Cache.passwordCacheForEncrypt.containsKey(this.originJarOrWar)) {
|
|
|
+ return Cache.passwordCacheForEncrypt.get(this.originJarOrWar);
|
|
|
}
|
|
|
boolean passwordIsBlank = StrUtil.isBlank(this.password);
|
|
|
if (passwordIsBlank) {
|
|
|
@@ -656,13 +655,13 @@ public class EncryptExecutor {
|
|
|
String encryptedGeneratedPwd = EncryptUtil.encrypt(new String(generatedPwd), Constant.SEAL.toCharArray());
|
|
|
IOUtil.writeContentToFile(encryptedGeneratedPwd, new File(targetRootDir, Constant.PWD_WINTER));
|
|
|
// 放入缓存
|
|
|
- Cache.passwordCache = generatedPwd;
|
|
|
+ Cache.passwordCacheForEncrypt.put(this.originJarOrWar, generatedPwd);
|
|
|
} else {
|
|
|
- Cache.passwordCache = this.password.toCharArray();
|
|
|
+ Cache.passwordCacheForEncrypt.put(this.originJarOrWar, this.password.toCharArray());
|
|
|
}
|
|
|
// 记录加密时,用户是否输入了密码
|
|
|
IOUtil.writeContentToFile(passwordIsBlank ? "false" : "true", new File(targetRootDir, Constant.USER_IF_INPUT_PWD));
|
|
|
- return Cache.passwordCache;
|
|
|
+ return Cache.passwordCacheForEncrypt.get(this.originJarOrWar);
|
|
|
}
|
|
|
|
|
|
/**
|