mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-22 02:01:08 +07:00
Add AWG module
This commit is contained in:
@@ -18,17 +18,17 @@ private const val TAG = "Protocol"
|
||||
|
||||
const val VPN_SESSION_NAME = "AmneziaVPN"
|
||||
|
||||
abstract class Protocol(protected val context: Context) {
|
||||
|
||||
open lateinit var config: ProtocolConfig
|
||||
abstract class Protocol {
|
||||
|
||||
abstract val statistics: Statistics
|
||||
|
||||
abstract fun initialize()
|
||||
abstract fun initialize(context: Context)
|
||||
|
||||
abstract fun parseConfig(config: JSONObject)
|
||||
abstract fun startVpn(config: JSONObject, vpnBuilder: Builder, protect: (Int) -> Boolean)
|
||||
|
||||
protected open fun buildVpnInterface(vpnBuilder: Builder) {
|
||||
abstract fun stopVpn()
|
||||
|
||||
protected open fun buildVpnInterface(config: ProtocolConfig, vpnBuilder: Builder) {
|
||||
vpnBuilder.setSession(VPN_SESSION_NAME)
|
||||
vpnBuilder.allowFamily(OsConstants.AF_INET)
|
||||
vpnBuilder.allowFamily(OsConstants.AF_INET6)
|
||||
@@ -49,10 +49,6 @@ abstract class Protocol(protected val context: Context) {
|
||||
vpnBuilder.setMetered(false)
|
||||
}
|
||||
|
||||
abstract fun startVpn(vpnBuilder: Builder, protect: (Int) -> Boolean)
|
||||
|
||||
abstract fun stopVpn()
|
||||
|
||||
companion object {
|
||||
private fun extractLibrary(context: Context, libraryName: String, destination: File): Boolean {
|
||||
Log.d(TAG, "Extracting library: $libraryName")
|
||||
|
||||
Reference in New Issue
Block a user