iOS 編譯Gmssl(no-async)

應(yīng)用上架被拒:

The app references non-public symbols : _getcontext, _makecontext, _setcontext. If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. In addition, note that one or more of the above APIs may be located in a static library that was included with your app. If so, they must be removed. If you think this message was sent in error and that you have only used Apple-published APIs in accordance with the guidelines, send the app's Apple ID, along with detailed information about why you believe the above APIs were incorrectly flagged, to appreview@apple.com.

使用了私有方法,發(fā)現(xiàn)是編譯GMSSL時(shí),內(nèi)部調(diào)用了這些方法,編譯時(shí)設(shè)置no-async就可以解決上述問題了。
首先下載GmSSL,準(zhǔn)備編譯armv7 armv7s i386 x86_64 arm64 等架構(gòu)的靜態(tài)庫(kù)。每個(gè)架構(gòu)對(duì)應(yīng)一個(gè)文件夾,將GmSSL代碼拷貝5份。

真機(jī)(arm64,armv7,armv7s):

  1. 執(zhí)行命令
./Configure iphoneos-cross no-shared -DOPENSSL_NO_ASYNC
  1. 修改Makefile
CROSS_TOP=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer
CROSS_SDK=iPhoneOS.sdk
CC= /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7(arm64/armv7s)
  1. 執(zhí)行make命令

模擬器(i386,x86_64):

  1. 執(zhí)行命令
./Configure iphoneos-cross no-shared -no-asm -DOPENSSL_NO_ASYNC
  1. 修改Makefile
CROSS_TOP=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer
CROSS_SDK=iPhoneSimulator.sdk
CC= /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386(x86_64)
  1. 執(zhí)行make命令

合并靜態(tài)庫(kù)

lipo -create arm64/GmSSL-master/libssl.a armv7/GmSSL-master/libssl.a armv7s/GmSSL-master/libssl.a x86_64/GmSSL-master/libssl.a i386/GmSSL-master/libssl.a -output libssl.a

lipo -create arm64/GmSSL-master/libcrypto.a armv7/GmSSL-master/libcrypto.a armv7s/GmSSL-master/libcrypto.a x86_64/GmSSL-master/libcrypto.a i386/GmSSL-master/libcrypto.a -output libcrypto.a
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,854評(píng)論 0 10
  • 為什么打出的靜態(tài)庫(kù)要支持這么多架構(gòu)? 看看這個(gè)文章:http://blog.csdn.net/zuoyou1314...
    今年27閱讀 1,511評(píng)論 3 3
  • iOS之PJSIP的編譯與簡(jiǎn)單使用 原創(chuàng)2017年02月22日 16:26:12 標(biāo)簽: ios/ pjsip/ ...
    kpyue閱讀 2,075評(píng)論 0 0
  • 明媚的除夕。 她佇立在街頭的花叢里,笑臉迎向了我,綻放的像一朵太陽(yáng)花。歲月在她眼角刻下了痕跡,在我眼里更像花瓣柔嫩...
    月亭閱讀 711評(píng)論 11 9
  • 不記得是在哪看到的文章,說女人一旦過了25歲,身體就會(huì)開始走向衰老,新老細(xì)胞的更替會(huì)進(jìn)入一個(gè)相反的趨勢(shì)。肌...
    憶凝閱讀 893評(píng)論 0 1

友情鏈接更多精彩內(nèi)容