change icon, handle last_handshake_time_sec, remove TODO
|
|
@ -52,7 +52,6 @@ endif()
|
|||
qt_standard_project_setup()
|
||||
qt_add_executable(${PROJECT} MANUAL_FINALIZATION)
|
||||
|
||||
# TODO error in there
|
||||
if(WIN32 OR (APPLE AND NOT IOS AND NOT MACOS_NE) OR (LINUX AND NOT ANDROID))
|
||||
message("Run this block when MACOS_NE is not defined or set to FALSE")
|
||||
qt_add_repc_replicas(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../ipc/ipc_interface.rep)
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 421 B After Width: | Height: | Size: 682 B |
|
Before Width: | Height: | Size: 946 B After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 946 B After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 340 KiB |
BIN
client/macos/app/Images.xcassets/AppIcon.appiconset/64.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
client/macos/app/Images.xcassets/AppIcon.appiconset/64@2x.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
|
|
@ -112,9 +112,19 @@ extension PacketTunnelProvider {
|
|||
}
|
||||
}
|
||||
|
||||
let lastHandshakeString = settingsDictionary["last_handshake_time_sec"]
|
||||
let lastHandshake: Int64
|
||||
|
||||
if let lastHandshakeValue = lastHandshakeString, let handshakeValue = Int64(lastHandshakeValue) {
|
||||
lastHandshake = handshakeValue
|
||||
} else {
|
||||
lastHandshake = -2 // Trả về lỗi nếu không có giá trị last_handshake_time_sec
|
||||
}
|
||||
|
||||
let response: [String: Any] = [
|
||||
"rx_bytes": settingsDictionary["rx_bytes"] ?? "0",
|
||||
"tx_bytes": settingsDictionary["tx_bytes"] ?? "0"
|
||||
"tx_bytes": settingsDictionary["tx_bytes"] ?? "0",
|
||||
"last_handshake_time_sec": lastHandshake
|
||||
]
|
||||
|
||||
completionHandler(try? JSONSerialization.data(withJSONObject: response, options: []))
|
||||
|
|
|
|||
|
|
@ -251,6 +251,19 @@ void IosController::checkStatus()
|
|||
sendVpnExtensionMessage(message, [&](NSDictionary* response){
|
||||
uint64_t txBytes = [response[@"tx_bytes"] intValue];
|
||||
uint64_t rxBytes = [response[@"rx_bytes"] intValue];
|
||||
|
||||
uint64_t last_handshake_time_sec = 0;
|
||||
if (response[@"last_handshake_time_sec"] && ![response[@"last_handshake_time_sec"] isKindOfClass:[NSNull class]]) {
|
||||
last_handshake_time_sec = [response[@"last_handshake_time_sec"] intValue];
|
||||
} else {
|
||||
qDebug() << "Key last_handshake_time_sec is missing or null";
|
||||
}
|
||||
|
||||
if (last_handshake_time_sec < 0) {
|
||||
disconnectVpn();
|
||||
qDebug() << "Invalid handshake time, disconnecting VPN.";
|
||||
}
|
||||
|
||||
emit bytesChanged(rxBytes - m_rxBytes, txBytes - m_txBytes);
|
||||
m_rxBytes = rxBytes;
|
||||
m_txBytes = txBytes;
|
||||
|
|
|
|||