in sdk/host/src/main/java/org/apache/teaclave/javasdk/host/MockInSvmEnclave.java [50:73]
private void extractNativeResource() throws EnclaveCreatingException {
// Extract jni .so and svm sdk .so from .jar file.
if (extractTempPath == null) {
synchronized (MockInSvmEnclave.class) {
if (extractTempPath == null) {
try {
String jniTempFilePath = ExtractLibrary.extractLibrary(
MockInSvmEnclave.class.getClassLoader(),
JNI_EXTRACTED_PACKAGE_PATH);
String enclaveSvmFilePath = ExtractLibrary.extractLibrary(
MockInSvmEnclave.class.getClassLoader(),
ENCLAVE_SVM_PACKAGE_PATH);
extractTempPath = new MockInSvmExtractTempPath(
jniTempFilePath,
enclaveSvmFilePath);
System.load(extractTempPath.getJniTempFilePath());
registerNatives();
} catch (IOException e) {
throw new EnclaveCreatingException("extracting tee sdk jni .so or signed .so failed.", e);
}
}
}
}
}