简体   繁体   中英

exporting sqlite file - convert it to proprietary format

I have an sqlite file inside my iPhone app. I want the users to be able to export and import the file again, directly from the app to their desktop, for backup purposes. But I don't want them to directly access the sqlite file or the data from anywhere other than the iPhone. How do I convert the file to a proprietary format that is unreadable? Is there any facility within objective-c that will let me achieve this?

Thanks.

You probably shouldn't actually attempt to port the data between a sqlite database and some proprietary format. I can't see a good reason for actually modifying the sqlite database directly unless you already have some format in mind that you can easily store the data in. Other than that, you're not going to find some generic data storage format that you can simply move your data from the sqlite database into – that's what the database is meant to be in the first place (generic data storage, that is)!

It already seems unlikely that typical users would have the incentive or the know-how to actually read or modify a sqlite database. You could try to obfuscate the fact that it is a sqlite database by changing the extension to something arbitrary. Steps beyond that (compressing the file, encrypting the file in some way) would all depend on how much you actually care about the user not being able to access the data outside your application. However, your worries seem fundamentally unfounded (in my opinion), and I don't think you should worry too much about users trying to dig into and modify a sqlite database unless you have some specific unstated reason for believing this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM