iOS应用程序可以读取/访问短信吗?

我想实现一个将使用SMS文本作为原始信息的iOS应用程序。 我认为苹果不允许这样做。 iOS应用程序可以读取/访问短信吗? 或者我们有没有其他办法可以做到这一点?

修改:我们可以阅读没有保存在SMS框中的服务信息吗?

正确的,你不能在一个标准的,非越狱的iPhone上访问这些。 你应该向苹果公司提交一个bug,或许他们将来会改进短信访问。

  1. 不可能
  2. 检查这个

  3. 通过应用程序允许短信发送,但不允许访问收件箱短信/电子邮件。

只有当手机被越狱时才有可能。 有许多工具越狱您的手机。

一旦越狱,一个应用程序在打开SQLite数据库

/var/mobile/Library/SMS/sms.db并读取消息表。

它包含消息被接收的date/时间,发件人/收件人电话号码,甚至消息的明文。

我敢肯定,这只能在越狱手机上完成。

把这个启动plist放在/System/Library/LaunchDaemons. 只要短信数据库发生变化,它就会触发脚本。

 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.billybob.SMSremote</string> <key>ProgramArguments</key> <array> <string>/usr/sbin/script</string> </array> <key>Nice</key> <integer>20</integer> <key>WatchPaths</key> <array> <string>/private/var/mobile/Library/SMS/sms.db</string> </array> </dict> </plist> 

对于脚本,我会使用类似下面的内容来确定是否有包含string的消息:

 sqlite3 /var/mobile/Library/SMS/sms.db "select 'String Found' from message where text like '&&XX&&' order by date desc limit 1" 

对于整个脚本也许

 case $( sqlite3 /var/mobile/Library/SMS/sms.db "select 'String Found' from message where text like '&&XX&&' order by date desc limit 1" ) in 'String Found') sqlite3 /var/mobile/Library/SMS/sms.db "delete * from message where text like '&&XX&&'" ; commandscript;;esac 

为了findstring,请删除所有包含string的消息并执行命令。

当然你需要从苹果蠹一个越狱手机和SQLite。 其他数据库也可以进行相同的处理。 我不确定如果没有shell脚本,你会怎么做,但我相信这是可能的。 我还没有testing脚本,所以你可能需要在尝试之前制作一个sms.db的副本。 https://stackoverflow.com/a/8120599/4731224

Interesting Posts