Apple如何知道您正在使用私有API? [英] How does Apple know you are using private API?

查看:466
本文介绍了Apple如何知道您正在使用私有API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我向Apple提交了一个没有任何源代码的二进制文件。

I submitted a binary file to Apple without any source code.

除了手动检查源代码外,Apple如何知道所使用的内容以及您调用的API?

Apart from manually checking the source code how does Apple know what was used and what APIs you have called?

推荐答案

我知道有3种方法。这些只是一些猜测,因为我不在Apple审核小组工作。

There are 3 ways I know. These are just some speculation, since I do not work in the Apple review team.

这将列出应用已链接到的所有库。你不应该使用的东西,比如IOKit和WebKit就可以被检测到。

This will list all libraries the app has linked to. Something clearly you should not use, like IOKit and WebKit can be detected by this.

这将列出所有链接的符号。这可以检测

This will list all linked symbols. This can detect


  • 未记录的C函数,例如_UIImageWithName;

  • Objective-C类,例如UIProgressHUD

  • Ivars,例如 UITouch._phase (这可能是拒绝基于Three20的应用程序最近几个月。)

  • Undocumented C functions such as _UIImageWithName;
  • Objective-C classes such as UIProgressHUD
  • Ivars such as UITouch._phase (which could be the cause of rejection of Three20-based apps last few months.)

Objective-C选择器存储在二进制文件的特殊区域中,因此,Apple可以从中提取内容,并检查您是否使用了一些未记录的Objective-C方法,例如 - [UIDevice setOrientation:]

Objective-C selectors are stored in a special region of the binary, and therefore Apple could extract the content from there, and check if you've used some undocumented Objective-C methods, such as -[UIDevice setOrientation:].

由于选择器独立于您正在发送的类,即使您的自定义类定义 -setOrientation:与之无关UIDevice,有可能被拒绝。

Since selectors are independent from the class you're messaging, even if your custom class defines -setOrientation: irrelevant to UIDevice, there will be a possibility of being rejected.

你可以使用 Erica Sadun的APIKit ,用于检测私人API(错误警报)导致的潜在拒绝。

You could use Erica Sadun's APIKit to detect potential rejection due to (false alarms of) private APIs.

(如果你真的真的想要解决这些检查,你可以使用运行时功能,例如

(If you really really really really want to workaround these checks, you could use runtime features such as


  • dlopen,dlsym

  • objc_getClass,sel_registerName,obj c_msgSend

  • -valueForKey:; object_getInstanceVariable,object_getIvar等

  • dlopen, dlsym
  • objc_getClass, sel_registerName, objc_msgSend
  • -valueForKey:; object_getInstanceVariable, object_getIvar, etc.

获取这些私有库,类,方法和ivars。 )

to get those private libraries, classes, methods and ivars. )

这篇关于Apple如何知道您正在使用私有API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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