public void OnVpnIsRunning(bool running) { Log.Debug(TAG, "OnVpnIsRunning " + running); if (type == ConnectivityType.Wifi) { if (running) { var currSSID = GetWIFISSID(); Log.Debug(TAG, "GetWIFISSID " + currSSID); if ((currSSID == null && settings.AutoStopWifi.Count > 0) || // ssid will be null in Android 10+ (API 29+) settings.AutoStopWifi.Contains(currSSID)) { starter.Switch(settings); // start again to stop the service TrojanPlusMainActivity.ShowAutoNotification(this, Resx.TextResource.Notification_AutoStop); } } } else { if (!running) { starter.Switch(settings); // start the service TrojanPlusMainActivity.ShowAutoNotification(this, Resx.TextResource.Notification_AutoStart); } } starter.OnJobServiceStop(); }
public Communicator(TrojanPlusMainActivity act) { activity = act; }