添加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
相关推荐
北京自在科技1 小时前
苹果折叠屏iPhone突破折痕难题 或将在2026年发布
ios·iphone·findmy·折叠屏·库克
一粒沙-1 小时前
iOS 将GIF图分享至微信
前端·ios
Mamong11 小时前
Metal 学习笔记三:渲染管线
ios·swift·metal
yidahis15 小时前
用DeepSeek学源码-SDImageCodersManager 中的工厂模式解析
ios·源码
xinyu39118 小时前
iOS Framework代码中加载图片资源
macos·ios·cocoa
键盘敲没电18 小时前
【iOS】小蓝书学习(四)
学习·ios·cocoa
键盘敲没电1 天前
【iOS】小蓝书学习(二)
学习·ios·cocoa
黄毛火烧雪下2 天前
将 iOS 项目打包并运行到真实的 iPhone 设备
ios·iphone
后端常规开发人员2 天前
iOS手机App爬虫- (1) Mac安装Appium真机运行环境
爬虫·ios·appium
DeMonnnnnn2 天前
Flutter-升级Xcode后构建iOS报错
flutter·ios·xcode