feat: support rainbow v2025.3.4

This commit is contained in:
yelochick
2025-08-26 16:18:45 +08:00
parent b316de054e
commit 3e5cf0680d
10 changed files with 16 additions and 41 deletions

View File

@@ -1,28 +0,0 @@
package com.novitechie.rules;
import com.janetfilter.core.commons.DebugInfo;
import com.novitechie.LogUtil;
import java.util.ArrayList;
import java.util.List;
/**
* @author YeloChick
*/
public class ClassRule {
private static final List<String> PREVENT_LOAD_METHOD = new ArrayList<String>() {
{
add("findBootstrapClass");
}
};
public static void checkMethod(String name) throws Exception {
if (PREVENT_LOAD_METHOD.stream().anyMatch(name::equals)) {
DebugInfo.output("======================LoadMethod: " + name);
LogUtil.printStackTrace();
throw new NoSuchMethodException();
}
}
}

View File

@@ -20,7 +20,7 @@ public class IdeaPluginRule {
public static boolean check(String name) {
if (checkHidePlugin(name)) {
DebugInfo.output("======================LoadPlugin: " + name);
DebugInfo.output("======================Hide Plugin: " + name);
LogUtil.printStackTrace();
return true;
}

View File

@@ -20,7 +20,7 @@ public class LoadClassRule {
public static void check(String name) throws Exception {
if (!checkIgnoreClass(name) && checkHidePackage(name)) {
DebugInfo.output("======================LoadClass: " + name);
DebugInfo.output("======================Hide Class: " + name);
LogUtil.printStackTrace();
throw new ClassNotFoundException(name);
}

View File

@@ -23,7 +23,7 @@ public class ResourceRule {
public static boolean check(String name) {
if (!checkIgnoreResource(name) && checkHideResource(name) && StackTraceRule.check()) {
DebugInfo.output("======================LoadResource: " + name);
DebugInfo.output("======================Hide Resource: " + name);
LogUtil.printStackTrace();
return true;
}

View File

@@ -23,7 +23,7 @@ public class SystemRule {
public static boolean checkEnv(String name) {
if (checkHideEnv(name) && StackTraceRule.check()) {
DebugInfo.output("======================LoadEnv: " + name);
DebugInfo.output("======================Hide Env: " + name);
LogUtil.printStackTrace();
return true;
}
@@ -32,7 +32,7 @@ public class SystemRule {
public static boolean checkProperty(String name) {
if (checkHideProperty(name) && StackTraceRule.check()) {
DebugInfo.output("======================LoadProperty: " + name);
DebugInfo.output("======================Hide Property: " + name);
LogUtil.printStackTrace();
return true;
}

View File

@@ -13,6 +13,7 @@ import java.nio.file.Path;
public class VMOptionsRule {
public static Path hook() {
DebugInfo.output("======================Hide VMOptions");
String tmpdir = System.getProperty("java.io.tmpdir");
File file = new File(tmpdir, "fake.vmoptions");
if (file.exists()) {