类 NativeLibraryLoader
java.lang.Object
io.github.weg2022.strguard.runtime.NativeLibraryLoader
Extracts, verifies, and loads a bundled Native library for a generated bridge class.
-
方法概要
修饰符和类型方法说明static StringFinds matching binary and marker resources in one classpath container, verifies the binary hash while extracting it, and returns the resulting absolute path.static voidVerifies and loads the Native binary without exposing a hash-to-load gap to generated bridge code.static voidDeletes an extracted library where the host OS permits it.
-
方法详细资料
-
load
public static void load(Class<?> anchor, String resourcePath, String fileName, String markerResourcePath) Verifies and loads the Native binary without exposing a hash-to-load gap to generated bridge code.- 参数:
anchor- generated bridge class used to resolve classpath containersresourcePath- validated Native binary resource pathfileName- generated Native library file namemarkerResourcePath- artifact marker paired with the Native binary
-
extract
public static String extract(Class<?> anchor, String resourcePath, String fileName, String markerResourcePath) Finds matching binary and marker resources in one classpath container, verifies the binary hash while extracting it, and returns the resulting absolute path.- 参数:
anchor- generated bridge class used to resolve classpath containersresourcePath- validated Native binary resource pathfileName- generated Native library file namemarkerResourcePath- artifact marker paired with the Native binary- 返回:
- absolute path to the verified private extraction
-
loaded
Deletes an extracted library where the host OS permits it.- 参数:
path- absolute path returned byextract(Class, String, String, String)
-