- 0x01. 编译成静态库
$ ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" \ LDFLAGS="/opt/local/lib/libcrypto.a"
错误:
clang: error: no such file or directory: '/opt/local/lib/libcrypto.a' ... configure:2922: error: in `/Users/panjing/github/sqlcipher': configure:2924: error: C compiler cannot create executables See `config.log' for more details
- 0x02. 编译成动态库
第一步顺利通过
$ ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" \ LDFLAGS="-lcrypto"
第二步出错:
$ make
错误信息:
sqlite3.c:18280:10: fatal error: 'openssl/rand.h' file not found
重新安装openssl
根据提示执行:
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.zshrc
- 0x03. 重新静态编译
修正libcrypto.a的路径,重新编译:
error:
sqlite3.c:21628:10: fatal error: 'openssl/rand.h' file not found #include <openssl/rand.h> ^~~~~~~~~~~~~~~~ 1 error generated. make: *** [sqlite3.lo] Error 1
文件存在,但是路径不对。
解决办法:
破解微信数据库:
参考
文章来源: mac book air 编译sqlcipher