Jan 052012

Last year I released a script written in PHP which was able to extract text messages from the iPhone (more specifically: from the SQLite storage container) into a simple TXT file, which was documented in this blog post. The software required a PHP interpreter, which had to be cared for by the user (check the blog post for details), but was published under CC BY 3.0 so the user could make any alteration he desired or deemed necessary.
Some time later I wrote an online version of the extractor (release blog post), which offered extended functionality and above all no longer needed the user to run the interpreter him- or herself.
However, due to the lack of time I couldn’t keep the standalone version up to date with the online version and so they diverged.

As of now I am publishing the updated code of the standalone version, which has partially been re-written in two ways: for one it now comprises of the same functionality as the online version, and for another the coding structure has been reorganized so I can keep the two versions in unison easier. This means that any update or change made to the software will be applied to both versions: the online version will make use of the update whereas the standalone version will be published open source under the same license with the updated code.

You can download the updated code here.

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.

Let me quickly list the options which the new standalone version offers (i.e. the differences to the original publication), which are about user customizations:

    defines whether the type of the output should be in text (TXT) or comma-separated values (CSV). Please note that the file extension you define for $OUTFILE as part of the filename is not taken into consideration; so e.g. if you want to output a CSV file, setting the outfile name to “outfile.csv” is not enough, you need to specifically set $OUTFILE_TYPE to CSV.
  • $NEWLINE = “\n”
    defines the format of the system dependent newline. Use \r\n on Windows and \n on Unix/Linux and Mac.
  • default file opening mode is now “overwrite” ( $f_handle = fopen( $OUTFILE, “w” ); ). If you would like to append extracted text message to the output file rather than overwrite the file use “a” instead of “w“. Note that the line now moved towards the end of the file.
  • Change format of output of single text messages
    In case of TXT you need to change $OUTSTRING .= “$time$senderror$NEWLINE$address$NEWLINE$text$NEWLINE$NEWLINE$NEWLINE”; to your liking and in case of CSV change $OUTSTRING .= “$address,$time,\”” . str_replace( “\””, “\”\””, $text) . “\”$NEWLINE”;.
    Make sure you only change the format string and leave the .= intact ;).

If you are a new user to this and don’t know what to do about the user specific CONFIGURATION section or how to run the script, please refer to the original blog post, which explains in detail how the standalone version works.

As always you can contact me with any remarks you would like to bring to my attention.

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">