where can i find sms.db file in my iphone using iPhone app

醉酒当歌 提交于 2019-12-13 07:16:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!