diff options
author | Zach C | 2008-07-29 01:13:51 -0700 |
---|---|---|
committer | Matt Colyer | 2008-07-29 01:13:51 -0700 |
commit | 0f4aeb11abce2f36d840b19d028e5aa34ccf5aba (patch) | |
tree | 978d11b1f46fb323db044fa76e2020c09aab89d4 /main.c | |
parent | e2ff1128351d75eafd5426af7f96f9719c1af3e6 (diff) | |
download | libplist-0f4aeb11abce2f36d840b19d028e5aa34ccf5aba.tar.gz libplist-0f4aeb11abce2f36d840b19d028e5aa34ccf5aba.tar.bz2 |
Version 0.09, added ability to talk to 2.0 firmware.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 25 |
1 files changed, 23 insertions, 2 deletions
@@ -36,12 +36,13 @@ int main(int argc, char *argv[]) { } printf("Now starting SSL.\n"); - if (!lockdownd_start_SSL_session(control, "29942970-207913891623273984")) { +// if (!lockdownd_start_SSL_session(control, "29942970-207913891623273984")) { + if (!lockdownd_start_SSL_session(control, "2994593482385678618538736")) { printf("Error happened in GnuTLS...\n"); } else { printf("... we're in SSL with the phone... !?\n"); + port = lockdownd_start_service(control, "com.apple.afc"); } - port = lockdownd_start_service(control, "com.apple.afc"); if (port) { printf("Start Service successful -- connect on port %i\n", port); AFClient *afc = afc_connect(phone, 3432, port); @@ -69,6 +70,26 @@ int main(int argc, char *argv[]) { free(my_file); free(file_data); } else printf("couldn't open a file\n"); + + my_file = afc_open_file(afc, "/readme.libiphone.fx", AFC_FILE_WRITE); + if (my_file) { + char *outdatafile = strdup("this is a bitchin text file\n"); + bytes = afc_write_file(afc, my_file, outdatafile, strlen(outdatafile)); + free(outdatafile); + if (bytes > 0) printf("Wrote a surprise. ;)\n"); + else printf("I wanted to write a surprise, but... :(\n"); + afc_close_file(afc, my_file); + free(my_file); + } + printf("Deleting a file...\n"); + bytes = afc_delete_file(afc, "/delme"); + if (bytes) printf("Success.\n"); + else printf("Failure.\n"); + + printf("Renaming a file...\n"); + bytes = afc_rename_file(afc, "/renme", "/renme2"); + if (bytes > 0) printf("Success.\n"); + else printf("Failure.\n"); } afc_disconnect(afc); } else { |