li6185377 / LKDBHelper-SQLite-ORM

全自动的插入,查询,更新,删除, an automatic database operation thread-safe and not afraid of recursive deadlock
MIT License
1.21k stars 288 forks source link

如何访问现有已经加过密的数据库 #169

Open dslcoding opened 1 month ago

dslcoding commented 1 month ago

我已经将加过密的数据库拖至项目中,我用 setKey 方法进行访问,项目报错:file is not a database in "SELECT FROM `+------(LKDBHelper )getUsingLKDBHelper{ static LKDBHelper* db; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ db = [[LKDBHelper alloc]initWithDBPath:[zi_Table downloadPath]]; NSLog(@"==DDDD+==%@",[zi_Table downloadPath]); [db setKey:@"44444444"]; //[db setket] ; }); return db; }`

li6185377 commented 1 month ago
  1. 你先看下数据库路径 对不对, 比如先用个没加密的数据库
  2. 要导入 pod 'FMDB/SQLCipher'
  3. 你加密的数据库是否标准的 SQLCipher