Skip to content

Commit

Permalink
Merge branch 'feat/bls-public-key-validation' of github.com:ArkEcosys…
Browse files Browse the repository at this point in the history
…tem/java-crypto into feat/bls-public-key-validation
  • Loading branch information
alfonsobries committed Aug 8, 2024
2 parents fd0c1c6 + f3693ac commit 25b29ee
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/main/java/org/arkecosystem/crypto/signature/bls/JNIEnv.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private Boolean sourceExist(String sourceName) {
}
return false;
}

public void prepare() {
for (String s : sources) {
copy(s);
Expand All @@ -50,15 +50,22 @@ public Boolean copy(String sourceName) {
return true;
} else {
try {
String[] libraryPaths = System.getProperty("java.library.path").split(File.pathSeparator);
File f = new File(libraryPaths[0], sourceName); // Using the first path in java.library.path
String[] libraryPaths =
System.getProperty("java.library.path").split(File.pathSeparator);
File f =
new File(
libraryPaths[0],
sourceName); // Using the first path in java.library.path
if (!f.exists()) {
f.createNewFile();
System.out.println("[JNIDEV]:DEFAULT JNI INITION:" + sourceName);
}
FileOutputStream os = new FileOutputStream(f);

InputStream is = getClass().getResourceAsStream("/" + sourceName); // Modified to add leading slash
InputStream is =
getClass()
.getResourceAsStream(
"/" + sourceName); // Modified to add leading slash
if (is == null) {
os.close();
return false;
Expand Down

0 comments on commit 25b29ee

Please sign in to comment.