mirror of
https://github.com/wanghongenpin/proxypin.git
synced 2026-05-20 16:15:47 +08:00
ios初始化
This commit is contained in:
41
ios/ProxyPin/AppProxyProvider.swift
Normal file
41
ios/ProxyPin/AppProxyProvider.swift
Normal file
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// AppProxyProvider.swift
|
||||
// ProxyPin
|
||||
//
|
||||
// Created by 汪红恩 on 2023/7/2.
|
||||
//
|
||||
|
||||
import NetworkExtension
|
||||
|
||||
class AppProxyProvider: NEAppProxyProvider {
|
||||
|
||||
override func startProxy(options: [String : Any]? = nil, completionHandler: @escaping (Error?) -> Void) {
|
||||
|
||||
}
|
||||
|
||||
override func stopProxy(with reason: NEProviderStopReason, completionHandler: @escaping () -> Void) {
|
||||
// Add code here to start the process of stopping the tunnel.
|
||||
completionHandler()
|
||||
}
|
||||
|
||||
override func handleAppMessage(_ messageData: Data, completionHandler: ((Data?) -> Void)?) {
|
||||
// Add code here to handle the message.
|
||||
if let handler = completionHandler {
|
||||
handler(messageData)
|
||||
}
|
||||
}
|
||||
|
||||
override func sleep(completionHandler: @escaping() -> Void) {
|
||||
// Add code here to get ready to sleep.
|
||||
completionHandler()
|
||||
}
|
||||
|
||||
override func wake() {
|
||||
// Add code here to wake up.
|
||||
}
|
||||
|
||||
override func handleNewFlow(_ flow: NEAppProxyFlow) -> Bool {
|
||||
// Add code here to handle the incoming flow.
|
||||
return false
|
||||
}
|
||||
}
|
||||
13
ios/ProxyPin/Info.plist
Normal file
13
ios/ProxyPin/Info.plist
Normal file
@@ -0,0 +1,13 @@
|
||||
<?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>NSExtension</key>
|
||||
<dict>
|
||||
<key>NSExtensionPointIdentifier</key>
|
||||
<string>com.apple.networkextension.app-proxy</string>
|
||||
<key>NSExtensionPrincipalClass</key>
|
||||
<string>$(PRODUCT_MODULE_NAME).AppProxyProvider</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
5
ios/ProxyPin/ProxyPin.entitlements
Normal file
5
ios/ProxyPin/ProxyPin.entitlements
Normal file
@@ -0,0 +1,5 @@
|
||||
<?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/>
|
||||
</plist>
|
||||
Reference in New Issue
Block a user