Sync Zonghengjia iPhone and iPad 1.0.4 source candidate

This commit is contained in:
2026-11-15 14:04:42 +00:00
parent 295799b1ab
commit cecd21fedf
20 changed files with 184 additions and 209 deletions
+10 -10
View File
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.networking.networkextension</key>
<array>
<string>packet-tunnel-provider</string>
</array>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.networking.networkextension</key>
<array>
<string>packet-tunnel-provider</string>
</array>
</dict>
</plist>
+2 -7
View File
@@ -113,8 +113,8 @@ final class PacketTunnelProvider: NEPacketTunnelProvider {
let settings = NEPacketTunnelNetworkSettings(tunnelRemoteAddress: remoteAddress)
let ipv4 = NEIPv4Settings(addresses: ["198.18.0.1"], subnetMasks: ["255.255.0.0"])
ipv4.includedRoutes = [NEIPv4Route.default()]
if Self.isIPv4Address(remoteAddress) {
ipv4.excludedRoutes = [NEIPv4Route(destinationAddress: remoteAddress, subnetMask: "255.255.255.255")]
ipv4.excludedRoutes = NetworkAddress.tunnelUnderlayIPv4(remoteAddress).map {
NEIPv4Route(destinationAddress: $0, subnetMask: "255.255.255.255")
}
settings.ipv4Settings = ipv4
@@ -149,11 +149,6 @@ final class PacketTunnelProvider: NEPacketTunnelProvider {
return nil
}
private static func isIPv4Address(_ value: String) -> Bool {
var address = in_addr()
return value.withCString { inet_pton(AF_INET, $0, &address) } == 1
}
private static func resolveIPv4Address(_ host: String) throws -> String {
if NetworkAddress.isPublicIPv4(host) { return host }