I encrypted the jar. During the spring startup process, I will scan the class in the jar and read it through ClassReader. Finally, I found that there are two places that support obtaining the class from the jar, but the class at this time has not been decrypted, and will support error reporting
org.springframework.core.type.classreading.SimpleMetadataReader#getClassReader
private static ClassReader getClassReader(Resource resource) throws IOException {
try (InputStream is = resource.getInputStream()) {
try {
return new ClassReader(is);
}
catch (IllegalArgumentException ex) {
throw new ClassFormatException("ASM ClassReader failed to parse class file - " +
"probably due to a new Java class file version that is not supported yet. " +
"Consider compiling with a lower '-target' or upgrade your framework version. " +
"Affected class: " + resource, ex);
}
}
}
org.springframework.asm.ClassReader.ClassReader(byte[],int,boolean)
org.springframework.cglib.core.AbstractClassGenerator.generate(ClassLoaderData)
How do I decrypt bytecode in a custom way before getClassReader?