mirror of
https://gitea.998043.xyz/novice/plugin-privacy.git
synced 2026-07-14 14:31:20 +08:00
feat: support rainbow v2025.3.4
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user