标签: iphone-security

如何保护核心数据iPhone应用程序中的sqlite数据库?

我有一个基于Core Data的iPhone应用程序,带有预先填充的只读数据库.我可以对我的数据库应用什么保护(如果有的话)以减少盗版/数据库从被囚禁的iPhone中读取的可能性?

大多数使用预先填充的sqlite数据库的代码示例都显示数据库正在从应用程序包中复制到iPhone上的应用程序文档目录中,这在一个已经破损的iPhone上完全可见.相反,我考虑直接从应用程序包中使用数据库,如下所示:

- (NSPersistentStoreCoordinator *)persistentStoreCoordinator {

    if (persistentStoreCoordinator != nil) {
        return persistentStoreCoordinator;
    }

    NSURL *storeUrl = [NSURL fileURLWithPath: 
        [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:
             @"MyDatabaseName.sqlite"]];

    <... followed by standard persistentStoreCoordinator code ...>
Run Code Online (Sandbox Code Playgroud)

当我在商店网址上放置一个断点时,这只会返回另一个文件位置,我猜这个位置就像在一个破损的iPhone中的文档目录一样可见:

<CFURL 0x139610 [0x38388ff4]>{type = 15, string = file://localhost/var/mobile/Applications/6ACD76F0-396D-4DB1-A46B-B2459A084063/MyiPhoneApp.app/MyDatabaseName.sqlite, base = (null)}
Run Code Online (Sandbox Code Playgroud)

有人可以确认以上是否正确和/或是否有其他方法来解决这个问题(我不打算加密或类似的东西......希望快速保护解决方案)?欣赏坚定的黑客会得到他们想要的东西 - 如果可以的话,我想至少提出一些阻力.

谢谢

sqlite iphone core-data iphone-security

6
推荐指数
1
解决办法
2190
查看次数

标签 统计

core-data ×1

iphone ×1

iphone-security ×1

sqlite ×1