简体   繁体   English

记录iOS本机设备功能和API调用

[英]Logging iOS Native device feature and API calls

I am writing a dynamic analyzer for iOS apps and I would like to programatically track/log (without changing the source code of the app) all the API calls that access iOS Native features: Using the Camera, Barcode Scanner, Geolocation, Contact, InAppBrowser, Accelerometer, Maps, Calls, ... during the execution of the app. 我正在为iOS应用编写动态分析器,我想以编程方式跟踪/记录(不更改应用的源代码)所有访问iOS本机功能的API调用:使用相机,条形码扫描仪,地理位置,联系人,InAppBrowser ,加速度计,地图,通话等...在应用执行期间。 I want this to be as general as possible and not specific to a particular app code. 我希望它尽可能通用,而不是特定于特定的应用程序代码。 I am considering using Objective-C Categories and Extensions on each class. 我正在考虑在每个类上使用Objective-C类别和扩展。

Any other solutions? 还有其他解决方案吗?

You can try to use method swizzle to add tracking code when app call certain system functions. 当应用调用某些系统功能时,您可以尝试使用swizzle方法添加跟踪代码。 And use + (void)load to init the swizzling. 并使用+ (void)load来初始化。 This should be able to avoid any code change to existing codebase. 这应该能够避免对现有代码库进行任何代码更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM