應(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):
- 執(zhí)行命令
./Configure iphoneos-cross no-shared -DOPENSSL_NO_ASYNC
- 修改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)
- 執(zhí)行make命令
模擬器(i386,x86_64):
- 執(zhí)行命令
./Configure iphoneos-cross no-shared -no-asm -DOPENSSL_NO_ASYNC
- 修改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)
- 執(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