Revert "might actually work, TODO: try"
This reverts commit b05141bc33
.
This commit is contained in:
parent
e448bde447
commit
41510307da
1 changed files with 9 additions and 7 deletions
|
@ -90,18 +90,20 @@ public class CustomClassloader extends ClassLoader {
|
|||
final byte[][] data = {null};
|
||||
encryptedClasses.access(accessor -> Loader.classKey.access(classKey -> data[0] = classKey.getValue().decryptByte(accessor.getValue().get(name))));
|
||||
if (data[0] != null) {
|
||||
try {
|
||||
Field b = Unsafe.class.getDeclaredField("theUnsafe");
|
||||
Unsafe unsafe = (Unsafe)b.get(null);
|
||||
Class<?> definedClass = unsafe.defineClass(name, data[0], 0, data[0].length, this, null);
|
||||
Class<?> definedClass = defineClass(name, data[0], 0, data[0].length);
|
||||
//// TudbuT // using unsafe is a bad idea as it breaks DataKeeper
|
||||
// try {
|
||||
// Field b = Unsafe.class.getDeclaredField("theUnsafe");
|
||||
// Unsafe unsafe = (Unsafe)b.get(null);
|
||||
// Class<?> definedClass = unsafe.defineClass(name, data[0], 0, data[0].length, this, null);
|
||||
|
||||
if (definedClass == null) {
|
||||
throw new ClassNotFoundException(name);
|
||||
}
|
||||
return definedClass;
|
||||
} catch (Exception e){
|
||||
return null;
|
||||
}
|
||||
// }catch (Exception e){
|
||||
// return null;
|
||||
// }
|
||||
} else {
|
||||
try {
|
||||
return Launch.classLoader.findClass(name);
|
||||
|
|
Loading…
Add table
Reference in a new issue