|
|
@@ -350,12 +350,12 @@ public class EncryptExecutor {
|
|
|
})
|
|
|
.filter(zipEntryName -> {
|
|
|
if (excludeXmlPrefixSet != null) {
|
|
|
- boolean shouldExclude = excludeXmlPrefixSet.stream().anyMatch(s -> StrUtil.regMatched(s, zipEntryName));
|
|
|
+ boolean shouldExclude = excludeXmlPrefixSet.stream().anyMatch(s -> StrUtil.startsWithOrRegMatched(s, zipEntryName));
|
|
|
if (shouldExclude) {
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
- return includeXmlPrefixSet.stream().anyMatch(s -> StrUtil.regMatched(s, zipEntryName));
|
|
|
+ return includeXmlPrefixSet.stream().anyMatch(s -> StrUtil.startsWithOrRegMatched(s, zipEntryName));
|
|
|
})
|
|
|
.collect(Collectors.toSet());
|
|
|
|
|
|
@@ -635,7 +635,7 @@ public class EncryptExecutor {
|
|
|
List<File> allJarFiles = IOUtil.listFileOnly(new File(targetRootDir), Constant.JAR_SUFFIX);
|
|
|
// 筛选出需要加密的lib包
|
|
|
List<File> neededEncryptedLibs = allJarFiles.stream().filter(jarFile -> !protectedLibSet.contains(jarFile.getName()) &&
|
|
|
- includeLibSet.stream().anyMatch(s -> StrUtil.regMatched(s, jarFile.getName()))).collect(Collectors.toList());
|
|
|
+ includeLibSet.stream().anyMatch(s -> StrUtil.startsWithOrRegMatched(s, jarFile.getName()))).collect(Collectors.toList());
|
|
|
// 依次解密
|
|
|
neededEncryptedLibs.forEach(jar -> {
|
|
|
// 假设: jarAbsolutePath为 /xyz/abc.jar
|
|
|
@@ -949,7 +949,7 @@ public class EncryptExecutor {
|
|
|
String classLongName = JavassistUtil.resolveClassName(file.getAbsolutePath(), true);
|
|
|
if (excludePrefixSet != null) {
|
|
|
for (String excludePrefix : excludePrefixSet) {
|
|
|
- if (StrUtil.regMatched(excludePrefix, classLongName)) {
|
|
|
+ if (StrUtil.startsWithOrRegMatched(excludePrefix, classLongName)) {
|
|
|
// 排除
|
|
|
return null;
|
|
|
}
|
|
|
@@ -962,7 +962,7 @@ public class EncryptExecutor {
|
|
|
String pureIncludePrefix = pair.getLeft();
|
|
|
Map<String, String> params = pair.getRight();
|
|
|
|
|
|
- if (StrUtil.regMatched(pureIncludePrefix, classLongName)) {
|
|
|
+ if (StrUtil.startsWithOrRegMatched(pureIncludePrefix, classLongName)) {
|
|
|
// 包含
|
|
|
return EncryptClassArgs.create(file,
|
|
|
StrUtil.isTrueDefault(params.get(Constant.CLEAN_CLASS_ANNOTATION_PARAM_NAME), false),
|
|
|
@@ -1294,7 +1294,7 @@ public class EncryptExecutor {
|
|
|
|
|
|
// 如果这次需要加密的lib本身就已经是被加密了的,那么这次不再对其进行加密
|
|
|
alreadyProtectedLibSet.stream().map(Pair::getLeft).forEach(lib -> {
|
|
|
- if (includeLibSet.stream().anyMatch(s -> StrUtil.regMatched(s, lib))) {
|
|
|
+ if (includeLibSet.stream().anyMatch(s -> StrUtil.startsWithOrRegMatched(s, lib))) {
|
|
|
Logger.warn(EncryptExecutor.class, "Ignore includeLibs item [" + lib + "], because this item already be protected by class-winter.");
|
|
|
matchAlreadyProtectedLibSet.add(lib);
|
|
|
}
|