使用iPhone SDK访问iPhone的通话记录

时间:2022-10-09 10:42:21

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.

我正在构建需要来自iPhone的Call log(只读)的一些数据的应用程序。呼叫日志是位于“/User/Library/CallHistory/call_history.db”的sqlite数据库。我使用越狱设备来提取日志。但是,尝试使用sqlite_open3()命令打开此位置时,出现SQLITE_ERROR错误,根据库文档,这意味着“SQL错误或缺少数据库”。在尝试调试错误时,我使用NSFileManager来枚举文件夹('/ User / Library /')。看起来好像它正在返回一组“已过滤”的结果,它会将“CallHistory”文件夹与其他几个文件夹一起排除。

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.

File系统使用一系列别名来给出传统OS X文件结构的错觉,我不知道这些是否对我的结果有影响。

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.

通话记录仅出现在设备上,而不是模拟器上。我一直无法让它在运行fireware 2.1的第一代iPhone上运行。

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.

我怀疑Apple阻止访问该目录作为其沙盒策略的一部分,但我现阶段没有证据。但是,我可以毫无问题地访问地址簿,所以我有点困惑。

Thanks

8 个解决方案

#1


15  

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

无法从Cocoa Touch或其他iPhone API访问呼叫日志。

#2


3  

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.

您的逻辑似乎是,如果您可以访问通讯簿数据库,为什么不调用日志数据库?好吧,地址簿是通过已发布的API公开的 - 呼叫日志不是。因此,我认为你不能访问它的db文件也不是很奇怪。

#3


3  

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

您无法使用SDK和已批准的API访问通话记录。这是设计的。

#4


3  

Yes, it is possible. This tutorial works: http://iosstuff.wordpress.com/2011/08/19/accessing-iphone-call-history/

对的,这是可能的。本教程有效:http://iosstuff.wordpress.com/2011/08/19/accessing-iphone-call-history/

#5


2  

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.

应用程序无意访问其沙箱中的任何内容。可以访问通讯簿数据库,因为它可以由公共框架访问。在固件2.1之前,应用程序确实具有其沙箱中的只读访问权限。

#6


2  

I would bet that PhoneView extracts the data from the iphone backup folder on the Mac.. the sqlite databases are stored there with predictable names.

我敢打赌,PhoneView从Mac上的iphone备份文件夹中提取数据.sqlite数据库以可预测的名称存储在那里。

#7


0  

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,

使用配置实用程序和skd,您可以监控何时拨打电话,但无法看到谁,我一直试图通过相同的问题,取得进展,但苹果绝对让它成为私人信息,至少是您的呼叫,

#8


-1  

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?

老实说,你怎么能想象他们会让你访问整个通话记录?一旦你拿到它并充分利用这些信息,你如何通过互联网传输它?

#1


15  

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

无法从Cocoa Touch或其他iPhone API访问呼叫日志。

#2


3  

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.

您的逻辑似乎是,如果您可以访问通讯簿数据库,为什么不调用日志数据库?好吧,地址簿是通过已发布的API公开的 - 呼叫日志不是。因此,我认为你不能访问它的db文件也不是很奇怪。

#3


3  

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

您无法使用SDK和已批准的API访问通话记录。这是设计的。

#4


3  

Yes, it is possible. This tutorial works: http://iosstuff.wordpress.com/2011/08/19/accessing-iphone-call-history/

对的,这是可能的。本教程有效:http://iosstuff.wordpress.com/2011/08/19/accessing-iphone-call-history/

#5


2  

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.

应用程序无意访问其沙箱中的任何内容。可以访问通讯簿数据库,因为它可以由公共框架访问。在固件2.1之前,应用程序确实具有其沙箱中的只读访问权限。

#6


2  

I would bet that PhoneView extracts the data from the iphone backup folder on the Mac.. the sqlite databases are stored there with predictable names.

我敢打赌,PhoneView从Mac上的iphone备份文件夹中提取数据.sqlite数据库以可预测的名称存储在那里。

#7


0  

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,

使用配置实用程序和skd,您可以监控何时拨打电话,但无法看到谁,我一直试图通过相同的问题,取得进展,但苹果绝对让它成为私人信息,至少是您的呼叫,

#8


-1  

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?

老实说,你怎么能想象他们会让你访问整个通话记录?一旦你拿到它并充分利用这些信息,你如何通过互联网传输它?