You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've successfully encrypt and decrypted a sqlciphered db through using encrypted-core-data. All seemed fine until I deployed to an iPhone device. The issue appears to be in the method:
of EncryptedStore.m when the NSPersistentStore is created. The NSAssert reports the corresponding error. Here's a summary of my trial and errors by modifying the NSURL variable databaseURL in the method:
Test A:
databaseURL = [applicationSupportURL URLByAppendingPathComponent:[@"Preload" stringByAppendingString:@".sqlite"]];
Test A Result:
Error Domain=NSSQLiteErrorDomain Code=14 "The operation couldn’t be completed. (NSSQLiteErrorDomain error 14.)" UserInfo=0xc46e5e0 {EncryptedStoreErrorMessage=unable to open database file}
Test B:
databaseURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"Preload" ofType:@"sqlite"]];
Test B Result:
Success --> Loads the data as intended in the simulator
On Device (iPhone)
Repeat Test A:
Error Domain=NSSQLiteErrorDomain Code=14 "The operation couldn’t be completed. (NSSQLiteErrorDomain error 14.)" UserInfo=0x15d5fd40 {EncryptedStoreErrorMessage=unable to open database file}'
Repeat Test B:
Error Domain=NSSQLiteErrorDomain Code=8 "The operation couldn’t be completed. (NSSQLiteErrorDomain error 8.)" UserInfo=0x14e4e180 {EncryptedStoreErrorMessage=attempt to write a readonly database}'
The main difference is the path in which the sqlite resides:
For Test A:
file:///Users/hkbc02/Library/Application%20Support/iPhone%20Simulator/7.0.3-64/Applications/D0864B56-840A-455F-9B52-EB75FE258FD1/Library/Application%20Support/Preload.sqlite
For Test B:
file:///Users/hkbc02/Library/Application%20Support/iPhone%20Simulator/7.0.3-64/Applications/D0864B56-840A-455F-9B52-EB75FE258FD1/MyAppName.app/Preload.sqlite
Any ideas what I might have done wrong?
The text was updated successfully, but these errors were encountered:
Interesting, I'm guessing this has to do with iOS 7. Going to try adding your change, make sure it has backwards compatibility with everything, and then make it the default if it does. Adding a new ticket for this.
I've successfully encrypt and decrypted a sqlciphered db through using encrypted-core-data. All seemed fine until I deployed to an iPhone device. The issue appears to be in the method:
makeStoreWithDatabaseURL:(NSURL )databaseURL managedObjectModel:(NSManagedObjectModel *)objModel :(NSString)passcode
of EncryptedStore.m when the NSPersistentStore is created. The NSAssert reports the corresponding error. Here's a summary of my trial and errors by modifying the NSURL variable databaseURL in the method:
makeStore:(NSManagedObjectModel *)objModel :(NSString *)passcode
On Simulator
On Device (iPhone)
The main difference is the path in which the sqlite resides:
For Test A:
file:///Users/hkbc02/Library/Application%20Support/iPhone%20Simulator/7.0.3-64/Applications/D0864B56-840A-455F-9B52-EB75FE258FD1/Library/Application%20Support/Preload.sqlite
For Test B:
file:///Users/hkbc02/Library/Application%20Support/iPhone%20Simulator/7.0.3-64/Applications/D0864B56-840A-455F-9B52-EB75FE258FD1/MyAppName.app/Preload.sqlite
Any ideas what I might have done wrong?
The text was updated successfully, but these errors were encountered: