views:

9238

answers:

8

I am building application that required some data from iPhone's Call log(read only). The call log is a sqlite db located at "*/User/Library/CallHistory/call_history.db*". I used a jailbroken device to extract the log. However trying to open this location using the *sqlite_open3()* command I get a *SQLITE_ERROR* error, which according to the library documentation means "SQL error or missing database". In an attempt to debug the error I've used NSFileManager to enumerate the folder('/User/Library/'). It would appear as if it's returning a "filtered" set of results, that exclude the 'CallHistory' folder along with several of the other folders.

The File system uses a series of alias to give the illusion of tradition OS X file structure, and I don't know if these are having an effect on my results.

The call log is only present on a device, and not the simulator. I've been unable to get it to work on a 1st gen iPhone running fireware 2.1.

This is some code I used to test the output

NSDirectoryEnumerator *dirnum = [[NSFileManager defaultManager] enumeratorAtPath: @"/private/var/mobile/Library/"];

while( bar = [dirnum nextObject])
{
 //Uncomment if you don't want to log sub folders
 //[dirnum skipDescendents];

 NSLog(bar);
}

I have a suspicion that Apple is blocking access to the directory as part of its sandboxing strategy, however I have no proof at this stage. However, I can access the address book without any issues, so I'm a little confused.

Thanks

A: 

Honestly, how can you imagine they would let you access the whole Call log? How about you transmit it over the Internet once you have fetched it and make good use of this information?

Vincent
Yeah, it's not the safest thing i agree, but i'm lead to believe that you can access the address book, so it's not as if it is that beyond believe.
Jonathan
That's (one of the many reasons) why they're so restrictive about the appstore. You could in theory write an app which sends your addressbook or call list out to the net, but they'd (hopefully) prevent that app from getting into the store
Orion Edwards
Don't be silly. There are lots of programs on your computer which would be perfectly capable of sending contact info, emails and other stuff to god knows where without you knowing about it. And now it's on a phone it's suddenly a problem?
Rolf
I don't think Apple are filtering applications that much. There is no way to trace back you fetching some Contact info, storing it somewhere in memory, compressing the data, and boom, in another function sending it oversea.
Vincent
@Rolf: Because applications are free, and people are thinking it's so much a sand box that nothing can happen to their phone even if the application doesn't look very legit.
Vincent
+2  A: 

Keep in mind I have not tried any of this.

Your logic appears to be that if you can access the Address Book db, why not the call log db? Well, the Address Book is exposed via published APIs - the call log is not. Consequently, I don't think it's so strange that you can't access its db file either.

Mike McMaster
+7  A: 

There is no access to the call log from Cocoa Touch or other iPhone APIs.

Chris Hanson
unless you jailbreak.
Isaac Waller
+1  A: 

Applications are not meant to access anything out of their sandbox. The Address Book database is accessible because it's accessed by the public frameworks. Before firmware 2.1, applications did have read-only access out of their sandbox.

Zydeco
+1  A: 

You cannot access the call log using the SDK and approved APIs. This is by design.

August
A: 

Yes we are unable to access the call log via iPhone SDK.. but how does phoneView access call log via desktop application? http://ecamm.com/mac/phoneview/

any ideas?

Guessing it mounts the iphone as a usb storage device, and then just reads the sqlite database that is the addressbook
Jonathan
A: 

to Obaid:

I too was wondering about phoneview. If they can do it then why deny access to the call log. Does phoneview requires a jailbroken iphone?

Shuka Margolin
A: 

with the config utility and skd you can monitor when calls are placed, but cannot see to whom, ive been trying to get past the same issue, making progress but apple definetly made it so its private info, atleast who your calling,

leet