Skip to content

Commit

Permalink
Fix MacOS native library not found (closes #16)
Browse files Browse the repository at this point in the history
  • Loading branch information
sleeyax committed Sep 23, 2022
1 parent 08fce6f commit 6f3166a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ copy() {
# params
local binary=$1
local resourceFolder=$2
local prefix=$3
local extension="${binary##*.}"

# locations to copy to and from
local binaryPath="./src-go/server/build/$binary"
local resourcePath="./src/main/resources/$resourceFolder/server.$extension"
local resourcePath="./src/main/resources/$resourceFolder/${prefix}server.$extension"

# perform copy
mkdir -p $(dirname "$resourcePath")
Expand All @@ -32,7 +33,7 @@ copy() {
}

copy_macos() {
copy "server-darwin-amd64.dylib" "darwin-x86-64"
copy "server-darwin-amd64.dylib" "darwin-x86-64" "lib"
}

copy_linux_386() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/burp/ServerLibrary.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.sun.jna.Platform;

public interface ServerLibrary extends Library {
ServerLibrary INSTANCE = Native.load("server." + (Platform.isWindows() ? "dll" : Platform.isMac() ? "dylib" : "so"), ServerLibrary.class);
ServerLibrary INSTANCE = Native.load((Platform.isMac() ? "lib" : "") + "server." + (Platform.isWindows() ? "dll" : Platform.isMac() ? "dylib" : "so"), ServerLibrary.class);

String StartServer(String address);
String StopServer();
Expand Down

0 comments on commit 6f3166a

Please sign in to comment.