检查私有API“使用情况”自己呢? [英] Check for private API "usage" yourself?
问题描述
因此,我们都知道Apple禁止在iOS应用中使用私有或未记录的API。我对此没有任何问题,因为有充分的技术原因可以解释为什么这是一个好主意。但是,现在我有两次使用私有API拒绝了应用程序,而事实并非如此。这并不困难 - 私有API包括符号,如 connectionState
, setThumbnail
, setOrder
等等。您对名为的方法所做的任何调用都将被标记为私有API使用,即使被调用的方法是您自己定义的方法。对于使用连接,缩略图或事物顺序执行某项操作的程序,上面提到的方法名称并非不太可能。在等待新审核时,被拒绝并且必须重命名方法并重新提交至少延迟一周。
So, we all know Apple forbids using private or undocumented APIs in iOS apps. I have no problem with this, as there are sound technical reasons for why this is a good idea. However, twice now I've had an app rejected for using private APIs, when this was not actually the case. It's not difficult -- the private APIs include symbols like connectionState
, setThumbnail
, setOrder
and so on. Any calls you make to methods named as such will be flagged as a private API use, even if the method being called is something you have defined yourself. For a program doing something with connections, thumbnails or the order of things, the above mentioned method names aren't all that unlikely. Getting rejected for this and having to rename a method and resubmit delays everything by at least a week while you wait for a new review.
所以有办法,使用 nm
,iOS框架的类转储等,如果您的方法名称与其中的任何内容冲突,请找出自己?如果是这样,我们有可能在发布之前纠正这个问题并避免不必要的拒绝。
So is there a way, using nm
, class dumps of the iOS frameworks, etc to find out for yourself if your method names conflicts with anything in there? If so, we could have a chance of correcting this before release and avoiding unnecessary rejection.
推荐答案
我建议使用App Scanner 。它会分析您的.app文件以获取私有API方法的用法。当前版本不支持私有API实例变量,但可能会在未来版本中使用。
I'd suggest using App Scanner. It analyzes your .app file for private API method usage. The current version doesn't support private API instance variables but that might get worked into a future version.
它将捕获已命名为私有API的方法方法,即使它有自己的实现。此外,它会在方法中捕获@selectors(就像官方iOS自动检查器一样)。
It will catch methods that have been named the same as a private API method, even if it has it's own implementation. Also, it'll catch @selectors inside methods (just like the official iOS automated checker).
link - > https://github.com/ChimpStudios/App-Scanner
link --> https://github.com/ChimpStudios/App-Scanner
这篇关于检查私有API“使用情况”自己呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!