4

我正在尝试了解有关 NEAppProxyProvider 的更多信息,因为我正在尝试为每个应用程序 vpn 开发一个 mac OSX。

已经实现的是可以启动应用代理,并且使用 SafariDomains 设置来自 Safari 的流可以由 AppProxyProvider 中的 handleNewFlow 捕获。现在,我正在尝试使用配置文件中设置的 com.apple.vpn.managed.appmapping 从指定的应用程序中捕获一些其他流。但是安装配置文件后,配置文件中只显示一个设置。我用谷歌搜索试图找到个人资料的示例或​​模板,但没有得到任何帮助。请帮我检查以下配置文件,看看是否有任何问题。

这是在数组中包含两个字典的配置文件。第一个 dict 适用于 Safari 流。第二个字典适用于每个应用程序的 vpn,但它似乎无法正确安装并且不起作用。自从我从苹果开发者论坛了解到 SafariDomains 不能与应用程序映射一起使用后,SafariDomains 部分已被删除。

<?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>PayloadContent</key>
    <array>
        <dict>
            <key>IPv4</key>
            <dict>
                <key>OverridePrimary</key>
                <integer>0</integer>
            </dict>
            <key>PayloadDescription</key>
            <string>Configures VPN settings</string>
            <key>PayloadDisplayName</key>
            <string>VPN</string>
            <key>PayloadIdentifier</key>
            <string>com.apple.vpn.managed.applayer.330FBB83-639F-4F9E-9FA1-4FAC93E18B68</string>
            <key>PayloadType</key>
            <string>com.apple.vpn.managed.applayer</string>
            <key>PayloadUUID</key>
            <string>330FBB83-639F-4F9E-9FA1-4FAC93E18B68</string>
            <key>PayloadVersion</key>
            <integer>1</integer>
            <key>Proxies</key>
            <dict>
                <key>HTTPEnable</key>
                <integer>0</integer>
                <key>HTTPSEnable</key>
                <integer>0</integer>
            </dict>
            <key>UserDefinedName</key>
            <string>appmapping</string>
            <key>VPN</key>
            <dict>
                <key>AuthName</key>
                <string>somebody</string>
                <key>AuthPassword</key>
                <string>opendoor</string>
                <key>AuthenticationMethod</key>
                <string>Password</string>
                <key>ProviderBundleIdentifier</key>
                <string>com.blob.macappproxy.macappproxy</string>
                <key>ProviderType</key>
                <string>app-proxy</string>
                <key>RemoteAddress</key>
                <string>127.0.0.1</string>
            </dict>
            <key>VPNSubType</key>
            <string>com.blob.macappproxy</string>
            <key>VPNType</key>
            <string>VPN</string>
            <key>OnDemandMatchAppEnabled</key>
            <integer>1</integer>
            <key>VendorConfig</key>
            <dict/>
            <key>VPNUUID</key>
            <string>3D7A07D8-97D0-4E5A-BB04-1EB82DD12A35</string>
        </dict>
        <dict>
            <key>PayloadDescription</key>
            <string>Configures Per APP VPN mapping</string>
            <key>PayloadDisplayName</key>
            <string>Per APP VPN mapping</string>
            <key>PayloadIdentifier</key>
            <string>com.apple.vpn.managed.appmapping.A88E1A77-2CC2-4BF9-879C-97C3DF491EB2</string>
            <key>PayloadType</key>
            <string>com.apple.vpn.managed.appmapping</string>
            <key>PayloadUUID</key>
            <string>A88E1A77-2CC2-4BF9-879C-97C3DF491EB2</string>
            <key>PayloadVersion</key>
            <integer>1</integer>
            <key>UserDefinedName</key>
            <string>perappvpn</string>
            <key>AppLayerVPNMapping</key>
            <array>
                <dict>
                    <key>Identifier</key>
                    <string>com.google.Chrome</string>
                    <key>VPNUUID</key>
                    <string>3D7A07D8-97D0-4E5A-BB04-1EB82DD12A35</string>
                    <key>DesignatedRequirement</key>
                    <string>(identifier &quot;com.google.Chrome&quot; or identifier &quot;com.google.Chrome.beta&quot; or identifier &quot;com.google.Chrome.dev&quot; or identifier &quot;com.google.Chrome.canary&quot;) and certificate leaf = H&quot;c9a99324ca3fcb23dbcc36bd5fd4f9753305130a&quot;</string>
                    <key>SigningIdentifier</key>
                    <string>com.google.Chrome</string>
                </dict>
            </array>
        </dict>
    </array>
    <key>PayloadDisplayName</key>
    <string>some app proxy</string>
    <key>PayloadIdentifier</key>
    <string>blob-MacBook-Pro.A953E629-CD95-45B4-A42D-ECA2BA870A79</string>
    <key>PayloadRemovalDisallowed</key>
    <false/>
    <key>PayloadType</key>
    <string>Configuration</string>
    <key>PayloadUUID</key>
    <string>1AEA709E-46D3-4293-B1E3-23EB8DD5B361</string>
    <key>PayloadVersion</key>
    <integer>1</integer>
</dict>
</plist>

应该怎么修改,让appproxyprovider的handleNewFlow方法捕获指定应用的网络流量?或者有人可以粘贴一个可行的配置文件吗?

4

0 回答 0