mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-04-19 14:33:04 +03:00
[FIX] Ещё 1 способ System.exit в обход SecurityManager.
This commit is contained in:
parent
0b14d63d0b
commit
20f33b1876
1 changed files with 17 additions and 0 deletions
|
@ -1,5 +1,10 @@
|
||||||
package pro.gravit.launcher.utils;
|
package pro.gravit.launcher.utils;
|
||||||
|
|
||||||
|
import java.awt.event.WindowEvent;
|
||||||
|
|
||||||
|
import javax.swing.JFrame;
|
||||||
|
import javax.swing.WindowConstants;
|
||||||
|
|
||||||
import pro.gravit.utils.helper.JVMHelper;
|
import pro.gravit.utils.helper.JVMHelper;
|
||||||
|
|
||||||
public final class NativeJVMHalt {
|
public final class NativeJVMHalt {
|
||||||
|
@ -22,13 +27,25 @@ public static void haltA(int code) {
|
||||||
try {
|
try {
|
||||||
JVMHelper.RUNTIME.exit(code);
|
JVMHelper.RUNTIME.exit(code);
|
||||||
} catch (Throwable ignored) {
|
} catch (Throwable ignored) {
|
||||||
|
new WindowShutdown();
|
||||||
}
|
}
|
||||||
halt.aaabbb38C_D();
|
halt.aaabbb38C_D();
|
||||||
boolean a = halt.aaabBooleanC_D();
|
boolean a = halt.aaabBooleanC_D();
|
||||||
System.out.println(a);
|
System.out.println(a);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean initFunc() {
|
public static boolean initFunc() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class WindowShutdown extends JFrame {
|
||||||
|
private static final long serialVersionUID = 6321323663070818367L;
|
||||||
|
|
||||||
|
public WindowShutdown() {
|
||||||
|
super();
|
||||||
|
super.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
||||||
|
super.processWindowEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue