Przeglądaj źródła

印章抽取优化

(cherry picked from commit cbe5ce2dc2bebe447a0d344da8dc4ea28c9bb801)
JustryDeng 3 lat temu
rodzic
commit
5a803ad40f

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

@@ -149,7 +149,7 @@ public class Reverses {
                     }
                     }
                     className = className.replace("/", ".").replace("\\", ".");
                     className = className.replace("/", ".").replace("\\", ".");
                     // 抽取印章
                     // 抽取印章
-                    extractSeal(projectPath, settingDecryptProjectPath);
+                    extractSeal(projectPath);
     
     
                     /// ============================================ 1.校验启动时是否输入了加密时指定的jvm参数   2.处理non-class文件
                     /// ============================================ 1.校验启动时是否输入了加密时指定的jvm参数   2.处理non-class文件
                     final String inputPwd = javaagentCmdArgs.getPassword();
                     final String inputPwd = javaagentCmdArgs.getPassword();
@@ -284,10 +284,8 @@ public class Reverses {
     
     
     /**
     /**
      * 抽取项目印章
      * 抽取项目印章
-     *
-     * @param settingDecryptProjectPath 是否指定了项目解密路径前缀
      */
      */
-    private static void extractSeal(String projectPath, boolean settingDecryptProjectPath) {
+    private static void extractSeal(String projectPath) {
         if (Cache.sealCache.containsKey(projectPath)) {
         if (Cache.sealCache.containsKey(projectPath)) {
             return;
             return;
         }
         }
@@ -295,8 +293,8 @@ public class Reverses {
             byte[] sealByte = IOUtil.readFileFromWorkbenchRoot(new File(projectPath), Constant.SEAL_FILE);
             byte[] sealByte = IOUtil.readFileFromWorkbenchRoot(new File(projectPath), Constant.SEAL_FILE);
             String sealContent = null;
             String sealContent = null;
             if (sealByte == null) {
             if (sealByte == null) {
-                // 在没有指定解密路径的情况下,没有获取到印章的话,那么获取第一个印章作为本projectPath的印章
-                if (!settingDecryptProjectPath && Cache.firstSealCache != null) {
+                // 在没有指定解密路径的情况下,获取第一个印章作为本projectPath的印章
+                if (Cache.firstSealCache != null) {
                     sealContent = Cache.firstSealCache;
                     sealContent = Cache.firstSealCache;
                     Logger.debug(Reverses.class, "Use first-seal as curr project seal.");
                     Logger.debug(Reverses.class, "Use first-seal as curr project seal.");
                 }
                 }