Quellcode durchsuchen

fixbug https://gitee.com/JustryDeng/class-winter/issues/I7D9UW

JustryDeng vor 3 Jahren
Ursprung
Commit
6403247c15

+ 2 - 2
class-winter-core/src/main/java/winter/com/ideaaedi/classwinter/Reverses.java

@@ -313,8 +313,8 @@ public class Reverses {
             if (Cache.firstSealCache == null) {
                 Cache.firstSealCache = sealContent;
                 Cache.firstSealProjectPath = projectPath;
-                Logger.error(Reverses.class, "first-seal found. projectPath -> " + Cache.firstSealProjectPath);
-                Logger.error(Reverses.class, "first-seal found. sealContent -> " + Cache.firstSealCache);
+                Logger.debug(Reverses.class, "first-seal found. projectPath -> " + Cache.firstSealProjectPath);
+                Logger.debug(Reverses.class, "first-seal found. sealContent -> " + Cache.firstSealCache);
             }
         } catch (Exception e) {
             Logger.error(Reverses.class, "Obtain project seal fail.");

+ 2 - 0
class-winter-core/src/main/java/winter/com/ideaaedi/classwinter/executor/DecryptExecutor.java

@@ -100,6 +100,8 @@ 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;
         if (!checklist.containsKey(projectPath)) {
             byte[] checklistByte = IOUtil.readFileFromWorkbenchRoot(new File(projectPath),
                     Constant.ALREADY_ENCRYPTED_CLASS_CHECKLIST_CLASSES_SAVE_FILE);

BIN
class-winter-core/src/test/resources/class-winter-core-2.8.0.jar