gpt4 book ai didi

ios - 如何检测是否有任何外部库正在调用 [UIDevice currentDevice] uniqueIdentifier]?

转载 作者:技术小花猫 更新时间:2023-10-29 11:14:38 26 4
gpt4 key购买 nike

所以,since Apple is now rejecting apps that access UDID , 在我们公司当前的项目中,我们需要消除所有调用此属性的 API:

[[UIDevice currentDevice] uniqueIdentifier]

我们已经消除了我们自己代码中的所有调用,但需要确保我们使用的许多外部库没有调用此属性。

确定库是否正在调用此属性的最可靠方法是什么?

提前致谢!

最佳答案

除了使用 otx(它似乎变得不稳定)之外,一种选择是在该方法上设置一个符号断点,然后运行该应用程序一段时间,看看是否命中它。

为该方法配置符号断点如下所示:

enter image description here

如果您碰到那个断点,您可以通过打开调试器控制台并键入 bt 来找出调用它的人。在这种情况下,调用来 self 的 application:didFinishLaunchingWithOptions: 但无论调用者是谁,它都有效:

(lldb) bt
* thread #1: tid = 0x1c03, 0x001f4690 UIKit`-[UIDevice uniqueIdentifier], stop reason = breakpoint 1.1
frame #0: 0x001f4690 UIKit`-[UIDevice uniqueIdentifier]
frame #1: 0x0000212e MyApp`-[AppDelegate application:didFinishLaunchingWithOptions:](self=0x0747fcb0, _cmd=0x005aec21, application=0x08366300, launchOptions=0x00000000) + 702 at AppDelegate.m:37
frame #2: 0x00015157 UIKit`-[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 266
frame #3: 0x00015747 UIKit`-[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1248
frame #4: 0x0001694b UIKit`-[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 805
frame #5: 0x00027cb5 UIKit`-[UIApplication handleEvent:withNewEvent:] + 1022
frame #6: 0x00028beb UIKit`-[UIApplication sendEvent:] + 85
frame #7: 0x0001a698 UIKit`_UIApplicationHandleEvent + 9874
frame #8: 0x01f01df9 GraphicsServices`_PurpleEventCallback + 339
frame #9: 0x01f01ad0 GraphicsServices`PurpleEventCallback + 46
frame #10: 0x01f1bbf5 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
frame #11: 0x01f1b962 CoreFoundation`__CFRunLoopDoSource1 + 146
frame #12: 0x01f4cbb6 CoreFoundation`__CFRunLoopRun + 2118
frame #13: 0x01f4bf44 CoreFoundation`CFRunLoopRunSpecific + 276
frame #14: 0x01f4be1b CoreFoundation`CFRunLoopRunInMode + 123
frame #15: 0x0001617a UIKit`-[UIApplication _run] + 774
frame #16: 0x00017ffc UIKit`UIApplicationMain + 1211
frame #17: 0x00001d42 MyApp`main(argc=1, argv=0xbffff3f8) + 130 at main.m:16

关于ios - 如何检测是否有任何外部库正在调用 [UIDevice currentDevice] uniqueIdentifier]?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15623660/

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