Initial v1.1.8 Commits
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package com.wdtt.client
|
||||
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
import com.wireguard.android.backend.GoBackend
|
||||
|
||||
class WdttApplication : Application() {
|
||||
@Volatile
|
||||
private var backendInstance: GoBackend? = null
|
||||
|
||||
val backend: GoBackend
|
||||
get() = getBackend(this)
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
DeployManager.init(this)
|
||||
}
|
||||
|
||||
fun getBackend(context: Context): GoBackend {
|
||||
return backendInstance ?: synchronized(this) {
|
||||
backendInstance ?: GoBackend(context.applicationContext).also { backendInstance = it }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user