diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/Makefile.am | 34 | ||||
-rw-r--r-- | tools/idevice_id.c (renamed from tools/iphone_id.c) | 20 | ||||
-rw-r--r-- | tools/idevicebackup.c (renamed from tools/iphonebackup.c) | 36 | ||||
-rw-r--r-- | tools/ideviceinfo.c (renamed from tools/iphoneinfo.c) | 28 | ||||
-rw-r--r-- | tools/idevicesyslog.c (renamed from tools/iphonesyslog.c) | 36 |
5 files changed, 77 insertions, 77 deletions
diff --git a/tools/Makefile.am b/tools/Makefile.am index d19ef0c..9b6a6e8 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -3,25 +3,25 @@ INCLUDES = -I$(top_srcdir)/include AM_CFLAGS = $(GLOBAL_CFLAGS) $(libglib2_CFLAGS) $(libgnutls_CFLAGS) $(libtasn1_CFLAGS) $(libgthread2_CFLAGS) $(LFS_CFLAGS) AM_LDFLAGS = $(libglib2_LIBS) $(libgnutls_LIBS) $(libtasn1_LIBS) $(libgthread2_LIBS) -bin_PROGRAMS = iphone_id iphoneinfo iphonesyslog iphonebackup +bin_PROGRAMS = idevice_id ideviceinfo idevicesyslog idevicebackup -iphoneinfo_SOURCES = iphoneinfo.c -iphoneinfo_CFLAGS = $(AM_CFLAGS) -iphoneinfo_LDFLAGS = $(AM_LDFLAGS) -iphoneinfo_LDADD = ../src/libiphone.la +ideviceinfo_SOURCES = ideviceinfo.c +ideviceinfo_CFLAGS = $(AM_CFLAGS) +ideviceinfo_LDFLAGS = $(AM_LDFLAGS) +ideviceinfo_LDADD = ../src/libimobiledevice.la -iphonesyslog_SOURCES = iphonesyslog.c -iphonesyslog_CFLAGS = $(AM_CFLAGS) -iphonesyslog_LDFLAGS = $(AM_LDFLAGS) -iphonesyslog_LDADD = ../src/libiphone.la +idevicesyslog_SOURCES = idevicesyslog.c +idevicesyslog_CFLAGS = $(AM_CFLAGS) +idevicesyslog_LDFLAGS = $(AM_LDFLAGS) +idevicesyslog_LDADD = ../src/libimobiledevice.la -iphone_id_SOURCES = iphone_id.c -iphone_id_CFLAGS = $(AM_CFLAGS) -iphone_id_LDFLAGS = $(AM_LDFLAGS) -iphone_id_LDADD = ../src/libiphone.la +idevice_id_SOURCES = idevice_id.c +idevice_id_CFLAGS = $(AM_CFLAGS) +idevice_id_LDFLAGS = $(AM_LDFLAGS) +idevice_id_LDADD = ../src/libimobiledevice.la -iphonebackup_SOURCES = iphonebackup.c -iphonebackup_CFLAGS = $(AM_CFLAGS) -iphonebackup_LDFLAGS = $(AM_LDFLAGS) -iphonebackup_LDADD = ../src/libiphone.la +idevicebackup_SOURCES = idevicebackup.c +idevicebackup_CFLAGS = $(AM_CFLAGS) +idevicebackup_LDFLAGS = $(AM_LDFLAGS) +idevicebackup_LDADD = ../src/libimobiledevice.la diff --git a/tools/iphone_id.c b/tools/idevice_id.c index 4a2c3af..1facb60 100644 --- a/tools/iphone_id.c +++ b/tools/idevice_id.c @@ -1,8 +1,8 @@ #include <stdio.h> #include <string.h> #include <stdlib.h> -#include <libiphone/libiphone.h> -#include <libiphone/lockdown.h> +#include <libimobiledevice/libimobiledevice.h> +#include <libimobiledevice/lockdown.h> #define MODE_NONE 0 #define MODE_SHOW_ID 1 @@ -25,7 +25,7 @@ static void print_usage(int argc, char **argv) int main(int argc, char **argv) { - iphone_device_t phone = NULL; + idevice_t phone = NULL; lockdownd_client_t client = NULL; char **dev_list = NULL; char *devname = NULL; @@ -38,7 +38,7 @@ int main(int argc, char **argv) /* parse cmdline args */ for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { - iphone_set_debug_level(1); + idevice_set_debug_level(1); continue; } else if (!strcmp(argv[i], "-l") || !strcmp(argv[i], "--list")) { @@ -63,14 +63,14 @@ int main(int argc, char **argv) switch (mode) { case MODE_SHOW_ID: - iphone_device_new(&phone, uuid); + idevice_new(&phone, uuid); if (!phone) { fprintf(stderr, "ERROR: No device with UUID=%s attached.\n", uuid); return -2; } - if (LOCKDOWN_E_SUCCESS != lockdownd_client_new(phone, &client, "iphone_id")) { - iphone_device_free(phone); + if (LOCKDOWN_E_SUCCESS != lockdownd_client_new(phone, &client, "idevice_id")) { + idevice_free(phone); fprintf(stderr, "ERROR: Connecting to device failed!\n"); return -2; } @@ -81,7 +81,7 @@ int main(int argc, char **argv) } lockdownd_client_free(client); - iphone_device_free(phone); + idevice_free(phone); if (ret == 0) { printf("%s\n", devname); @@ -94,14 +94,14 @@ int main(int argc, char **argv) return ret; case MODE_LIST_DEVICES: default: - if (iphone_get_device_list(&dev_list, &i) < 0) { + if (idevice_get_device_list(&dev_list, &i) < 0) { fprintf(stderr, "ERROR: Unable to retrieve device list!\n"); return -1; } for (i = 0; dev_list[i] != NULL; i++) { printf("%s\n", dev_list[i]); } - iphone_device_list_free(dev_list); + idevice_device_list_free(dev_list); return 0; } } diff --git a/tools/iphonebackup.c b/tools/idevicebackup.c index bc61347..d3b3ccc 100644 --- a/tools/iphonebackup.c +++ b/tools/idevicebackup.c @@ -1,5 +1,5 @@ /* - * iphonebackup.c + * idevicebackup.c * Command line interface to use the device's backup and restore service * * Copyright (c) 2009-2010 Martin Szulecki All Rights Reserved. @@ -27,18 +27,18 @@ #include <signal.h> #include <glib.h> -#include <libiphone/libiphone.h> -#include <libiphone/lockdown.h> -#include <libiphone/mobilebackup.h> -#include <libiphone/notification_proxy.h> -#include <libiphone/afc.h> +#include <libimobiledevice/libimobiledevice.h> +#include <libimobiledevice/lockdown.h> +#include <libimobiledevice/mobilebackup.h> +#include <libimobiledevice/notification_proxy.h> +#include <libimobiledevice/afc.h> #define MOBILEBACKUP_SERVICE_NAME "com.apple.mobilebackup" #define NP_SERVICE_NAME "com.apple.mobile.notification_proxy" static mobilebackup_client_t mobilebackup = NULL; static lockdownd_client_t client = NULL; -static iphone_device_t phone = NULL; +static idevice_t phone = NULL; static int quit_flag = 0; @@ -111,7 +111,7 @@ static plist_t mobilebackup_factory_info_plist_new() plist_dict_insert_item(ret, "Serial Number", plist_copy(value_node)); value_node = plist_dict_get_item(root_node, "UniqueDeviceID"); - iphone_device_get_uuid(phone, &uuid); + idevice_get_uuid(phone, &uuid); plist_dict_insert_item(ret, "Target Identifier", plist_new_string(uuid)); /* uppercase */ @@ -383,7 +383,7 @@ static void do_post_notification(const char *notification) np_client_t np; if (!client) { - if (lockdownd_client_new_with_handshake(phone, &client, "iphonebackup") != LOCKDOWN_E_SUCCESS) { + if (lockdownd_client_new_with_handshake(phone, &client, "idevicebackup") != LOCKDOWN_E_SUCCESS) { return; } } @@ -427,7 +427,7 @@ static void print_usage(int argc, char **argv) int main(int argc, char *argv[]) { - iphone_error_t ret = IPHONE_E_UNKNOWN_ERROR; + idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; int i; char uuid[41]; uint16_t port = 0; @@ -455,7 +455,7 @@ int main(int argc, char *argv[]) /* parse cmdline args */ for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { - iphone_set_debug_level(1); + idevice_set_debug_level(1); continue; } else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) { @@ -518,23 +518,23 @@ int main(int argc, char *argv[]) printf("Backup directory is \"%s\"\n", backup_directory); if (uuid[0] != 0) { - ret = iphone_device_new(&phone, uuid); - if (ret != IPHONE_E_SUCCESS) { + ret = idevice_new(&phone, uuid); + if (ret != IDEVICE_E_SUCCESS) { printf("No device found with uuid %s, is it plugged in?\n", uuid); return -1; } } else { - ret = iphone_device_new(&phone, NULL); - if (ret != IPHONE_E_SUCCESS) { + ret = idevice_new(&phone, NULL); + if (ret != IDEVICE_E_SUCCESS) { printf("No device found, is it plugged in?\n"); return -1; } } - if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "iphonebackup")) { - iphone_device_free(phone); + if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "idevicebackup")) { + idevice_free(phone); return -1; } @@ -946,7 +946,7 @@ int main(int argc, char *argv[]) if (mobilebackup) mobilebackup_client_free(mobilebackup); - iphone_device_free(phone); + idevice_free(phone); return 0; } diff --git a/tools/iphoneinfo.c b/tools/ideviceinfo.c index 5ee92f5..9183d92 100644 --- a/tools/iphoneinfo.c +++ b/tools/ideviceinfo.c @@ -1,5 +1,5 @@ /* - * iphoneinfo.c + * ideviceinfo.c * Simple utility to show information about an attached device * * Copyright (c) 2009 Martin Szulecki All Rights Reserved. @@ -25,8 +25,8 @@ #include <stdlib.h> #include <glib.h> -#include <libiphone/libiphone.h> -#include <libiphone/lockdown.h> +#include <libimobiledevice/libimobiledevice.h> +#include <libimobiledevice/lockdown.h> #define FORMAT_KEY_VALUE 1 #define FORMAT_XML 2 @@ -197,7 +197,7 @@ static void print_usage(int argc, char **argv) name = strrchr(argv[0], '/'); printf("Usage: %s [OPTIONS]\n", (name ? name + 1: argv[0])); - printf("Show information about the first connected iPhone/iPod Touch.\n\n"); + printf("Show information about a connected iPhone/iPod Touch.\n\n"); printf(" -d, --debug\t\tenable communication debugging\n"); printf(" -u, --uuid UUID\ttarget specific device by its 40-digit device UUID\n"); printf(" -q, --domain NAME\tset domain of query to NAME. Default: None\n"); @@ -215,8 +215,8 @@ static void print_usage(int argc, char **argv) int main(int argc, char *argv[]) { lockdownd_client_t client = NULL; - iphone_device_t phone = NULL; - iphone_error_t ret = IPHONE_E_UNKNOWN_ERROR; + idevice_t phone = NULL; + idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; int i; int format = FORMAT_KEY_VALUE; char uuid[41]; @@ -231,7 +231,7 @@ int main(int argc, char *argv[]) /* parse cmdline args */ for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { - iphone_set_debug_level(1); + idevice_set_debug_level(1); continue; } else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) { @@ -279,23 +279,23 @@ int main(int argc, char *argv[]) } if (uuid[0] != 0) { - ret = iphone_device_new(&phone, uuid); - if (ret != IPHONE_E_SUCCESS) { + ret = idevice_new(&phone, uuid); + if (ret != IDEVICE_E_SUCCESS) { printf("No device found with uuid %s, is it plugged in?\n", uuid); return -1; } } else { - ret = iphone_device_new(&phone, NULL); - if (ret != IPHONE_E_SUCCESS) { + ret = idevice_new(&phone, NULL); + if (ret != IDEVICE_E_SUCCESS) { printf("No device found, is it plugged in?\n"); return -1; } } - if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "iphoneinfo")) { - iphone_device_free(phone); + if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "ideviceinfo")) { + idevice_free(phone); return -1; } @@ -329,7 +329,7 @@ int main(int argc, char *argv[]) if (domain != NULL) free(domain); lockdownd_client_free(client); - iphone_device_free(phone); + idevice_free(phone); return 0; } diff --git a/tools/iphonesyslog.c b/tools/idevicesyslog.c index 41e490f..32b9711 100644 --- a/tools/iphonesyslog.c +++ b/tools/idevicesyslog.c @@ -1,5 +1,5 @@ /* - * syslog_relay.c + * idevicesyslog.c * Relay the syslog of a device to stdout * * Copyright (c) 2009 Martin Szulecki All Rights Reserved. @@ -26,8 +26,8 @@ #include <signal.h> #include <stdlib.h> -#include <libiphone/libiphone.h> -#include <libiphone/lockdown.h> +#include <libimobiledevice/libimobiledevice.h> +#include <libimobiledevice/lockdown.h> static int quit_flag = 0; @@ -45,8 +45,8 @@ static void clean_exit(int sig) int main(int argc, char *argv[]) { lockdownd_client_t client = NULL; - iphone_device_t phone = NULL; - iphone_error_t ret = IPHONE_E_UNKNOWN_ERROR; + idevice_t phone = NULL; + idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; int i; char uuid[41]; uint16_t port = 0; @@ -60,7 +60,7 @@ int main(int argc, char *argv[]) /* parse cmdline args */ for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { - iphone_set_debug_level(1); + idevice_set_debug_level(1); continue; } else if (!strcmp(argv[i], "-u") || !strcmp(argv[i], "--uuid")) { @@ -83,23 +83,23 @@ int main(int argc, char *argv[]) } if (uuid[0] != 0) { - ret = iphone_device_new(&phone, uuid); - if (ret != IPHONE_E_SUCCESS) { + ret = idevice_new(&phone, uuid); + if (ret != IDEVICE_E_SUCCESS) { printf("No device found with uuid %s, is it plugged in?\n", uuid); return -1; } } else { - ret = iphone_device_new(&phone, NULL); - if (ret != IPHONE_E_SUCCESS) { + ret = idevice_new(&phone, NULL); + if (ret != IDEVICE_E_SUCCESS) { printf("No device found, is it plugged in?\n"); return -1; } } - if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "iphonesyslog")) { - iphone_device_free(phone); + if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "idevicesyslog")) { + idevice_free(phone); return -1; } @@ -109,15 +109,15 @@ int main(int argc, char *argv[]) lockdownd_client_free(client); /* connect to socket relay messages */ - iphone_connection_t conn = NULL; - if ((iphone_device_connect(phone, port, &conn) != IPHONE_E_SUCCESS) || !conn) { + idevice_connection_t conn = NULL; + if ((idevice_connect(phone, port, &conn) != IDEVICE_E_SUCCESS) || !conn) { printf("ERROR: Could not open usbmux connection.\n"); } else { while (!quit_flag) { char *receive = NULL; uint32_t datalen = 0, bytes = 0, recv_bytes = 0; - ret = iphone_connection_receive(conn, (char *) &datalen, sizeof(datalen), &bytes); + ret = idevice_connection_receive(conn, (char *) &datalen, sizeof(datalen), &bytes); datalen = ntohl(datalen); if (datalen == 0) @@ -127,7 +127,7 @@ int main(int argc, char *argv[]) receive = (char *) malloc(sizeof(char) * datalen); while (!quit_flag && (recv_bytes <= datalen)) { - ret = iphone_connection_receive(conn, receive, datalen, &bytes); + ret = idevice_connection_receive(conn, receive, datalen, &bytes); if (bytes == 0) break; @@ -140,12 +140,12 @@ int main(int argc, char *argv[]) free(receive); } } - iphone_device_disconnect(conn); + idevice_disconnect(conn); } else { printf("ERROR: Could not start service com.apple.syslog_relay.\n"); } - iphone_device_free(phone); + idevice_free(phone); return 0; } |