有没有任何私人api来监控网络流量在iPhone上? [英] Is there any private api to monitor network traffic on iPhone?

查看:215
本文介绍了有没有任何私人api来监控网络流量在iPhone上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要实现一个应用程序,以监视iPhone上的不同应用程序的入站/出站连接。我的应用程序将在后台运行使用苹果的背景多任务功能voip和导航。
我可以使用私人api,因为我的客户不需要appstore上的这个应用程序。



谢谢。



我不需要任何私人Api来获取入站/出站活动连接的信息。
它只是你需要知道基本的C编程和一些耐心。



我写信给苹果开发论坛,并得到响应 -

 从我的角度来看,大多数我不得不说的这个问题在下面引用的帖子。 

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

在这方面取得进展是:

o从Mac OS X SDK获取相关的头文件

o查看Darwin源代码netstat查看这些片段如何组合

警告:使用此技术的应用程序发货时,存在严重的兼容性风险;它很好用于调试等,但我建议不要这样的运输代码给最终用户。

我一步一步做的是 -



1)从BSD下载了 netstat 代码opensource -



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,这样代码就可以在设备以及模拟器上工作。



4)在netstat代码中可能会发现一些小错误, files.egstruct xunpcb64.dont wory。你需要评论一些#if!TARGET_OS_EMBEDDED#else在那些头文件,以便ios sdk可以达到那些if条件和访问的定义。(需要一些try和error.be病人。)



5)最后你将可以编译你的代码.Cheers !!


I need to implement an app that monitors inbound/outbound connections by different apps on iPhone. my app is going to run in background using apple's background multitasking feature for voip and navigators. I can use private api as my client doesn't need this app on appstore.

Thanks.

解决方案

I got through this.

I didn't need any private Api to get information of inbound/outbound active connections. Its just you need to know basic C programming and some patience.

I wrote to apple dev forums regarding this,and got response as-

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.

What I did step by step is -

1)downloaded code of netstat from BSD opensource -

2)add this to your new iphone project.

3)see,some header files are not present in ios sdk so you need take it copied from opensource.apple.com and add those in your iphone sdk at relevant path under-

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

My xcode version is 4.5.2. so this is path relevent to my xcode. you can have different path according to versions of xcodes.Anyway. and remember to add those headers in both iosSdk & iOSSimulatorSdk both so that code will work on device as well as on simulator.

4)you may find some minor errors in netstat code relating not finding definitions of some structures in header files.e.g " struct xunpcb64 " .dont wory. definitions are present there.you need to comment some "#if !TARGET_OS_EMBEDDED" #else in those header files so that ios sdk can reach in those if condition and access the definition.(need some try and error.be patient.)

5)finally you will be abe to compile your code.Cheers!!

这篇关于有没有任何私人api来监控网络流量在iPhone上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆