| 62 | using namespace wsnet; |
| 63 | |
| 64 | Engine::Engine() : QObject(nullptr), |
| 65 | helper_(nullptr), |
| 66 | firewallController_(nullptr), |
| 67 | connectionManager_(nullptr), |
| 68 | connectStateController_(nullptr), |
| 69 | vpnShareController_(nullptr), |
| 70 | emergencyController_(nullptr), |
| 71 | customConfigs_(nullptr), |
| 72 | customOvpnAuthCredentialsStorage_(nullptr), |
| 73 | networkDetectionManager_(nullptr), |
| 74 | macAddressController_(nullptr), |
| 75 | keepAliveManager_(nullptr), |
| 76 | packetSizeController_(nullptr), |
| 77 | myIpManager_(nullptr), |
| 78 | #ifdef Q_OS_WIN |
| 79 | measurementCpuUsage_(nullptr), |
| 80 | #endif |
| 81 | inititalizeHelper_(nullptr), |
| 82 | bInitialized_(false), |
| 83 | locationsModel_(nullptr), |
| 84 | downloadHelper_(nullptr), |
| 85 | #ifdef Q_OS_MACOS |
| 86 | autoUpdaterHelper_(nullptr), |
| 87 | macSpoofTimer_(nullptr), |
| 88 | #endif |
| 89 | isBlockConnect_(false), |
| 90 | isCleanupFinished_(false), |
| 91 | isNeedReconnectAfterRequestAuth_(false), |
| 92 | online_(false), |
| 93 | packetSizeControllerThread_(nullptr), |
| 94 | runningPacketDetection_(false), |
| 95 | lastDownloadProgress_(0), |
| 96 | installerUrl_(""), |
| 97 | guiWindowHandle_(0), |
| 98 | overrideUpdateChannelWithInternal_(false), |
| 99 | bPrevNetworkInterfaceInitialized_(false), |
| 100 | connectionSettingsOverride_(types::Protocol(types::Protocol::TYPE::UNINITIALIZED), 0, true), |
| 101 | loginWaitForNetworkConnectivity_(nullptr) |
| 102 | { |
| 103 | |
| 104 | if (!engineSettings_.loadFromSettings()) { |
| 105 | qCInfo(LOG_BASIC) << "Use default engine settings since the previous ones were not loaded"; |
| 106 | } |
| 107 | qCInfo(LOG_BASIC) << "Engine settings" << engineSettings_; |
| 108 | |
| 109 | auto wsnetLoggerCallback = [](const std::string &logStr) { |
| 110 | // log wsnet outputs without formatting |
| 111 | auto logger = spdlog::get("raw"); |
| 112 | if (logger) { |
| 113 | logger->info(logStr); |
| 114 | } |
| 115 | }; |
| 116 | |
| 117 | // Design Note: |
| 118 | // Hardcoding the AmneziaWG protocol version since we cannot retrieve it from the AmneziaWG binary. |
| 119 | QSettings settings; |
| 120 | std::string wsnetSettings = settings.value("wsnetSettings").toString().toStdString(); |
| 121 | bool bWsnetSuccess = WSNet::initialize(Utils::getBasePlatformName().toStdString(), Utils::getPlatformNameSafe().toStdString(), |
nothing calls this directly
no test coverage detected