I try to access sms db file in xcode but fail.
I know its path that is “/private/var/mobile/Library/SMS/sms.db”
When i try to access. the file read no permission error occur.
Is any way to access sms db file or change its permission in xcode. Thanks in advance.
The code which i try on iphone jailbroken is
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *path = @"/var/mobile/Library/SMS/sms.db";
NSError *error;
NSArray *content = [fileManager contentsOfDirectoryAtPath:path error:&error];
NSLog(@"%@", error);
NSLog(@"Content: %@", content);
if ([fileManager isReadableFileAtPath:path]) {
NSLog(@"");
NSLog(@"ReadAble");
}
else {
NSLog(@"Not readable");
}
if ([fileManager fileExistsAtPath:path])
NSLog(@"File Exist");
else
NSLog(@"No");
further when i try to call_history.db file . it is accessible. but sms.db not.
No, there is currently no way to do so on stock iOS. It is restricted by the framework itself, and thus not possible as it is.
On a jailbroken iPhone this is possible, but it will perhaps only work on the same jailbreak of the very same version.
EDIT:
One other solution, which won’t pass to AppStore, is to find some exploitable bug in the iOS (there must be a lot, check out how jailbreaks are done) to gain root access in your app. Then you would be able to access the data you want on a non-jailbroken iPhone. But it will probably only work on the version on which you developed it.