autopsy-flatpak/docs/doxygen/native_libs.dox

23 lines
2.3 KiB
Plaintext
Executable File

/*! \page native_page Native Library Loading
\section native_overview Overview
This section outlines how Autopsy distributes native libraries and provides
pointers for you if you want to distribute native libraries with your modules.
The easiest guidance (from http://bits.netbeans.org/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/api.html#jni) is to put the native library in the <tt>release/modules/lib</tt> folder in your project. Or, in architecure-specific locations if your module is multi-platform. See the above page for examples. They will get copied from that location to somewhere that will be searched when Autopsy does a <tt>System.loadLibrary()</tt>.
\section native_autopsy Autopsy Native Libraries
Autopsy has three types of native libraries that it depends on (and ships with):
- The Sleuth Kit JNI Library(libtsk_jni)
- This is embedded inside of the <tt>Tsk_DataModel.jar</tt> file. It gets copied into there by the datamodel ant target.
- At runtime, java code extracts the file from the jar into a local temp folder and launches it in the LibraryUtils.loadSleuthkitJNI() method.
- The libraries that libtsk_jni depends on that are not the Visual Studio runtime dlls that were used to build libtsk_jni
- These are copied by Autopsy from TSK_HOME to a folder inside of Autopsy at compile time.
- They are loaded by Autopsy in the Installer.loadDynLibraries() method. This is because if we wait until <tt>libtsk_jni</tt> needs them, then they will be located based on Windows search paths and the NetBeans paths are not in that set. So, we launch them before <tt>libtsk_jni</tt> needs them and from within Autopsy so that it uses the Autopsy search paths.
- The Visual Studio runtime dlls that were used to build libtsk_jni
- These are only copied by Autopsy when a ZIP folder is created of the project (on the theory that the local system doesn't need copies of them because it is already building TSK). There is code in build-windows.xml and build-unix.xml to copy the external libraries (from thidrparty/crt) into their respective locations in the ZIP file.
- NOTE: If other versions of the runtimes need to be included (because of the other 3rd party libraries), then they should be treated like other 3rd party libraries and copied at compile time.
*/