diff options
author | Aaron Burghardt | 2013-08-23 08:44:25 -0400 |
---|---|---|
committer | Martin Szulecki | 2013-09-11 12:12:32 +0200 |
commit | 3e5a7290e79779321cd8901bbd5091a5ea7132f6 (patch) | |
tree | d7f65cea9146022a5549b1b75e2ba62229b76d92 /dev | |
parent | 05418483bbb63e014bda3dbb768e604ce810870f (diff) | |
download | libimobiledevice-3e5a7290e79779321cd8901bbd5091a5ea7132f6.tar.gz libimobiledevice-3e5a7290e79779321cd8901bbd5091a5ea7132f6.tar.bz2 |
Added the option to filerelaytest to pass sources on the command line.
Diffstat (limited to 'dev')
-rw-r--r-- | dev/filerelaytest.c | 18 |
1 files changed, 16 insertions, 2 deletions
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 <stdio.h> +#include <stdlib.h> #include <libimobiledevice/libimobiledevice.h> #include <libimobiledevice/lockdown.h> #include <libimobiledevice/file_relay.h> @@ -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; |