问题
I am developing an application for a jailbroken iPhone 5s (iOS 7.1.1) to fetch call logs and messages stored in the respective .db files.I have certain queries:
I have a valid certificate, provisioning profile and my app is signed using this profile, so is it necessary to remove this profile and sign the app with ldid (if so why and what are the steps?)
Does my app needs to have root permission to access the databases (/var/wireless/Library/CallHistory/call_history.db) and (/var/mobile/Library/SMS/sms.db), if so how to grant root permission to my app. I have tried the solution: Gaining root permissions on IOS for NSFilemanager jailbreak but my app installed using this method just shows a blank screen on click and then fades away (I have signed my app using a valid developer certificate and provisioning profile)
Any code related to fetching call_logs and sms would be helpful,i tried some of the codes suggested but none of them worked,may be due to above issues.
回答1:
Problem with accessing these is not root permissions but sandbox rules. As long as you're out of the sandbox you can read them. Don't know why your root application couldn't read it but it should. There is no other restrictions apart from the sandbox. Root permissions are needed to write to those databases but everybody can read them. I even rememeber reading them from inside of regular AppStore app on jailbroken phone. Jailbreak breaks some of the sandbox rules so you can read I think anywhere in the file system. That's how some jailbreak detectors work, for example.
回答2:
It's impossible to access the user's SMS messages on both the simulator and on the real device (unless it's jailbroken). Unlike on Android, Apple's privacy constraints don't allow developers the right to access the users' personal data such as text messages, phone calls, etc. You can see various examples for this. For example, try Whatsapp registration process on both iPhone and Android. On both, you'll receive a text message with the code, but while on the Android the code will be magically inputted and verified by the app, on the iPhone you'll see the received text message and be asked to manually type the code.
来源:https://stackoverflow.com/questions/25262064/read-sms-db-and-call-history-db-file-on-ios