byte[] (byte[] bytes) { ClassWriter classWriter = new ClassWriter(0); ClassVisitor classVisitor = new ClassVisitor(Opcodes.API_VERSION, classWriter) { @Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { if ("java/lang/Object".equals(superName)) { superName = "sun/reflect/MagicAccessorImpl"; } super.visit(version, access, name, signature, superName, interfaces); } }; new ClassReader(bytes).accept(classVisitor, 0); return classWriter.toByteArray(); }