Issues with AOT compilation

AOT compilation translates Java code into native code, significantly improving the running speed of Java programs. It indirectly achieves the goal of safeguarding Java code by converting it into machine code.

For Java programs, especially those based on various frameworks, AOT compilation is a huge challenge due to the inclusion of many dynamic features. At the same time, in order to compromise with dynamism, the compiled binary file may still contain a large amount of class file information. The following article introduces a project that scans compiled binary files to obtain class information. https://protector4j.com/articles/extract-java-classes-information-from-aot/

Even if the binary program does not contain class file information, its running logic still exists in the same way. The only difference is that the representation has changed from bytecode to machine code, without any special protection. If one can understand its compilation and execution mechanism, it is still possible to reverse engineer readable code. The following article introduces such a project. https://protector4j.com/articles/graalvm-nativeimage-reverse-engineering/

Conclusion

AOT compilation configuration is difficult, the difficulty of compilation is high, and the probability of compilation failure is high. Even if the compilation is successful, the code logic only changes from bytecode representation to machine code representation. Its inherent operational logic still exists without any special protection. If one can understand its own compilation and execution mechanism, it is still possible to reverse engineer readable code.