|
@@ -107,7 +107,7 @@ import com.vpn.fastestvpnservice.ui.theme.FastestVPNTheme
|
|
|
import com.vpn.fastestvpnservice.ui.theme.customTypography
|
|
|
import com.vpn.fastestvpnservice.ui.theme.customTypography2
|
|
|
import com.vpn.fastestvpnservice.utils.Utils
|
|
|
-import com.vpn.fastestvpnservice.utils.WireGuardConnection
|
|
|
+import com.vpn.fastestvpnservice.utils.VPNConnectionsUtil
|
|
|
import com.vpn.fastestvpnservice.viewmodels.HomeViewModel
|
|
|
import com.vpn.fastestvpnservice.viewmodels.ServerListViewModel
|
|
|
import com.vpn.fastestvpnservice.viewmodels.SplashViewModel
|
|
@@ -131,7 +131,7 @@ lateinit var homeViewModel1: HomeViewModel
|
|
|
override fun onServerSelected(
|
|
|
context: Context, homeViewModel: HomeViewModel,
|
|
|
onClick: () -> Unit, isServerDialogShown: Boolean, server: Server) {
|
|
|
- val wg = WireGuardConnection(context, act ,homeViewModel)
|
|
|
+ val wg = VPNConnectionsUtil(context, act ,homeViewModel)
|
|
|
val basePreferenceHelper = BasePreferenceHelper(context)
|
|
|
|
|
|
Log.d("ServerCallbacks", "onServerSelected called!")
|
|
@@ -164,7 +164,7 @@ lateinit var homeViewModel1: HomeViewModel
|
|
|
|
|
|
override fun onChangeProtocol(protocol: Protocol, context: Context) {
|
|
|
val prefHelper = BasePreferenceHelper(context)
|
|
|
- val wg = WireGuardConnection(context, act , homeViewModel1)
|
|
|
+ val wg = VPNConnectionsUtil(context, act , homeViewModel1)
|
|
|
protocolObj.value = protocol
|
|
|
|
|
|
Log.d("OnChangeProtocol", "OnChangeProtocol ${protocol.full_name} ${protocol.title}!")
|
|
@@ -217,8 +217,8 @@ fun Home(navHostController: NavHostController, activity: ComponentActivity) {
|
|
|
SplashViewModel(context)
|
|
|
}
|
|
|
var server: Server = Server()
|
|
|
- val wireGuardConnection = WireGuardConnection(context, activity, homeViewModel)
|
|
|
- val wg = WireGuardConnection(context, activity, homeViewModel)
|
|
|
+ val vpnConnectionsUtil = VPNConnectionsUtil(context, activity, homeViewModel)
|
|
|
+ val wg = VPNConnectionsUtil(context, activity, homeViewModel)
|
|
|
homeViewModel1 = homeViewModel
|
|
|
|
|
|
var isConnect: Int? = homeViewModel.isConnect.observeAsState().value
|
|
@@ -353,10 +353,10 @@ fun Home(navHostController: NavHostController, activity: ComponentActivity) {
|
|
|
onClick = {
|
|
|
Log.d("isConnect_State", "onClick{} -> $isConnect")
|
|
|
if (isConnect == App.CONNECTED || isConnect == App.CONNECTING) {
|
|
|
- wireGuardConnection.stopVpn()
|
|
|
+ vpnConnectionsUtil.stopVpn()
|
|
|
homeViewModel.getIp()
|
|
|
} else {
|
|
|
- wireGuardConnection.startVpn()
|
|
|
+ vpnConnectionsUtil.startVpn()
|
|
|
}
|
|
|
|
|
|
// isConnect = !isConnect
|
|
@@ -681,7 +681,7 @@ fun Home(navHostController: NavHostController, activity: ComponentActivity) {
|
|
|
@Composable
|
|
|
fun BoxScope.ShowServerDialog(
|
|
|
prefHelper: BasePreferenceHelper,
|
|
|
- wg: WireGuardConnection
|
|
|
+ wg: VPNConnectionsUtil
|
|
|
) {
|
|
|
AlertDialog(
|
|
|
onDismissRequest = { isServerDialog.value = false },
|
|
@@ -807,7 +807,7 @@ fun BoxScope.ShowServerDialog(
|
|
|
@Composable
|
|
|
fun BoxScope.ShowProtocolDialog(
|
|
|
prefHelper: BasePreferenceHelper,
|
|
|
- wg: WireGuardConnection
|
|
|
+ wg: VPNConnectionsUtil
|
|
|
) {
|
|
|
AlertDialog(
|
|
|
onDismissRequest = { isProtocolDialog.value = false },
|