JNIFER is an interactive cross-language pointer analysis tool designed for analyzing JNI (Java Native Interface) programs. It consists of two main components:
JNIFER performs pointer analysis across Java and C code, helping developers understand interactions across the language boundary.
Although the Java and C analyzers interact during pointer analysis, their deployments are independent. We strongly recommend setting up Tai-e and SVF in an IDE (IntelliJ IDEA for Tai-e and CLion for SVF) after cloning the repository.
Refer to the following documents for setting up the Java and C components in their respective IDEs:
Note: In Setup SVF in CLion, change the LLVM version from 16.0.0 to 13.0.1.
All key components are located in Tai-e/src/main/java/pascal/taie/analysis/pta/plugin/jnifer
:
- JNIModel.java – Defines the cross-language model for representing C elements in Java.
- MyPackage.java – Implements the transformation of C messages into requests and replies (cross-language interaction protocol).
- NativeReceiver.java – Handles cross-language requests and replies.
- NativeActionModel.java – Manages interactions with the C analyzer, triggering updates when the points-to set of a C-related Java pointer changes.
All key components are located in SVF/lib/Jnifer
:
- JNIFunctionModel/ – Contains models for JNI functions.
- JNIModel.cpp – Defines the representation of Java elements and
JNIEnv
structures in C, and applies JNI function models during C analysis. - MyPackage.cpp – Implements the transformation of Java messages into requests and replies (cross-language interaction protocol).
- JavaReceiver.cpp – Handles cross-language requests and replies.
Contributions are welcome! Please submit issues and pull requests via GitHub.