コアデータを暗号化しようとしています。
別の質問で示唆されているように、ニック・ハリスの次の投稿を読みましたhttps://nickharris.wordpress.com/2010/07/14/core-data-and-enterprise-iphone-applications-protecting-your-data/ .
まず、デバイスで、設定でパスコードをオンにしました。
次に、私の appDelegate で、persistentStoreCoordinator を作成するときに、次の属性 NSFileProtectionComplete をコア データ ストア ファイルに追加します。これは、デバイスがパスコードでロックされている場合、コア データを暗号化するか、アクセスできないようにする必要があることを意味します。
NSDictionary *fileAttributes = [NSDictionary dictionaryWithObject:NSFileProtectionComplete forKey:NSFileProtectionKey];
if (![[NSFileManager defaultManager] setAttributes:fileAttributes ofItemAtPath:[storeURL path] error:&error]) {
NSLog(@"Cant encrypt");
}
ただし、これをすべて行った後、デバイスのパスコードがロックされていても、iExplorer を使用してアプリ サンドボックスと .sqllite ファイルを含むドキュメント フォルダーにアクセスでき、ファイル全体をデスクトップに移動して、すべて暗号化されていない状態で表示できます。
私は何かが欠けていますか??