I am trying to access database call_history.db in jailbroken iPhone. I am able to access call_history.db for iPhone 4 with iOS 4.1. But the problem is I am not able to access the database in iPhone 3gs with iOS 3.1.3.
When I try to open the database for 3gs I get the following database error:
unable to open database file
I use different paths for iOS 4.1 and iOS 3.1.3
iOS 4.1 in iPhone 4 - /private/var/wireless/Library/CallHistory/call_history.db
and iOS 3.1.3 in iPhone 3gs - /private/var/mobile/Library/CallHistory/call_history.db
Update
I fetch the call_history.db in the following way
//NSString *path=@"/private/var/wireless/Library/CallHistory/call_history.db";//for ios 4.0 and above call_history.db
NSString *path=@"/var/mobile/Library/CallHistory/call_history.db";//for ios 3.0 and above call_history.db
if(sqlite3_open([path UTF8String], &database) == SQLITE_OK)
{
//code for fetching the calls goes here.////
NSLog(@"call_history present");
}
else {
NSLog(@"Failed to open database with message '%s'.", sqlite3_errmsg(database));
sqlite3_close(database);
}
Here the output is the error:
unable to open Database file
I noticed that I am not able to access the Library folder in both iPhone's through the above code. I am able to retrieve all the file manually through ssh.