最近我的好友遇到一个问题,他上线 iOS 项目的时候由于被查到使用私用 API 被拒。利用这次机会给大家普及一下利用逆向的思维定位私有 API 所在的位置。
X同学:“素燕,忙吗?请教一个问题。「刚接手」了个项目,最近上线的时候,苹果说我使用了私有 API,但是我在项目中根本找不到这个私有 API。但是我用 grep 命令确实能找到这个 api,如何才能定位到这个 API 在哪个类里使用吗?”。
为了确认他给我描述的问题确实是他要解决的问题,我说道:“我看看苹果给你发的被拒内容”。
拿到被拒的内容如下:
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.
Specifically, your app uses the following non-public URL scheme:
prefs:root=notifications_id
Continuing to use or conceal non-public APIs in future submissions of this app may result in the termination of your Apple Developer ac