A reference VPN client built with Compose for Desktop (Kotlin Multiplatform). This project demonstrates how to use the Surf Shield Java SDK to build a cross-platform desktop VPN for Windows, macOS, and Linux from a single Kotlin codebase.
- A unified UI using Jetbrains Compose for Desktop.
- Cross-platform JNI extraction via
LeafWrapper. - Dynamic JNI artifact resolution at build-time using
com.google.osdetector. - Fetch subscriptions, update Geo assets, verify file integrity, and launch the Leaf proxy core.
- Clone the repository:
git clone https://github.com/shiroedev2024/kotlin-multiplatform-desktop.git
- Build and Run (Development):
./gradlew run
- Package for Distribution (MSI, DMG, DEB):
./gradlew packageDistributionForCurrentOS
This project automatically resolves the correct jni-wrapper binaries for the host OS at compile time, eliminating manual dependency linking:
val os = osdetector.os
val arch = osdetector.arch
val leafVersion = "1.2.8"
when {
os == "linux" && arch == "x86_64" -> implementation("com.github.shiroedev2024:jni-wrapper:$leafVersion-linux-64")
os == "osx" && arch == "aarch_64" -> implementation("com.github.shiroedev2024:jni-wrapper:$leafVersion-macos-arm64")
// ... handles Windows and macOS variations
}Open-sourced under the Apache 2.0 License.