mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-24 02:00:24 +07:00
Various fixes for iOS (#126)
* Readme update, solution for wireguard make in M1 machines, * import file and restore enabled. * xcode_patcher.rb fixed, Now no need to add openVPN framewrok in Embed frameworks manually. * Now xcode_patcher.rb will add OpenVPN Framework to Embed Frameworks in main target, instead of Network extension. * Update iosvpnprotocol.swift * Protocol wasn't detected because it is working on localized description of tunnel, fixed cases. * Code cleanup * Speed issue fixed for wireguard. * GetDeviceIp and bytes(speed of OpenVPN) fixed. *Device IP method wasn't working as expected, so I replaced. and for speed in OpenVPN we need to handle message seperately for bytes. *QR progress added with progressbar and text.
This commit is contained in:
@@ -125,7 +125,7 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
|
||||
case .wireguard:
|
||||
handleWireguardAppMessage(messageData, completionHandler: completionHandler)
|
||||
case .openvpn:
|
||||
handleWireguardAppMessage(messageData, completionHandler: completionHandler)
|
||||
handleOpenVPNAppMessage(messageData, completionHandler: completionHandler)
|
||||
case .shadowsocks:
|
||||
break
|
||||
// handleShadowSocksAppMessage(messageData, completionHandler: completionHandler)
|
||||
@@ -297,6 +297,21 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
|
||||
}
|
||||
}
|
||||
|
||||
private func handleOpenVPNAppMessage(_ messageData: Data, completionHandler: ((Data?) -> Void)? = nil) {
|
||||
guard let completionHandler = completionHandler else { return }
|
||||
if messageData.count == 1 && messageData[0] == 0 {
|
||||
let bytesin = ovpnAdapter.transportStatistics.bytesIn
|
||||
let strBytesin = "rx_bytes=" + String(bytesin);
|
||||
|
||||
let bytesout = ovpnAdapter.transportStatistics.bytesOut
|
||||
let strBytesout = "tx_bytes=" + String(bytesout);
|
||||
|
||||
let strData = strBytesin + "\n" + strBytesout;
|
||||
let data = Data(strData.utf8)
|
||||
completionHandler(data)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
private func handleShadowSocksAppMessage(_ messageData: Data, completionHandler: ((Data?) -> Void)? = nil) {
|
||||
guard let completionHandler = completionHandler else { return }
|
||||
|
||||
Reference in New Issue
Block a user