Skip to content

Commit 7d488cb

Browse files
committed
Redo native lib loading, update the libs with ones from the Kotlin project.
I still need to make the build script to automate this.
1 parent 7112a68 commit 7d488cb

File tree

10 files changed

+6
-5
lines changed

10 files changed

+6
-5
lines changed

src/main/java/dev/webview/WebviewNative.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.sun.jna.ptr.PointerByReference;
1010

1111
import co.casterlabs.rakurai.io.IOUtil;
12+
import dev.webview.platform.Platform;
1213
import lombok.NonNull;
1314
import lombok.SneakyThrows;
1415

@@ -22,22 +23,22 @@ static void runSetup() {
2223
switch (Platform.os) {
2324
case LINUX: {
2425
libraries = new String[] {
25-
"libwebview.so"
26+
"natives/" + Platform.arch + "/linux/libwebview.so"
2627
};
2728
break;
2829
}
2930

3031
case MACOSX: {
3132
libraries = new String[] {
32-
"libwebview.dylib"
33+
"natives/" + Platform.arch + "/macosx/libwebview.dylib"
3334
};
3435
break;
3536
}
3637

3738
case WINDOWS: {
3839
libraries = new String[] {
39-
"webview.dll",
40-
"WebView2Loader.dll"
40+
"natives/" + Platform.arch + "/windows/webview.dll",
41+
"natives/" + Platform.arch + "/windows/WebView2Loader.dll"
4142
};
4243
break;
4344
}
@@ -50,7 +51,7 @@ static void runSetup() {
5051
if (!file.exists()) {
5152
InputStream in = WebviewNative.class.getResourceAsStream("/" + lib);
5253
byte[] bytes = IOUtil.readInputStreamBytes(in);
53-
Files.write(file.toPath(), bytes);
54+
Files.write(new File(file.getName()).toPath(), bytes);
5455
}
5556
}
5657
}
-418 KB
Binary file not shown.
-60.9 KB
Binary file not shown.

src/main/resources/libwebview.so

-76.3 KB
Binary file not shown.
266 KB
Binary file not shown.
61.6 KB
Binary file not shown.
83.9 KB
Binary file not shown.
154 KB
Binary file not shown.
743 KB
Binary file not shown.

src/main/resources/webview.dll

-535 KB
Binary file not shown.

0 commit comments

Comments
 (0)