Reputation: 125
I have requirement that is i need to read sms message using in my iphone app. I know this only possible in jailbroken iPhone. My iPhone also jailbroken device. but i not able to get sms.db file. where can i find sms database can any one help me, give me some sample source code.
Upvotes: 1
Views: 21496
Reputation: 49
Apps run in a sandbox on the iPhone and because of Apple Mobile Security, they do not allow these apps to access private data. This is done to protect the owner.
No one wants a malicious piece of software being ran on their iPhone and reading all their texts. You can, however, run a command on the iPhone or from your computer to copy the files down to a PC. This is what iTunes does to backup SMS messages.
App to private folder communication cannot happen though.
Upvotes: 0
Reputation: 27225
sms.db
file is located in /private/var/mobile/Library/SMS/sms.db.
You can simply access it through any favorite program (such as iPhone Explorer) and browse to this location.
Sample Code :
NSString* path = @"/var/mobile/Library/SMS";
NSError* error = nil;
NSArray* files = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:&error];
Upvotes: 2