gpt4 book ai didi

objective-c - 是否有任何私有(private) api 来监控 iPhone 上的网络流量?

转载 作者:可可西里 更新时间:2023-11-01 03:13:38 24 4
gpt4 key购买 nike

我需要实现一个应用程序来监控 iPhone 上不同应用程序的入站/出站连接。我的应用程序将使用苹果的 voip 和导航器后台多任务处理功能在后台运行。我可以使用私有(private) api,因为我的客户不需要应用商店中的这个应用。

谢谢。

最佳答案

我通过了这个。

我不需要任何私有(private) Api 来获取入站/出站事件连接的信息。您只需要了解基本的 C 编程和一些耐心即可。

我就此写信给苹果开发论坛,得到的回复是-

From my perspective most of what I have to say about this issue is covered in the post referenced below.

<https://devforums.apple.com/message/748272#748272>>

The way to make progress on this is to:

o grab the relevant headers from the Mac OS X SDK

o look at the Darwin source for netstat to see how the pieces fit together

WARNING: There are serious compatibility risks associated with shipping an app that uses this technique; it's fine to use this for debugging and so on, but I recommend against shipping code like this to end users.

我一步步做的是——

1) 下载 code of netstat来自 BSD 开源 -

2) 将其添加到您的新 iphone 项目中。

3)看,ios sdk 中不存在一些头文件,因此您需要从 opensource.apple.com 复制它并将其添加到您的 iphone sdk 中的相关路径下-

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/usr/include

我的 xcode 版本是 4.5.2。所以这是与我的 xcode 相关的路径。根据 xcodes.Anyway 的版本,你可以有不同的路径。并记住在 iosSdk 和 iOSSimulatorSdk 中添加这些 header ,以便代码可以在设备和模拟器上运行。

4) 你可能会在 netstat 代码中发现一些小错误,这些错误与在头文件中找不到某些结构的定义有关。例如“struct xunpcb64”。不要担心。那里有定义。您需要在这些头文件中注释一些“#if!TARGET_OS_EMBEDDED”#else,以便 ios sdk 可以到达那些 if 条件并访问定义。(需要一些尝试和错误。请耐心等待。)

5) 最后你可以编译你的代码了。干杯!!

关于objective-c - 是否有任何私有(private) api 来监控 iPhone 上的网络流量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13933312/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com