添加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
相关推荐
silianpan2 小时前
CAD 文档预览 UTS 插件
android·ios·harmonyos
世纪末の魔术师3 小时前
从 Healthory 到 Nature Aimanic:两款 iOS App 审核实战后,我总结了这份过审清单
ios·ios过审·苹果过审·ios应用过审
庚鑫3 小时前
macOS 27 上维护 Xcode 15.2 老项目:一次 AssetCatalogSimulatorAgent 构建故障排查
ios·apple
2501_915918414 小时前
使用 VS Code 写 Swift 做 iOS 开发,插件能实现哪些功能,还有哪些短板
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
黑科技iOS上架5 小时前
单Mac维护多套苹果开发者账号,App Store上架防关联实战方案
ios·审核·账号隔离·设备隔离
HouWan21 小时前
Swift 6.4 发布:iOS开发者值得关注的新特性
ios·swift·apple
用户38034165882971 天前
macOS 录屏:ScreenCaptureKit 与 iOS 的分野,共用引擎的抽象层该切在哪
ios·音视频开发
HouWan1 天前
Flutter iOS UISceneDelegate 迁移指南:理清新的 Scene 生命周期
flutter·ios·app
00后程序员张1 天前
Xcode vs KXApp,体积差几十G,选轻量方案还是完整工具链?
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程