Post

Replies

Boosts

Views

Activity

Reply to Xcode 15.0 Beta: NEPacketTunnelProvider is only available in tvOS 17.0 or newer
Somehow it's working fine again. however the extension keeps not working: ASI found [CoreFoundation] (sensitive) '*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** NSExtensionPrincipalClass PacketTunnel.PacketTunnelProvider must implement at least one public protocol'' class PacketTunnelProvider: NEPacketTunnelProvider { override func startTunnel(options: [String : NSObject]? = nil, completionHandler: @escaping (Error?) -> Void) { completionHandler(nil) } override func stopTunnel(with reason: NEProviderStopReason, completionHandler: @escaping () -> Void) { completionHandler() } } <?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>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict> <key>NSExtension</key> <dict> <key>NSExtensionPointIdentifier</key> <string>com.apple.networkextension.packet-tunnel</string> <key>NSExtensionPrincipalClass</key> <string>$(PRODUCT_MODULE_NAME).PacketTunnelProvider</string> </dict> </dict> </plist> Xcode version: 15.0 Beta tvOS version: 17.0 (21J5273q)
Jun ’23
Reply to New 60s timer when instantiating PacketTunnelProvider
I have received some customer feedback that after upgrading iOS to 16.5, the VPN will disconnect frequently and randomly. They reported that they had never encountered this problem before upgrading, and I did not find any crash records on the App Store. I suspect something to do with the iOS timer implementation. After they upgraded to iOS 16.5.1, the problem persisted. I also have an old app that hasn't been updated in 2 years and has always been very stable. They reported that after upgrading iOS to 16.5, it will also be automatically disconnected. Oddly for those customers who didn't experience this issue, the VPN never disconnected automatically. For devices that encounter this problem, whether it is restarting, reinstalling, or resetting the network, it cannot be solved.
Jun ’23
Reply to NetworkExtension - NEIPC: SIGNAL 5 Trace/BPT trap, Help!!
@eskimo Yes, I send a message in the APP to ask the tunnel to restart the internal service, not the entire extension process. The benefit of this is that reconnection takes less time and is simpler. I mainly handle restarting the service in handleAppMessage(): Clear current configuration through setTunnelNetworkSettings(nil) Call setTunnelNetworkSettings(settings) for configuration In fact, I don't want to call setTunnelNetworkSettings before restarting the service, but I can't clear the DNS cache data without doing this, so I have to do this. handleAppMessage looks more like: open override func handleAppMessage(_ messageData: Data, completionHandler: ((Data?) -> Void)?) { reasserting = true setTunnelNetworkSettings(nil) { error in // settings = .... setTunnelNetworkSettings(settings) { reasserting = false proxy.restart() completionHandler("ok"...) } } } I suspect there is a memory error inside setTunnelNetworkSettings(...) that causes completionHandler("ok"...) to fail occasionally things would be simpler if NEVPNConnection provided restartVPNTunnel().
Jan ’24