私有API检测

私有API分类

  1. 不成熟的API
  2. 苹果已有, 成熟的, 但是不让用的

使用私有API, 可能会被拒

被拒绝原因苹果邮件有会提示, 包括解决的方案

3个工具的使用

strings

只能对二进制文件进行使用
作用: 输出二进制文件中4字节以上可以输出的代码
不能绝对的判定出那个地方出现了私有API代码

otool

otool -ov
作用: 输出类结构和方法

nm

输出文件的符号表信息

搜索文件命令

grep -r LSApplicationWorkspace .
grep: 搜索文件
-r: 遍历文件夹
.: 当前目录

grep: 可以搜索明文+二进制文件的内容

如果发现自己代码有私有API, 就修改
如果发现是第三方SDK有私有API, 就升级SDK或者更换

We discovered that your app contains hidden features. 

The next submission of this app may require a longer review time.

Next Steps

- Review the Performance section of the App Store Review Guidelines.
- Ensure your app is compliant with all sections of the App Store Review Guidelines and the Terms & Conditions of the Apple Developer Program. 
- Once your app is fully compliant, resubmit your app for review.

Submitting apps designed to mislead or harm customers or evade the review process may result in the termination of your Apple Developer Program account. Review the Terms & Conditions of the Apple Developer Program to learn more about our policies regarding termination.

If you have reviewed the App Store Review Guidelines and believe we have made an error in your app’s review, you may submit an appeal or provide additional details about your app by responding directly to this message.

Guideline 2.5.1 - Performance - Software Requirements


Your app uses or references the following non-public APIs:

LSApplicationWorkspace, defaultWorkspace, openSensitiveURL:withOptions:

The use of non-public APIs is not permitted on the App Store because it can lead to a poor user experience should these APIs change. 

Continuing to use or conceal non-public APIs in future submissions of this app may result in the termination of your Apple Developer account, as well as removal of all associated apps from the App Store.

Next Steps

To resolve this issue, please revise your app to remove any non-public APIs. If you have defined methods in your source code with the same names as the above-mentioned APIs, we suggest altering your method names so that they no longer collide with Apple's private APIs to avoid your app being flagged in future submissions.

Additionally, if you are using third-party libraries, please update to the most recent version of those libraries. If you do not have access to the libraries' source, you may be able to search the compiled binary using the "strings" or "otool" command line tools. The "strings" tool can output a list of the methods that the library calls and "otool -ov" will output the Objective-C class structures and their defined methods. These tools can help you narrow down where the problematic code resides. You could also use the "nm" tool to verify if any third-party libraries are calling these APIs.

Resources

For information on the "nm" tool, please review the "nm tool" Xcode manual page.

If there are no alternatives for providing the functionality your app requires, you can file an enhancement request.

Guideline 2.5.1 - Performance - Software Requirements


Your app uses the "prefs:root=" non-public URL scheme, which is a private entity. The use of non-public APIs is not permitted on the App Store because it can lead to a poor user experience should these APIs change.

Continuing to use or conceal non-public APIs in future submissions of this app may result in the termination of your Apple Developer account, as well as removal of all associated apps from the App Store.

Next Steps

To resolve this issue, please revise your app to provide the associated functionality using public APIs or remove the functionality using the "prefs:root" or "App-Prefs:root" URL scheme.

If there are no alternatives for providing the functionality your app requires, you can file an enhancement request.

你可能感兴趣的:(私有API检测)