From 3e5a7290e79779321cd8901bbd5091a5ea7132f6 Mon Sep 17 00:00:00 2001 From: Aaron Burghardt Date: Fri, 23 Aug 2013 08:44:25 -0400 Subject: Added the option to filerelaytest to pass sources on the command line. --- dev/filerelaytest.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'dev') diff --git a/dev/filerelaytest.c b/dev/filerelaytest.c index 9094130..0f2f117 100644 --- a/dev/filerelaytest.c +++ b/dev/filerelaytest.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include +#include #include #include #include @@ -41,7 +42,7 @@ int main(int argc, char **argv) goto leave_cleanup; } - if (lockdownd_start_service(client, "com.apple.mobile.file_relay", &service) != LOCKDOWN_E_SUCCESS) { + if (lockdownd_start_service(client, FILE_RELAY_SERVICE_NAME, &service) != LOCKDOWN_E_SUCCESS) { printf("could not start file_relay service!\n"); goto leave_cleanup; } @@ -62,7 +63,20 @@ int main(int argc, char **argv) } idevice_connection_t dump = NULL; - const char *sources[] = {"AppleSupport", "Network", "VPN", "WiFi", "UserDatabases", "CrashReporter", "tmp", "SystemConfiguration", NULL}; + const char **sources; + const char *default_sources[] = {"AppleSupport", "Network", "VPN", "WiFi", "UserDatabases", "CrashReporter", "tmp", "SystemConfiguration", NULL}; + + if (argc > 1) { + sources = calloc(1, argc * sizeof(char *)); + argc--; + argv++; + for (int i = 0; i < argc; i++) { + sources[i] = argv[i]; + } + } + else { + sources = default_sources; + } printf("Requesting"); int i = 0; -- cgit v1.1-32-gdbae