summaryrefslogtreecommitdiffstats
path: root/dev/lckdclient.c
diff options
context:
space:
mode:
Diffstat (limited to 'dev/lckdclient.c')
-rw-r--r--dev/lckdclient.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/dev/lckdclient.c b/dev/lckdclient.c
index e7ad962..b880253 100644
--- a/dev/lckdclient.c
+++ b/dev/lckdclient.c
@@ -34,22 +34,23 @@ int main(int argc, char *argv[])
34 lockdownd_client_t client = NULL; 34 lockdownd_client_t client = NULL;
35 iphone_device_t phone = NULL; 35 iphone_device_t phone = NULL;
36 36
37 iphone_set_debug(1); 37 iphone_set_debug_level(1);
38 38
39 if (IPHONE_E_SUCCESS != iphone_get_device(&phone)) { 39 if (IPHONE_E_SUCCESS != iphone_get_device(&phone)) {
40 printf("No iPhone found, is it plugged in?\n"); 40 printf("No iPhone found, is it plugged in?\n");
41 return -1; 41 return -1;
42 } 42 }
43 43
44 if (IPHONE_E_SUCCESS != lockdownd_new_client(phone, &client)) { 44 char *uuid = NULL;
45 iphone_free_device(phone); 45 if (IPHONE_E_SUCCESS == iphone_device_get_uuid(phone, &uuid)) {
46 return -1; 46 printf("DeviceUniqueID : %s\n", uuid);
47 } 47 }
48 if (uuid)
49 free(uuid);
48 50
49 char *uid = NULL; 51 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new(phone, &client)) {
50 if (IPHONE_E_SUCCESS == lockdownd_get_device_uid(client, &uid)) { 52 iphone_device_free(phone);
51 printf("DeviceUniqueID : %s\n", uid); 53 return -1;
52 free(uid);
53 } 54 }
54 55
55 using_history(); 56 using_history();
@@ -75,7 +76,7 @@ int main(int argc, char *argv[])
75 76
76 if (!strcmp(*args, "get") && len >= 2) { 77 if (!strcmp(*args, "get") && len >= 2) {
77 plist_t value = NULL; 78 plist_t value = NULL;
78 if (IPHONE_E_SUCCESS == lockdownd_get_value(client, len == 3 ? *(args + 1):NULL, len == 3 ? *(args + 2):*(args + 1), &value)) 79 if (LOCKDOWN_E_SUCCESS == lockdownd_get_value(client, len == 3 ? *(args + 1):NULL, len == 3 ? *(args + 2):*(args + 1), &value))
79 { 80 {
80 char *xml = NULL; 81 char *xml = NULL;
81 uint32_t length; 82 uint32_t length;
@@ -92,8 +93,13 @@ int main(int argc, char *argv[])
92 93
93 if (!strcmp(*args, "start") && len == 2) { 94 if (!strcmp(*args, "start") && len == 2) {
94 int port = 0; 95 int port = 0;
95 lockdownd_start_service(client, *(args + 1), &port); 96 if(LOCKDOWN_E_SUCCESS == lockdownd_start_service(client, *(args + 1), &port)) {
96 printf("%i\n", port); 97 printf("started service %s on port %i\n", *(args + 1), port);
98 }
99 else
100 {
101 printf("failed to start service %s on device.\n", *(args + 1));
102 }
97 } 103 }
98 } 104 }
99 g_strfreev(args); 105 g_strfreev(args);
@@ -102,8 +108,8 @@ int main(int argc, char *argv[])
102 cmd = NULL; 108 cmd = NULL;
103 } 109 }
104 clear_history(); 110 clear_history();
105 lockdownd_free_client(client); 111 lockdownd_client_free(client);
106 iphone_free_device(phone); 112 iphone_device_free(phone);
107 113
108 return 0; 114 return 0;
109} 115}