|
From what I've seen high revision clients commonly throw a reflection error trying to load the .dll files when launching from cmd or IDE; causing the client to run in safe-mode and disable Open GL & DirectX. With Java 11 it throws this error
To fix, find this code:Code:WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by Animable_Sub1_Sub1 (file:/C:/Users/Greg/IdeaProjects/rs-client/out/production/classes/) to method java.lang.Runtime.load0(java.lang.Class,java.lang.String) WARNING: Please consider reporting this to the maintainers of Animable_Sub1_Sub1 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release
and replace with:Code:Class<?> var_class_31_ = Class.forName("java.lang.Runtime"); Class<?> var_class_32_ = Class.forName("java.lang.reflect.AccessibleObject"); Method method = var_class_32_.getDeclaredMethod("setAccessible", Boolean.TYPE); Method method_33_ = var_class_31_.getDeclaredMethod("load0", Class.forName("java.lang.Class"), Class.forName("java.lang.String")); method.invoke(method_33_, Boolean.TRUE); method_33_.invoke(Runtime.getRuntime(), var_class, file.getPath()); method.invoke(method_33_, Boolean.FALSE);
Then below it, replace theCode:System.load(file.getPath());
with:NoSuchMethodExceptionUnsatisfiedLinkError
For the people here that use a Poanizer-X based client
I found it in Animable_Sub1_Sub1.java (method830 around line 320)
For some reason I'm getting a white screen when replacing it with this. The reflection error also happens to me on Java 8.
Edit: Figured out the issue, there was a duplicate System.load below, but still launching in safe mode.
This is the entire function refactored (before being patched).Code:@SuppressWarnings("unchecked") public static boolean loadNativeLibrary(Class libraryClazz, String name) { Class nativeClazz = (Class) nativeLibraries.get(name); if (nativeClazz != null) { if (nativeClazz.getClassLoader() != libraryClazz.getClassLoader()) { return false; } return true; } File file = null; if (file == null) { file = (File) loadedLibraries.get(name); } if (file != null) { try { file = new File(file.getCanonicalPath()); Method load0 = Runtime.class.getDeclaredMethod("load0", Class.class, String.class); load0.setAccessible(true); load0.invoke(Runtime.getRuntime(), libraryClazz, file.getPath()); load0.setAccessible(false); nativeLibraries.put(name, libraryClazz); return true; } catch (NoSuchMethodException nosuchmethodexception) { System.load(file.getPath()); nativeLibraries.put(name, Class304.class); return true; } catch (Throwable throwable) { /* empty */ } } return false; }
Bump for this because I forgot about this top goat code.
Don't you need to run with Java 6 anyways in order to get OpenGL and DirectX working?
« CS2 Mouse-Hover Tooltips | CS2 - Bank Search Fix/Patch » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |
Tags for this Thread |