|
|
@@ -101,20 +101,27 @@ public class DecryptExecutor {
|
|
|
* @return classLongName是否在(记录已加密类的)清单列表中
|
|
|
*/
|
|
|
public static boolean checklistContain(String projectPath, String classLongName) {
|
|
|
- // 如果当前projectPath的印章,用的是Cache.firstSealCache的话,那么此方法中获取checklist,也获取Cache.firstSealCache对应的checklist
|
|
|
- projectPath = Cache.firstSealCache.equals(Cache.sealCache.get(projectPath)) ? Cache.firstSealProjectPath : projectPath;
|
|
|
+ // step1. 试着直接获取对应projectPath的checklist
|
|
|
if (!checklist.containsKey(projectPath)) {
|
|
|
byte[] checklistByte = IOUtil.readFileFromWorkbenchRoot(new File(projectPath),
|
|
|
Constant.ALREADY_ENCRYPTED_CLASS_CHECKLIST_CLASSES_SAVE_FILE);
|
|
|
- if (checklistByte == null) {
|
|
|
- Logger.debug(DecryptExecutor.class, "checklistByte is null. ");
|
|
|
- } else {
|
|
|
+ if (checklistByte != null) {
|
|
|
String checklistContent = new String(checklistByte, StandardCharsets.UTF_8);
|
|
|
Logger.debug(DecryptExecutor.class, "checklistContent " + checklistContent);
|
|
|
checklist.put(projectPath, new HashSet<>(Arrays.asList(checklistContent.split(Constant.COMMA))));
|
|
|
}
|
|
|
}
|
|
|
- return checklist.get(projectPath).contains(classLongName);
|
|
|
+ if (checklist.containsKey(projectPath)) {
|
|
|
+ return checklist.get(projectPath).contains(classLongName);
|
|
|
+ }
|
|
|
+
|
|
|
+ // step2. 若当前projectPath与第一个projectPath使用相同的印章,那么使用第一个projectPath对应的checklist
|
|
|
+ if (Cache.firstSealCache.equals(Cache.sealCache.get(projectPath))) {
|
|
|
+ Set<String> firstChecklist = checklist.get(Cache.firstSealProjectPath);
|
|
|
+ checklist.put(projectPath, firstChecklist == null ? new HashSet<>() : firstChecklist);
|
|
|
+ return checklist.get(projectPath).contains(classLongName);
|
|
|
+ }
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
/**
|