美文网首页
iOS 编译Gmssl(no-async)

iOS 编译Gmssl(no-async)

作者: 863cda997e42 | 来源:发表于2019-06-03 15:16 被阅读0次

应用上架被拒:

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.

使用了私有方法,发现是编译GMSSL时,内部调用了这些方法,编译时设置no-async就可以解决上述问题了。
首先下载GmSSL,准备编译armv7 armv7s i386 x86_64 arm64 等架构的静态库。每个架构对应一个文件夹,将GmSSL代码拷贝5份。

真机(arm64,armv7,armv7s):

  1. 执行命令
./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. 执行make命令

模拟器(i386,x86_64):

  1. 执行命令
./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. 执行make命令

合并静态库

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

相关文章

  • iOS 编译Gmssl(no-async)

    应用上架被拒: The app references non-public symbols : _getconte...

  • iOS 使用Gmssl实现SM2证书签名验签

    如果没有编译gmssl,可以看下: iOS 编译Gmssl 编译好iOS可以用的Gmssl静态库之后,需要在Gms...

  • iOS 编译Gmssl

    最近搞了下sm2,防止自己忘记,记录下: 官方地址:Gmssl官网 官方编译文档中,介绍了怎么编译arm64的静态...

  • gmssl iOS编译

    1、git下载gmssl源代码 git clone https://github.com/guanzhi/GmSS...

  • GMSSL 编译

    一、下载好GMSSL源码,终端 cd到目录下,分别编译各个版本的包./Configure ios64-cross(...

  • IOS编译和安装GmSSL

    最近公司项目需要用到sm2的加签功能,IOS方面的实现找了很久也没找到,最后用了GmSSL来实现,GMSSL里面有...

  • Gmssl编译ios静态库

    1.github下载最新版本Gmssl 2.在MacOS系统下CD进入下载的Gmssl文件夹(一般下载为zip文件...

  • GmSSL编译

    MAC 使用在guanzhi[https://github.com/guanzhi]/GmSSL[https://...

  • iOS平台GmSSL静态库编译

    GmSSL是一个开源的密码工具箱,是OpenSSL项目的分支,并与OpenSSL能够保持接口兼容。因近期项目中需要...

  • gmssl java api 编译

    GmSSL是一个开源的密码工具箱,支持SM2/SM3/SM4/SM9等国密(国家商用密码)算法、SM2国...

网友评论

      本文标题:iOS 编译Gmssl(no-async)

      本文链接:https://www.haomeiwen.com/subject/yypcxctx.html