今天集團(tuán)的另個(gè)一App也收到了一樣的問題,但是蘋果的回復(fù)明確說明是在低版本上調(diào)用了WebKit,造成安全隱患。so,還是老老實(shí)實(shí)升級(jí)iOS8或者只用UIWebView吧。
今天蘋果審核收到了一個(gè)2.5.1大禮包,蘋果回復(fù)如下
最新回復(fù)如下
Guideline 2.5.1 - Performance - Software Requirements
Your app uses or references the following non-public APIs:
WebKit.frameworkwith a minimum OS from before WebKit was made public.
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
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.
看報(bào)的錯(cuò),說我們調(diào)用了WebKit的私有API。按照他的提示,使用 otool 工具,對(duì)二進(jìn)制包進(jìn)行分析,也是提示引入PrivateFramework。?
分析代碼如下

其中確實(shí)有說WebKit是從私有庫(kù)引入的。這樣就很奇怪了,WebKit什么時(shí)候變成私有庫(kù)了?
帶著這個(gè)疑問,goole了下,果然有點(diǎn)線索
https://stackoverflow.com/questions/25897123/including-webkit-framework-for-ios8-fails-validation
如鏈接里的所說,在支持iOS7的情況下,引入WKWebView會(huì)報(bào)錯(cuò),而最低版本支持iOS8就不會(huì)。結(jié)合自己本身業(yè)務(wù),也確實(shí)是這樣處理的,我們的app任舊在支持iOS7,在iOS8以下使用UIWebView,在iOS8及以上使用WKWebView,也一直這么使用,從來沒出什么問題。
根據(jù)這個(gè)信息,進(jìn)行了以下測(cè)試:
1、先取消項(xiàng)目里相關(guān)的WebKit引用,代碼里全部使用UIWebView,打出的包再進(jìn)行otool -L分析,確實(shí)再?zèng)]有如上圖一樣的PrivateFrameworks字條。
2、代碼里取消WebKit引用,但是在配置里引入WebKit.framework,otool -L分析后如上圖一樣,提示PrivateFrameworks
3、代碼不做處理,將最低版本支持從iOS7.0提升到iOS8.0,otool -L分析后也是沒有PrivateFrameworks提示
結(jié)論很明顯,是在支持了iOS7并引入了WebKit庫(kù)之后才會(huì)出現(xiàn)的問題。
結(jié)論:
這里有幾個(gè)解決方案供參考
1、將最低版本支持提升到iOS8
2、如果業(yè)務(wù)里嵌入不深的話,可以考慮取消WKWebview的引用,任舊使用UIWebView
3、跟蘋果審核申訴
第三條我自己本身也沒試過,不確定能不能行。但是按照邏輯這個(gè)不是因?yàn)槲覀冎鲃?dòng)調(diào)用私有api造成的問題,有理由進(jìn)行申訴。
PS:
在這次拒審之前,我們也接收到了另一個(gè)5.2.1,不確定這次新的問題是不是上次的延伸。因?yàn)橹貋頉]有出現(xiàn)過認(rèn)為WebKit是私有庫(kù)的報(bào)錯(cuò)。
之前的問題是調(diào)用了
WebActionDisablingCALayerDelegate,PrivateFrameworks/WebKit.framework
來解決WebView在有些系統(tǒng)上偶現(xiàn)的crash問題,這個(gè)確實(shí)是私有接口。但是之前很長(zhǎng)一段時(shí)間內(nèi)是正常提審的。