You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/sandboxing.md
+15-5Lines changed: 15 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ When at least one store format is configured, Nucleus registers additional Gradl
34
34
35
35
### 1. Extract Native Libraries from JARs
36
36
37
-
Sandboxed apps (especially macOS App Sandbox) cannot load unsigned native code extracted to temp directories at runtime. The plugin scans all dependency JARs for `.dylib`, `.jnilib`, `.so`, and `.dll` files and extracts them to the app's `resources/` directory.
37
+
Sandboxed apps (especially macOS App Sandbox) cannot load unsigned native code extracted to temp directories at runtime. The plugin scans all dependency JARs for `.dylib`, `.jnilib`, `.so`, and `.dll` files and extracts them. On macOS, these are placed in the app's `Contents/Frameworks/` directory (Apple convention); on other platforms they go into the app's `resources/` directory.
38
38
39
39
**Task:**`extractNativeLibsForSandboxing`
40
40
@@ -52,8 +52,18 @@ A separate `Sync` task merges the user's `appResources` with the extracted nativ
52
52
53
53
### 4. Inject Sandboxing JVM Arguments
54
54
55
-
The sandboxed app-image is configured with JVM arguments that redirect native library loading to the pre-extracted resources directory:
55
+
The sandboxed app-image is configured with JVM arguments that redirect native library loading to the pre-extracted location. On macOS, the path points to `Contents/Frameworks/` (`$APPDIR/../Frameworks`); on other platforms it points to `$APPDIR/resources`:
56
56
57
+
**macOS:**
58
+
```
59
+
-Djava.library.path=$APPDIR/../Frameworks
60
+
-Djna.nounpack=true
61
+
-Djna.nosys=true
62
+
-Djna.boot.library.path=$APPDIR/../Frameworks
63
+
-Djna.library.path=$APPDIR/../Frameworks
64
+
```
65
+
66
+
**Windows / Linux:**
57
67
```
58
68
-Djava.library.path=$APPDIR/resources
59
69
-Djna.nounpack=true
@@ -64,13 +74,13 @@ The sandboxed app-image is configured with JVM arguments that redirect native li
64
74
65
75
This ensures JNA/JNI libraries are loaded from signed, pre-extracted locations instead of being dynamically extracted to temp at runtime.
66
76
67
-
### 5. Sign Native Libraries in Resources (macOS)
77
+
### 5. Sign Native Libraries (macOS)
68
78
69
-
On macOS, all `.dylib` files in the sandboxed app's `resources/` directory are individually code-signed so they pass Gatekeeper checks.
79
+
On macOS, all `.dylib` files in the sandboxed app's `Contents/Frameworks/` directory are individually code-signed so they pass Gatekeeper checks.
70
80
71
81
### 6. Handle Skiko and icudtl.dat
72
82
73
-
The Skiko library path is adjusted to point to `resources/` instead of the app root. The companion `icudtl.dat` file is copied alongside the Skiko native library.
83
+
The Skiko library path is adjusted to point to `Contents/Frameworks/` (macOS) or `resources/`(other platforms) instead of the app root. The companion `icudtl.dat` file is placed alongside the Skiko native library.
Copy file name to clipboardExpand all lines: plugin-build/plugin/src/main/kotlin/io/github/kdroidfilter/nucleus/desktop/application/internal/configureJvmApplication.kt
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -586,7 +586,8 @@ private fun JvmApplicationContext.configurePackageTask(
Copy file name to clipboardExpand all lines: plugin-build/plugin/src/main/kotlin/io/github/kdroidfilter/nucleus/desktop/application/tasks/AbstractElectronBuilderPackageTask.kt
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -523,10 +523,10 @@ abstract class AbstractElectronBuilderPackageTask
Copy file name to clipboardExpand all lines: plugin-build/plugin/src/main/kotlin/io/github/kdroidfilter/nucleus/desktop/application/tasks/AbstractJPackageTask.kt
+48-12Lines changed: 48 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,7 @@ import java.io.File
75
75
importjava.io.ObjectInputStream
76
76
importjava.io.ObjectOutputStream
77
77
importjava.io.Serializable
78
+
importjava.nio.file.Files
78
79
importjava.nio.file.LinkOption
79
80
importjava.util.ArrayList
80
81
importjava.util.Calendar
@@ -373,7 +374,12 @@ abstract class AbstractJPackageTask
373
374
launcherJvmArgs.orNull?.forEach {
374
375
javaOption(it)
375
376
}
376
-
val skikoPath =if (sandboxingEnabled.get()) appDir("resources") else appDir()
0 commit comments