添加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
相关推荐
报错小能手4 小时前
ios开发方向——Swift语言学习 为啥要学Swift?
学习·ios·swift
哈__4 小时前
ReactNative项目OpenHarmony三方库集成实战:react-native-push-notification-ios
react native·react.js·ios
2501_915909065 小时前
iOS 抓包不越狱,代理抓包 和 数据线直连抓包两种实现方式
android·ios·小程序·https·uni-app·iphone·webview
Dante丶5 小时前
Xcode 26.4 AFNetworking 私有头文件报错处理记录
ios
用户223586218206 小时前
Xcode MCP Server 完全指南:从智能配置到编程控制
ios
游戏开发爱好者87 小时前
入门 iOS 开发 新手工具开发首个应用
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
张飞签名上架17 小时前
苹果签名机制全解析:守护生态安全的数字钥匙
ios·苹果签名·超级签·企业签名
Digitally1 天前
iPhone 卡在恢复模式:如何修复(分步指南)
ios·iphone
vx-bot5556661 天前
企业微信ipad协议的协议状态机与生命周期管理
ios·企业微信·ipad