添加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
相关推荐
2501_915918412 小时前
uni-app 项目 iOS 上架效率优化 从工具选择到流程改进的实战经验
android·ios·小程序·uni-app·cocoa·iphone·webview
00后程序员张2 小时前
如何在不同 iOS 设备上测试和上架 uni-app 应用 实战全流程解析
android·ios·小程序·https·uni-app·iphone·webview
wjm0410063 小时前
ios面试八股文
ios·面试
张较瘦_5 小时前
[论文阅读] 人工智能 + 软件工程 | 大模型破局跨平台测试!LLMRR让iOS/安卓/鸿蒙脚本无缝迁移
论文阅读·人工智能·ios
m0_6410310515 小时前
在选择iOS代签服务前,你必须了解的三大安全风险
ios
开开心心loky16 小时前
[iOS] push 和 present Controller 的区别
ui·ios·objective-c·cocoa
白玉cfc21 小时前
【iOS】push,pop和present,dismiss
macos·ios·cocoa
低调小一1 天前
iOS 开发入门指南-HelloWorld
ios
2501_915918411 天前
iOS 开发全流程实战 基于 uni-app 的 iOS 应用开发、打包、测试与上架流程详解
android·ios·小程序·https·uni-app·iphone·webview
用户870568130451 天前
iOS 异步渲染:从 CALayer 切入的实现与优化
ios