查找私有 API 调用 _terminateWithStatus

发布于 2024-11-29 15:51:59 字数 2198 浏览 1 评论 0原文

我刚刚收到一封来自 Apple 的电子邮件,指出我的应用程序因 _terminateWithStatus 的调用而被拒绝。我的应用程序中有一些框架,我相信这可能是罪魁祸首。

我已经运行了 otool 这是我的输出

/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
/System/Library/Frameworks/Foundation.framework/Foundation (compatibility version 300.0.0, current version 751.49.0)
/System/Library/Frameworks/UIKit.framework/UIKit (compatibility version 1.0.0, current version 1400.0.0)
/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics (compatibility version 64.0.0, current version 600.0.0)
/System/Library/Frameworks/CoreData.framework/CoreData (compatibility version 1.0.0, current version 320.15.0)
/System/Library/Frameworks/MapKit.framework/MapKit (compatibility version 1.0.0, current version 14.0.0)
/System/Library/Frameworks/CFNetwork.framework/CFNetwork (compatibility version 1.0.0, current version 485.12.7)
/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration (compatibility version 1.0.0, current version 379.0.0)
/System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices (compatibility version 1.0.0, current version 20.0.0)
/System/Library/Frameworks/CoreLocation.framework/CoreLocation (compatibility version 1.0.0, current version 370.3.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 150.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.4.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)
/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation (compatibility version 150.0.0, current version 550.52.0)

我还通过 App Scanner 运行了应用程序,但未显示 TerminateWithStatus在输出中。

谁能指出我找到这个的正确方向?我还看到一些关于使用 nm 和 grep 来查找调用的讨论。提前致谢。

已解决:

深入到构建目录后:

AppName/build/AppName.build/Release-iphoneos/AppName.build/Objects-normal/armv6/ 

我运行:

strings AppName | grep 'terminateWithStatus'

并返回一个结果。经过一番挖掘,我发现测试框架 GHUnit 正在发起调用。我删除了框架,重新构建,然后再次运行字符串命令,但没有任何结果。

我希望这可以帮助任何其他搜索私有 API 调用的人,这并不是一次有趣的冒险。

I just received an email from Apple stating my app has been rejected for the call of _terminateWithStatus. I have a few frameworks in the app and believe that could be the culprit.

I have ran otool here is my output

/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
/System/Library/Frameworks/Foundation.framework/Foundation (compatibility version 300.0.0, current version 751.49.0)
/System/Library/Frameworks/UIKit.framework/UIKit (compatibility version 1.0.0, current version 1400.0.0)
/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics (compatibility version 64.0.0, current version 600.0.0)
/System/Library/Frameworks/CoreData.framework/CoreData (compatibility version 1.0.0, current version 320.15.0)
/System/Library/Frameworks/MapKit.framework/MapKit (compatibility version 1.0.0, current version 14.0.0)
/System/Library/Frameworks/CFNetwork.framework/CFNetwork (compatibility version 1.0.0, current version 485.12.7)
/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration (compatibility version 1.0.0, current version 379.0.0)
/System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices (compatibility version 1.0.0, current version 20.0.0)
/System/Library/Frameworks/CoreLocation.framework/CoreLocation (compatibility version 1.0.0, current version 370.3.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 150.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.4.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)
/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation (compatibility version 150.0.0, current version 550.52.0)

I have also run the app through App Scanner but terminateWithStatus is not shown in the output.

Can anyone point me in the right direction on finding this? I have also seen some talk about using nm and grep to find the call. Thanks ahead of time.

SOLVED:

After diving into the build directory:

AppName/build/AppName.build/Release-iphoneos/AppName.build/Objects-normal/armv6/ 

I ran:

strings AppName | grep 'terminateWithStatus'

and returned one result. After some digging, I found GHUnit, testing framework, was making the call. I removed the framework, rebuilt, and ran the string command again without any results.

I hope this helps anyone else searching for a Private API call, it has not been a fun adventure.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

昔日梦未散 2024-12-06 15:51:59

您必须在可执行文件上运行 otool,而不是在应用程序包装器上运行。

例如(很抱歉格式奇怪):

$ otool -L WriteRoom.app/Contents/MacOS/WriteRoom 

WriteRoom.app/Contents/MacOS/WriteRoom (architecture ppc):
    @executable_path/../Frameworks/Blocks.framework/Versions/A/Blocks (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 11.0.0)
    /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.3)

WriteRoom.app/Contents/MacOS/WriteRoom (architecture i386):
    @executable_path/../Frameworks/Blocks.framework/Versions/A/Blocks (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 11.0.0)
    /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.3)

You have to run otool on the executable, not on the app wrapper.

For example (sorry for the formatting weirdness):

$ otool -L WriteRoom.app/Contents/MacOS/WriteRoom 

WriteRoom.app/Contents/MacOS/WriteRoom (architecture ppc):
    @executable_path/../Frameworks/Blocks.framework/Versions/A/Blocks (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 11.0.0)
    /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.3)

WriteRoom.app/Contents/MacOS/WriteRoom (architecture i386):
    @executable_path/../Frameworks/Blocks.framework/Versions/A/Blocks (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 11.0.0)
    /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.3)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文