add openvpn connection logic draft

This commit is contained in:
Розов Никита Валерьевич 2021-10-09 20:17:19 +03:00
parent c057786011
commit 1ceee8901e
6 changed files with 527 additions and 322 deletions

View file

@ -6,14 +6,18 @@ package org.amnezia.vpn.qt
import android.content.Context
import android.content.Intent
import android.util.Log
class VPNPermissionHelper : android.net.VpnService() {
private val tag = "VPNPermissionHelper"
/**
* This small service does nothing else then checking if the vpn permission
* is present and prompting if not.
*/
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
val intent = prepare(this.applicationContext)
Log.i(tag, "VPNPermissionHelper onStartCommand")
if (intent != null) {
startActivityForResult(intent)
}