Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

163 changes: 2 additions & 161 deletions cmp/androidApp/src/main/res/drawable/ic_launcher_background.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,167 +4,8 @@
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<!-- Solid premium deep dark background matching LionVPN's theme -->
<path
android:fillColor="#3DDC84"
android:fillColor="#0F131E"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
</adaptive-icon>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
</adaptive-icon>
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
16 changes: 16 additions & 0 deletions cmp/desktopApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies {
implementation(projects.shared)
implementation(compose.foundation)
implementation(compose.desktop.currentOs)
implementation(compose.components.resources)
implementation(libs.kotlinx.coroutinesSwing)
implementation(libs.kotlinx.serialization)

Expand All @@ -27,12 +28,27 @@ dependencies {
compose.desktop {
application {
mainClass = "com.darius.lionvpn.MainKt"
jvmArgs("-Dsun.awt.wmclass=lion-vpn")

nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "lion-vpn"
packageVersion = rootProject.extra["versionName"] as String
appResourcesRootDir.set(project.layout.projectDirectory.dir("src/main/resources"))

macOS {
iconFile.set(project.file("src/main/resources/macos/icon.icns"))
}
windows {
iconFile.set(project.file("src/main/resources/windows/icon.ico"))
}
linux {
iconFile.set(project.file("src/main/resources/linux/icon.png"))
shortcut = true
appCategory = "Network"
menuGroup = "Network"
debMaintainer = "support@lionvpn.com"
}
}
}
}
Expand Down
58 changes: 33 additions & 25 deletions cmp/desktopApp/src/main/kotlin/com/darius/lionvpn/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,44 @@ import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application
import org.jetbrains.compose.resources.painterResource
import lion_vpn.shared.generated.resources.Res
import lion_vpn.shared.generated.resources.logo
import org.koin.compose.koinInject
import org.koin.compose.viewmodel.koinViewModel

fun main() = application {
initKoin()
fun main() {
System.setProperty("sun.awt.wmclass", "lion-vpn")
application {
initKoin()

// Bulletproof fail-safe JVM Shutdown Hook to clean up spawned background processes
Runtime.getRuntime().addShutdownHook(Thread {
println("[Shutdown Hook] Force stopping active VPN daemon...")
ProcessRunner.stop()
})

Window(
onCloseRequest = {
println("[Window] Closing application, stopping active VPN daemon...")
// Bulletproof fail-safe JVM Shutdown Hook to clean up spawned background processes
Runtime.getRuntime().addShutdownHook(Thread {
println("[Shutdown Hook] Force stopping active VPN daemon...")
ProcessRunner.stop()
exitApplication()
},
title = "Lion VPN",
) {
currentWindowHolder.window = this.window
val viewModel: AppViewModel = koinViewModel<AppViewModel>()
val homeState by viewModel.homeState.collectAsState()
})

Window(
onCloseRequest = {
println("[Window] Closing application, stopping active VPN daemon...")
ProcessRunner.stop()
exitApplication()
},
title = "Lion VPN",
icon = painterResource(Res.drawable.logo),
) {
currentWindowHolder.window = this.window
val viewModel: AppViewModel = koinViewModel<AppViewModel>()
val homeState by viewModel.homeState.collectAsState()

App(
connectivityHandler = koinInject(),
state = homeState,
onClick = { event ->
viewModel.handleEvent(event)
}
)
App(
connectivityHandler = koinInject(),
state = homeState,
onClick = { event ->
viewModel.handleEvent(event)
}
)
}
}
}

Binary file added cmp/desktopApp/src/main/resources/linux/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cmp/desktopApp/src/main/resources/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cmp/desktopApp/src/main/resources/macos/MasterHttpRelayVPN
Binary file not shown.
Binary file added cmp/desktopApp/src/main/resources/macos/icon.icns
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions cmp/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ kotlin {
}
}

compose.resources {
publicResClass = true
}

dependencies {

}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.navigation.NavHostController
import com.darius.lionvpn.ui.model.SavedConfig

@OptIn(ExperimentalMaterial3Api::class)
@Composable
Expand Down Expand Up @@ -90,6 +89,15 @@ private fun TopPart(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Top
) {
Text(
text = "🦁 LionVPN",
style = MaterialTheme.typography.headlineLarge.copy(
fontWeight = FontWeight.Bold,
color = MaterialTheme.colorScheme.primary,
letterSpacing = 0.5.sp
)
)

state.log?.let {
LogTerminal(
log = it,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.darius.lionvpn

import androidx.compose.ui.window.ComposeUIViewController
import com.darius.lionvpn.ui.home.HomeState
import org.koin.compose.koinInject

fun MainViewController() = ComposeUIViewController {
// koin in being initiated from iosApp
App(connectivityHandler = koinInject())
App(connectivityHandler = koinInject(), state = HomeState())
}
Loading