Skip to content

About

A modern Kotlin Multiplatform VPN SDK desktop client built with Compose and JVM, enabling developers to integrate high-performance, censorship-resistant networking (V2Ray, VLESS, Trojan, QUIC) into cross-platform apps.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

Surf Shield: Kotlin Multiplatform Desktop Client

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.

Features

  • 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.

Getting Started

  1. Clone the repository:
    git clone https://github.com/shiroedev2024/kotlin-multiplatform-desktop.git
  2. Build and Run (Development):
    ./gradlew run
  3. Package for Distribution (MSI, DMG, DEB):
    ./gradlew packageDistributionForCurrentOS

SDK Integration Highlight

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
}

Resources

License

Open-sourced under the Apache 2.0 License.

About

A modern Kotlin Multiplatform VPN SDK desktop client built with Compose and JVM, enabling developers to integrate high-performance, censorship-resistant networking (V2Ray, VLESS, Trojan, QUIC) into cross-platform apps.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages