|
@@ -328,9 +328,10 @@ public class DecryptExecutor {
|
|
|
private static char[] obtainAutoGeneratedPwdWhileEncrypt(String projectPath, String classWinterInfoDir) {
|
|
private static char[] obtainAutoGeneratedPwdWhileEncrypt(String projectPath, String classWinterInfoDir) {
|
|
|
// 项目本身
|
|
// 项目本身
|
|
|
if (classWinterInfoDir.equals(Constant.DEFAULT_ENCRYPTED_BASE_SAVE_DIR)) {
|
|
if (classWinterInfoDir.equals(Constant.DEFAULT_ENCRYPTED_BASE_SAVE_DIR)) {
|
|
|
- if (Cache.passwordCacheForDecrypt != null) {
|
|
|
|
|
|
|
+ char[] pwd = Cache.passwordCacheForDecrypt.get(projectPath);
|
|
|
|
|
+ if (pwd != null) {
|
|
|
// 从缓存读取
|
|
// 从缓存读取
|
|
|
- return Cache.passwordCacheForDecrypt;
|
|
|
|
|
|
|
+ return pwd;
|
|
|
}
|
|
}
|
|
|
// 读取文件
|
|
// 读取文件
|
|
|
byte[] passwordByte = IOUtil.readFileFromWorkbenchRoot(new File(projectPath), Constant.PWD_WINTER);
|
|
byte[] passwordByte = IOUtil.readFileFromWorkbenchRoot(new File(projectPath), Constant.PWD_WINTER);
|
|
@@ -345,8 +346,8 @@ public class DecryptExecutor {
|
|
|
String password = new String(passwordByte, StandardCharsets.UTF_8);
|
|
String password = new String(passwordByte, StandardCharsets.UTF_8);
|
|
|
char[] passwordCharArr = password.toCharArray();
|
|
char[] passwordCharArr = password.toCharArray();
|
|
|
// 放入缓存
|
|
// 放入缓存
|
|
|
- Cache.passwordCacheForDecrypt = passwordCharArr;
|
|
|
|
|
- return passwordCharArr;
|
|
|
|
|
|
|
+ Cache.passwordCacheForDecrypt.put(projectPath, passwordCharArr);
|
|
|
|
|
+ return Cache.passwordCacheForDecrypt.get(projectPath);
|
|
|
} else {
|
|
} else {
|
|
|
// lib包
|
|
// lib包
|
|
|
if (Cache.libPasswordCache != null && Cache.libPasswordCache.containsKey(classWinterInfoDir)) {
|
|
if (Cache.libPasswordCache != null && Cache.libPasswordCache.containsKey(classWinterInfoDir)) {
|