当前位置:网站首页>使用sqlcipher打开加密的sqlite方法
使用sqlcipher打开加密的sqlite方法
2022-07-02 06:50:00 【微澜-】
说明:
SQLite 一个非常流行的嵌入式数据库,它支持 SQL 语言,并且只利用很少的内存就有很好的性能。此外它还是开源的,任何人都可以使用它。许多开源项目((Mozilla, PHP, Python)都使用了 SQLite.
Android 在运行时集成了 SQLite,所以每个 Android 应用程序都可以使用 SQLite 数据库。对数熟悉 SQL 的开发人员来时,使用 SQLite 相当简单。对于小型应用来说,使用这样的单机版文件数据库更加小巧实用。
加密问题
原生的sqLite并不支持密码加密,目前常用的数据库加密方式大部分是字段加密,或者是内容加密。这里特别推荐使用sqlcipher的数据库加密方案,使用与原生一致,(sqlcipher-android的Github地址请戳)
加密的时候使用windows版本sqlcipher-windows工具处理,设置密码和算法。
Sqlcipher加密sqlite数据库之后,使用android版Sqlcipher访问数据库和原生的sqlite几乎一摸一样,只需要在打开数据库的时候设置密码,算法就可以打开
打开加密sqlite例子
import net.sqlcipher.database.SQLiteDatabase;

打开数据库之后,后面的操作和原生操作一摸一样。
我之前把txt数据包装为apk用的就是sqlite数据库,把章节目录位置写入sqlite,可以快速定位。
书籍列表 | android 书籍apk下载 | ||
序号 | 名称 | 下载 | 备注 |
1 | 红楼梦 | ||
2 | 三国演义 | ||
3 | 西游记 | ||
4 | 水浒传 | ||
5 | 饥饿的盛世 | 讲述乾隆王朝的得失 | |
6 | 阿凡提故事 | 阿凡提及部分民族故事 | |
7 | 格言卡片 | 格言上百篇 | |
8 | 笑话大全 | 众多日常笑话 | |
9 | 小小说 | 数十篇著名小小说 | |
10 | 元史演义 | 每个朝代都是历史的选择 | |
11 | 爱情语录 | 关于爱情的小文章 | |
12 | 济公全传 | 那些年那些事那些心愿 | |
13 | 明朝那些事儿 | 一个让人遗憾的王朝,最能看清人性的时代 | |
14 | 凡人修仙传-人界篇 | 一个人的玄界奋斗史,修仙小说的经典 | |
15 | 凡人修仙传-灵界篇 | ||
16 | 凡人修仙传-仙界篇 | ||
参考:
git clone https://github.com/sqlcipher/sqlcipher.git关于:
qq:9611153 微信lgs9611153
边栏推荐
- 【虚幻4】UMG组件的简介与使用(更新中...)
- allure--常用配置项
- 【Unity3D】无法正确获取RectTransform的属性值导致计算出错
- 【Lua】常见知识点汇总(包含常见面试考点)
- 2021-10-02
- Sum the two numbers to find the target value
- [tutorial] how to make the Helpviewer help document of VisualStudio run independently
- Webui automated learning
- MYSQL关键字
- Remember the use of add method once
猜你喜欢

Commutateur Multi - lentilles Blender

Leetcode -- the nearest common ancestor of 236 binary tree

shell编程01_Shell基础

2021-10-02

Rapid prototyping

Blender海洋制作

判断数组中是否存在重复元素
![[visual studio] every time you open a script of unity3d, a new vs2017 will be automatically reopened](/img/c3/aec0a9fb79cf94b3575d95530aa8e8.png)
[visual studio] every time you open a script of unity3d, a new vs2017 will be automatically reopened

Shutter - canvas custom graph

flink 提交程序
随机推荐
Merge ordered sequence
07数据导入Sqoop
Blender多鏡頭(多機比特)切換
pytest框架实现前后置
Flink submitter
Following nym, the new project Galaxy token announced by coinlist is gal
flume 190 INSTALL
Windows环境MySQL8忘记密码文件解决方案
AttributeError: type object ‘Image‘ has no attribute ‘fromarray‘
Mock Server基本使用方法
ERROR 1118 (42000): Row size too large (> 8126)
[Lua] summary of common knowledge points (including common interview sites)
Excuse me, is it cost-effective to insure love life patron saint 2.0 increased lifelong life insurance? What are the advantages of this product?
Applet development summary
pytest--之测试报告allure配置
js setTimeout()与面试题
[Fantasy 4] introduction and use of UMG components (under update...)
Transport Optimization abstraction
Message mechanism -- getting to know messages and message queues for the first time
虚幻材质编辑器基础——如何连接一个最基本的材质