implement real gateway path.
Some checks failed
CI / Rust (push) Successful in 25s
CI / Android (push) Failing after 2s

This commit is contained in:
2026-05-31 20:10:11 +03:30
parent 442fad6b05
commit 266cae92ce
7 changed files with 1062 additions and 17 deletions

View File

@@ -10,6 +10,7 @@ import org.vpnshare.gateway.VpnShareGatewayService
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
maybeStartShare(intent)
setContent {
ShareScreen(
@@ -28,4 +29,22 @@ class MainActivity : ComponentActivity() {
)
}
}
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
maybeStartShare(intent)
}
private fun maybeStartShare(intent: Intent?) {
if (intent?.action == ACTION_START_FROM_DESKTOP) {
startForegroundService(
Intent(this, VpnShareGatewayService::class.java)
.setAction(VpnShareGatewayService.ACTION_START)
)
}
}
companion object {
const val ACTION_START_FROM_DESKTOP = "org.vpnshare.action.START_FROM_DESKTOP"
}
}