Remove Code

This commit is contained in:
xiaozhou233 committed 2026-08-24 14:41:51 +08:00
1 parent 8965da4cd3
commit 9f779dec5e
85 files changed
+47 -8293

No files matched your search

@@ -1,56 +0,0 @@
package cn.xiaozhou233.orangex.loader;
public class Detector {
private static boolean classExists(String className) {
String resourceName = className.replace('.', '/') + ".class";
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
if (classLoader == null) {
classLoader = Detector.class.getClassLoader();
}
return classLoader.getResource(resourceName) != null;
}
public static DetectorType detect() {
// Lunar Client Detection
if (classExists("com.moonsworth.lunar.genesis.Genesis")) {
System.out.println("Lunar class found!");
return DetectorType.LUNAR;
}
System.out.println("Lunar class not found");
// Badlion Detection
if (classExists("net.badlion.client.Wrapper")) {
System.out.println("Badlion class found!");
return DetectorType.BADLION;
}
System.out.println("Badlion class not found");
// MCP Detection
if (classExists("net.minecraft.client.Minecraft")) {
System.out.println("MCP class found!");
return DetectorType.MCP;
}
System.out.println("MCP class not found");
// Vanilla Detection
if (classExists("ave")) {
System.out.println("Vanilla class found!");
return DetectorType.VANILLA;
}
System.out.println("Vanilla class not found");
return DetectorType.UNKNOWN;
}
public static boolean isLaunchWrapper() {
return classExists("net.minecraft.launchwrapper.Launch");
}
}
@@ -1,9 +0,0 @@
package cn.xiaozhou233.orangex.loader;
public enum DetectorType {
BADLION,
LUNAR,
VANILLA,
MCP,
UNKNOWN
}
@@ -3,7 +3,6 @@ package cn.xiaozhou233.orangex.loader;
import cn.xiaozhou233.juiceagent.api.JuiceAgent;
import javax.swing.*;
import java.io.File;
public class Loader {
@@ -25,55 +24,55 @@ public class Loader {
throw new IllegalStateException("Cannot find Minecraft client thread");
}
// Check if LaunchWrapper exists
if (Detector.isLaunchWrapper()){
System.out.println("LaunchWrapper detected");
}
// // Check if LaunchWrapper exists
// if (Detector.isLaunchWrapper()){
// System.out.println("LaunchWrapper detected");
// }
// Get Minecraft ClassLoader
minecraftClassLoader = clientThread.getContextClassLoader();
System.out.println("Minecraft ClassLoader: " + minecraftClassLoader);
switch (Detector.detect()) {
case MCP:
break;
case VANILLA:
// No more support
JOptionPane.showMessageDialog(
null,
"Not support Vanilla Client! \n 不支持原版客户端!",
"Vanilla Obfuscation",
JOptionPane.ERROR_MESSAGE
);
throw new IllegalStateException("Not support Vanilla Client!");
case LUNAR:
break;
case BADLION:
// No more support
JOptionPane.showMessageDialog(
null,
"Not support Badlion Client! \n 不支持Badlion客户端!",
"Badlion Obfuscation",
JOptionPane.ERROR_MESSAGE
);
throw new IllegalStateException("Not support Badlion Client!");
case UNKNOWN:
JOptionPane.showMessageDialog(
null,
"Inject Failed! Cause: Unknown Obfuscation \n 注入失败! 原因: 未知的混淆",
"Unknown Obfuscation",
JOptionPane.ERROR_MESSAGE
);
throw new IllegalStateException("Unknown Obfuscation");
default:
JOptionPane.showMessageDialog(
null,
"Inject Failed! Cause: Unknown Obfuscation",
"Unknown Obfuscation",
JOptionPane.ERROR_MESSAGE
);
throw new IllegalStateException("Unexpected value: " + Detector.detect());
}
// switch (Detector.detect()) {
// case MCP:
// break;
// case VANILLA:
// // No more support
// JOptionPane.showMessageDialog(
// null,
// "Not support Vanilla Client! \n 不支持原版客户端!",
// "Vanilla Obfuscation",
// JOptionPane.ERROR_MESSAGE
// );
// throw new IllegalStateException("Not support Vanilla Client!");
// case LUNAR:
// break;
// case BADLION:
// // No more support
// JOptionPane.showMessageDialog(
// null,
// "Not support Badlion Client! \n 不支持Badlion客户端!",
// "Badlion Obfuscation",
// JOptionPane.ERROR_MESSAGE
// );
// throw new IllegalStateException("Not support Badlion Client!");
// case UNKNOWN:
// JOptionPane.showMessageDialog(
// null,
// "Inject Failed! Cause: Unknown Obfuscation \n 注入失败! 原因: 未知的混淆",
// "Unknown Obfuscation",
// JOptionPane.ERROR_MESSAGE
// );
// throw new IllegalStateException("Unknown Obfuscation");
// default:
// JOptionPane.showMessageDialog(
// null,
// "Inject Failed! Cause: Unknown Obfuscation",
// "Unknown Obfuscation",
// JOptionPane.ERROR_MESSAGE
// );
// throw new IllegalStateException("Unexpected value: " + Detector.detect());
// }
// Load OrangeX
File injectionFile = new File(userDir + "/.orangex/OrangeX.jar");
@@ -90,4 +89,5 @@ public class Loader {
}
System.out.println("======== Loader END ========");
}
}