问题
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.
回答1:
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];
回答2:
It's located in /var/mobile/Library/SMS/sms.db.
回答3:
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.
来源:https://stackoverflow.com/questions/16958473/where-can-i-find-sms-db-file-in-my-iphone-using-iphone-app