|
@@ -122,7 +122,7 @@ public class EncryptExecutor {
|
|
|
/**
|
|
/**
|
|
|
* xml中要清除的(根节点的)子节点名称
|
|
* xml中要清除的(根节点的)子节点名称
|
|
|
*/
|
|
*/
|
|
|
- private final Set<String> toCleanChildElementNameSet;
|
|
|
|
|
|
|
+ private final Set<String> toCleanXmlChildElementNameSet;
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -199,7 +199,7 @@ public class EncryptExecutor {
|
|
|
|
|
|
|
|
private EncryptExecutor(String originJarOrWar, boolean originIsJar, String finalName, String targetRootDir,
|
|
private EncryptExecutor(String originJarOrWar, boolean originIsJar, String finalName, String targetRootDir,
|
|
|
String targetLibDir, String targetClassesDir, String password,
|
|
String targetLibDir, String targetClassesDir, String password,
|
|
|
- Set<String> includeXmlPrefixSet, Set<String> excludeXmlPrefixSet, Set<String> toCleanChildElementNameSet,
|
|
|
|
|
|
|
+ Set<String> includeXmlPrefixSet, Set<String> excludeXmlPrefixSet, Set<String> toCleanXmlChildElementNameSet,
|
|
|
Set<String> includePrefixSet, Set<String> excludePrefixSet, Set<String> includeLibSet,
|
|
Set<String> includePrefixSet, Set<String> excludePrefixSet, Set<String> includeLibSet,
|
|
|
Set<Pair<String, String>> alreadyProtectedLibSet, String supportFile) {
|
|
Set<Pair<String, String>> alreadyProtectedLibSet, String supportFile) {
|
|
|
this.originJarOrWar = originJarOrWar;
|
|
this.originJarOrWar = originJarOrWar;
|
|
@@ -211,7 +211,7 @@ public class EncryptExecutor {
|
|
|
this.password = password;
|
|
this.password = password;
|
|
|
this.includeXmlPrefixSet = includeXmlPrefixSet;
|
|
this.includeXmlPrefixSet = includeXmlPrefixSet;
|
|
|
this.excludeXmlPrefixSet = excludeXmlPrefixSet;
|
|
this.excludeXmlPrefixSet = excludeXmlPrefixSet;
|
|
|
- this.toCleanChildElementNameSet = toCleanChildElementNameSet;
|
|
|
|
|
|
|
+ this.toCleanXmlChildElementNameSet = toCleanXmlChildElementNameSet;
|
|
|
this.includePrefixSet = includePrefixSet;
|
|
this.includePrefixSet = includePrefixSet;
|
|
|
this.excludePrefixSet = excludePrefixSet;
|
|
this.excludePrefixSet = excludePrefixSet;
|
|
|
this.includeLibSet = includeLibSet;
|
|
this.includeLibSet = includeLibSet;
|
|
@@ -345,7 +345,7 @@ public class EncryptExecutor {
|
|
|
// 清空原xml文件的关键节点
|
|
// 清空原xml文件的关键节点
|
|
|
for (String zipEntryName : encryptNonClassFileSet) {
|
|
for (String zipEntryName : encryptNonClassFileSet) {
|
|
|
byte[] bytes = IOUtil.readFileFromWorkbenchRoot(targetRootDirFile, zipEntryName);
|
|
byte[] bytes = IOUtil.readFileFromWorkbenchRoot(targetRootDirFile, zipEntryName);
|
|
|
- String cleanedXml = clearXml(new String(bytes, StandardCharsets.UTF_8), Constant.XML_PADDING_COMMENT, toCleanChildElementNameSet);
|
|
|
|
|
|
|
+ String cleanedXml = clearXml(new String(bytes, StandardCharsets.UTF_8), "\n\t\t\t" + Constant.TIPS + "\n\t\t\t" + Constant.SEAL, toCleanXmlChildElementNameSet);
|
|
|
IOUtil.writeContentToFile(cleanedXml, new File(targetRootDir, zipEntryName));
|
|
IOUtil.writeContentToFile(cleanedXml, new File(targetRootDir, zipEntryName));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -908,7 +908,7 @@ public class EncryptExecutor {
|
|
|
", excludePrefixSet=" + excludePrefixSet +
|
|
", excludePrefixSet=" + excludePrefixSet +
|
|
|
", includeXmlPrefixSet=" + includeXmlPrefixSet +
|
|
", includeXmlPrefixSet=" + includeXmlPrefixSet +
|
|
|
", excludeXmlPrefixSet=" + excludeXmlPrefixSet +
|
|
", excludeXmlPrefixSet=" + excludeXmlPrefixSet +
|
|
|
- ", toCleanChildElementNameSet=" + toCleanChildElementNameSet +
|
|
|
|
|
|
|
+ ", toCleanChildElementNameSet=" + toCleanXmlChildElementNameSet +
|
|
|
", includeLibSet=" + includeLibSet +
|
|
", includeLibSet=" + includeLibSet +
|
|
|
", alreadyProtectedLibSet=" + alreadyProtectedLibSet +
|
|
", alreadyProtectedLibSet=" + alreadyProtectedLibSet +
|
|
|
'}';
|
|
'}';
|
|
@@ -937,7 +937,7 @@ public class EncryptExecutor {
|
|
|
|
|
|
|
|
private String excludeXmlPrefix;
|
|
private String excludeXmlPrefix;
|
|
|
|
|
|
|
|
- private String toCleanChildElementName;
|
|
|
|
|
|
|
+ private String toCleanXmlChildElementName;
|
|
|
|
|
|
|
|
private String includeLibs;
|
|
private String includeLibs;
|
|
|
|
|
|
|
@@ -984,8 +984,8 @@ public class EncryptExecutor {
|
|
|
return this;
|
|
return this;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public Builder toCleanChildElementName(String toCleanChildElementName) {
|
|
|
|
|
- this.toCleanChildElementName = toCleanChildElementName;
|
|
|
|
|
|
|
+ public Builder toCleanXmlChildElementName(String toCleanXmlChildElementName) {
|
|
|
|
|
+ this.toCleanXmlChildElementName = toCleanXmlChildElementName;
|
|
|
return this;
|
|
return this;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1104,10 +1104,10 @@ public class EncryptExecutor {
|
|
|
// xml相关参数解析
|
|
// xml相关参数解析
|
|
|
Set<String> includeXmlPrefixSet = StrUtil.strToSet(includeXmlPrefix);
|
|
Set<String> includeXmlPrefixSet = StrUtil.strToSet(includeXmlPrefix);
|
|
|
Set<String> excludeXmlPrefixSet = StrUtil.strToSet(excludeXmlPrefix);
|
|
Set<String> excludeXmlPrefixSet = StrUtil.strToSet(excludeXmlPrefix);
|
|
|
- toCleanChildElementName = StrUtil.isBlank(toCleanChildElementName) ? Constant.DEFAULT_XML_NODE_NAMES : toCleanChildElementName;
|
|
|
|
|
- Set<String> toCleanChildElementNameSet = StrUtil.strToSet(toCleanChildElementName);
|
|
|
|
|
|
|
+ toCleanXmlChildElementName = StrUtil.isBlank(toCleanXmlChildElementName) ? Constant.DEFAULT_XML_NODE_NAMES : toCleanXmlChildElementName;
|
|
|
|
|
+ Set<String> toCleanXmlChildElementNameSet = StrUtil.strToSet(toCleanXmlChildElementName);
|
|
|
return new EncryptExecutor(this.originJarOrWar, originIsJar, this.finalName, targetRootDir, targetLibDir, targetClassesDir,
|
|
return new EncryptExecutor(this.originJarOrWar, originIsJar, this.finalName, targetRootDir, targetLibDir, targetClassesDir,
|
|
|
- password, includeXmlPrefixSet, excludeXmlPrefixSet, toCleanChildElementNameSet, includePrefixSet, excludePrefixSet, includeLibSet, alreadyProtectedLibSet, this.supportFile);
|
|
|
|
|
|
|
+ password, includeXmlPrefixSet, excludeXmlPrefixSet, toCleanXmlChildElementNameSet, includePrefixSet, excludePrefixSet, includeLibSet, alreadyProtectedLibSet, this.supportFile);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|