mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 03:31:15 +03:00
[FEATURE] Support createHackLookupNative
This commit is contained in:
parent
380179faa3
commit
43626bf1f4
1 changed files with 6 additions and 1 deletions
|
@ -7,8 +7,13 @@
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class HackHelper {
|
public class HackHelper {
|
||||||
|
private static native MethodHandles.Lookup createHackLookupNative(Class<?> lookupClass);
|
||||||
private static MethodHandles.Lookup createHackLookupImpl(Class<?> lookupClass) {
|
private static MethodHandles.Lookup createHackLookupImpl(Class<?> lookupClass) {
|
||||||
|
try {
|
||||||
|
return createHackLookupNative(lookupClass);
|
||||||
|
} catch (Throwable ignored) {
|
||||||
|
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
Field trusted = MethodHandles.Lookup.class.getDeclaredField("TRUSTED");
|
Field trusted = MethodHandles.Lookup.class.getDeclaredField("TRUSTED");
|
||||||
trusted.setAccessible(true);
|
trusted.setAccessible(true);
|
||||||
|
|
Loading…
Reference in a new issue