添加SQLCipher 到项目中

文章目录

SQLCipher官方地址

一、克隆下载SQLCipher

复制代码
$ cd ~/Documents/code
$ git clone https://github.com/sqlcipher/sqlcipher.git

二、手动导入

1. 生成sqlite3.c

打开下载的SQLCipher,运行脚本命令

复制代码
$ cd sqlcipher
$ ./configure --with-crypto-lib=none
$ make sqlite3.c

sqlite3.csqlite3.h 导入到项目中

2. 在项目中添加命令

  1. 在build setting 中 "Other C Flags." 下添加如下命令:
    -DSQLITE_HAS_CODEC -DSQLITE_TEMP_STORE=3 -DSQLCIPHER_CRYPTO_CC -DNDEBUG.
  1. 如果是swift项目添加"Preprocessor Macros"的 Release settings 下添加 SQLITE_HAS_CODEC=1

3. 添加 Security.framework

在Link Binary With Libraries添加 Security.framework

三、CocoaPods导入

Podfile 文件添加下列内容

复制代码
platform :ios, '10.0'

target 'SQLCipherApp' do
  # Uncomment this line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  pod 'SQLCipher', '~>4.0'
end
相关推荐
我要用代码向我喜欢的女孩表白6 小时前
对象存储路径文件1TB以上文件比对,go语言
ios·golang·xcode
2501_916007476 小时前
iPhone APP 性能测试怎么做,除了Instruments还有什么工具?
android·ios·小程序·https·uni-app·iphone·webview
2501_915106326 小时前
Windows 环境下有哪些可用的 iOS 上架工具, iOS 上架工具的使用方式
android·ios·小程序·https·uni-app·iphone·webview
Student_Zhang8 小时前
一个管理项目中所有弹窗的弹窗管理器(PopupManager)
前端·ios·github
denggun123458 小时前
使用 os_unfair_lock 替代 DispatchQueue?!
ios
2501_9151063211 小时前
iOS 抓包工具有哪些?不同类型的抓包工具可以做什么
android·ios·小程序·https·uni-app·iphone·webview
一点晖光14 小时前
ios底部按钮被挡住
前端·ios·微信小程序
chinesegf1 天前
iTunes Lookup API 规则具体(查包名)
ios
C+++Python1 天前
iOS 长截图
ios
货拉拉技术1 天前
iOS疑难Crash-_dispatch_barrier_waiter_redirect_or_wake 崩溃治理
ios