summaryrefslogtreecommitdiffstats
path: root/dev
diff options
context:
space:
mode:
Diffstat (limited to 'dev')
-rw-r--r--dev/afccheck.c6
-rw-r--r--dev/iphoneclient.c11
-rw-r--r--dev/iphoneenterrecovery.c3
-rw-r--r--dev/lckdclient.c4
-rwxr-xr-xdev/msync.py26
-rw-r--r--dev/msyncclient.c6
6 files changed, 26 insertions, 30 deletions
diff --git a/dev/afccheck.c b/dev/afccheck.c
index 88935a0..569acf1 100644
--- a/dev/afccheck.c
+++ b/dev/afccheck.c
@@ -93,15 +93,13 @@ int main(int argc, char *argv[])
93 lockdownd_client_t client = NULL; 93 lockdownd_client_t client = NULL;
94 iphone_device_t phone = NULL; 94 iphone_device_t phone = NULL;
95 GError *err; 95 GError *err;
96 int port = 0; 96 uint16_t port = 0;
97 afc_client_t afc = NULL; 97 afc_client_t afc = NULL;
98 98
99 if (argc > 1 && !strcasecmp(argv[1], "--debug")) { 99 if (argc > 1 && !strcasecmp(argv[1], "--debug")) {
100 iphone_set_debug_level(1); 100 iphone_set_debug_level(1);
101 iphone_set_debug_mask(DBGMASK_ALL);
102 } else { 101 } else {
103 iphone_set_debug_level(0); 102 iphone_set_debug_level(0);
104 iphone_set_debug_mask(DBGMASK_NONE);
105 } 103 }
106 104
107 if (IPHONE_E_SUCCESS != iphone_device_new(&phone, NULL)) { 105 if (IPHONE_E_SUCCESS != iphone_device_new(&phone, NULL)) {
@@ -109,7 +107,7 @@ int main(int argc, char *argv[])
109 return 1; 107 return 1;
110 } 108 }
111 109
112 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new(phone, &client)) { 110 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "afccheck")) {
113 iphone_device_free(phone); 111 iphone_device_free(phone);
114 return 1; 112 return 1;
115 } 113 }
diff --git a/dev/iphoneclient.c b/dev/iphoneclient.c
index d62d23f..eab903c 100644
--- a/dev/iphoneclient.c
+++ b/dev/iphoneclient.c
@@ -29,7 +29,6 @@
29#include <libiphone/lockdown.h> 29#include <libiphone/lockdown.h>
30#include <libiphone/afc.h> 30#include <libiphone/afc.h>
31#include <libiphone/notification_proxy.h> 31#include <libiphone/notification_proxy.h>
32#include "../src/utils.h"
33 32
34static void notifier(const char *notification) 33static void notifier(const char *notification)
35{ 34{
@@ -40,7 +39,7 @@ static void notifier(const char *notification)
40 39
41static void perform_notification(iphone_device_t phone, lockdownd_client_t client, const char *notification) 40static void perform_notification(iphone_device_t phone, lockdownd_client_t client, const char *notification)
42{ 41{
43 int nport = 0; 42 uint16_t nport = 0;
44 np_client_t np; 43 np_client_t np;
45 44
46 lockdownd_start_service(client, "com.apple.mobile.notification_proxy", &nport); 45 lockdownd_start_service(client, "com.apple.mobile.notification_proxy", &nport);
@@ -60,8 +59,8 @@ static void perform_notification(iphone_device_t phone, lockdownd_client_t clien
60int main(int argc, char *argv[]) 59int main(int argc, char *argv[])
61{ 60{
62 unsigned int bytes = 0; 61 unsigned int bytes = 0;
63 int port = 0, i = 0; 62 uint16_t port = 0, i = 0;
64 int npp; 63 uint16_t npp;
65 lockdownd_client_t client = NULL; 64 lockdownd_client_t client = NULL;
66 iphone_device_t phone = NULL; 65 iphone_device_t phone = NULL;
67 uint64_t lockfile = 0; 66 uint64_t lockfile = 0;
@@ -69,10 +68,8 @@ int main(int argc, char *argv[])
69 68
70 if (argc > 1 && !strcasecmp(argv[1], "--debug")) { 69 if (argc > 1 && !strcasecmp(argv[1], "--debug")) {
71 iphone_set_debug_level(1); 70 iphone_set_debug_level(1);
72 iphone_set_debug_mask(DBGMASK_ALL);
73 } else { 71 } else {
74 iphone_set_debug_level(0); 72 iphone_set_debug_level(0);
75 iphone_set_debug_mask(DBGMASK_NONE);
76 } 73 }
77 74
78 if (IPHONE_E_SUCCESS != iphone_device_new(&phone, NULL)) { 75 if (IPHONE_E_SUCCESS != iphone_device_new(&phone, NULL)) {
@@ -87,7 +84,7 @@ int main(int argc, char *argv[])
87 if (uuid) 84 if (uuid)
88 free(uuid); 85 free(uuid);
89 86
90 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new(phone, &client)) { 87 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "iphoneclient")) {
91 iphone_device_free(phone); 88 iphone_device_free(phone);
92 printf("Exiting.\n"); 89 printf("Exiting.\n");
93 return -1; 90 return -1;
diff --git a/dev/iphoneenterrecovery.c b/dev/iphoneenterrecovery.c
index 1d4d332..153df15 100644
--- a/dev/iphoneenterrecovery.c
+++ b/dev/iphoneenterrecovery.c
@@ -51,7 +51,6 @@ int main(int argc, char *argv[])
51 /* parse cmdline args */ 51 /* parse cmdline args */
52 for (i = 1; i < argc; i++) { 52 for (i = 1; i < argc; i++) {
53 if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { 53 if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) {
54 iphone_set_debug_mask(DBGMASK_ALL);
55 iphone_set_debug_level(1); 54 iphone_set_debug_level(1);
56 continue; 55 continue;
57 } 56 }
@@ -74,7 +73,7 @@ int main(int argc, char *argv[])
74 return -1; 73 return -1;
75 } 74 }
76 75
77 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new(phone, &client)) { 76 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "iphoneenterrecovery")) {
78 iphone_device_free(phone); 77 iphone_device_free(phone);
79 return -1; 78 return -1;
80 } 79 }
diff --git a/dev/lckdclient.c b/dev/lckdclient.c
index d866435..7b7604e 100644
--- a/dev/lckdclient.c
+++ b/dev/lckdclient.c
@@ -48,7 +48,7 @@ int main(int argc, char *argv[])
48 if (uuid) 48 if (uuid)
49 free(uuid); 49 free(uuid);
50 50
51 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new(phone, &client)) { 51 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "lckdclient")) {
52 iphone_device_free(phone); 52 iphone_device_free(phone);
53 return -1; 53 return -1;
54 } 54 }
@@ -92,7 +92,7 @@ int main(int argc, char *argv[])
92 } 92 }
93 93
94 if (!strcmp(*args, "start") && len == 2) { 94 if (!strcmp(*args, "start") && len == 2) {
95 int port = 0; 95 uint16_t port = 0;
96 if(LOCKDOWN_E_SUCCESS == lockdownd_start_service(client, *(args + 1), &port)) { 96 if(LOCKDOWN_E_SUCCESS == lockdownd_start_service(client, *(args + 1), &port)) {
97 printf("started service %s on port %i\n", *(args + 1), port); 97 printf("started service %s on port %i\n", *(args + 1), port);
98 } 98 }
diff --git a/dev/msync.py b/dev/msync.py
index fe7f1fd..6bb85d7 100755
--- a/dev/msync.py
+++ b/dev/msync.py
@@ -1,6 +1,7 @@
1#! /usr/bin/env python 1#! /usr/bin/env python
2 2
3from libiphone.iPhone import * 3from iphone import *
4from plist import *
4 5
5# get msync client 6# get msync client
6def GetMobileSyncClient() : 7def GetMobileSyncClient() :
@@ -24,17 +25,18 @@ msync = GetMobileSyncClient()
24if not msync : 25if not msync :
25 exit(1) 26 exit(1)
26 27
27array = PListNode(PLIST_ARRAY) 28a = Array()
28array.add_sub_string("SDMessageSyncDataClassWithDevice") 29a.append( String("SDMessageSyncDataClassWithDevice") )
29array.add_sub_string("com.apple.Contacts"); 30a.append( String("") )
30array.add_sub_string("---"); 31a.append( String("com.apple.Contacts") )
31array.add_sub_string("2009-01-13 22:25:58 +0100"); 32a.append( String("---") )
32array.add_sub_uint(106); 33a.append( String("2009-01-13 22:25:58 +0100") )
33array.add_sub_string("___EmptyParameterString___"); 34a.append( Integer(106) )
34 35a.append( String("___EmptyParameterString___") )
35msync.send(array) 36
36array = msync.receive() 37msync.send(a)
37print array.to_xml() 38a = msync.receive()
39print a.to_xml()
38 40
39 41
40 42
diff --git a/dev/msyncclient.c b/dev/msyncclient.c
index 53018ac..c136ef2 100644
--- a/dev/msyncclient.c
+++ b/dev/msyncclient.c
@@ -141,19 +141,19 @@ static mobilesync_error_t mobilesync_get_all_contacts(mobilesync_client_t client
141 141
142int main(int argc, char *argv[]) 142int main(int argc, char *argv[])
143{ 143{
144 int port = 0; 144 uint16_t port = 0;
145 lockdownd_client_t client = NULL; 145 lockdownd_client_t client = NULL;
146 iphone_device_t phone = NULL; 146 iphone_device_t phone = NULL;
147 147
148 if (argc > 1 && !strcasecmp(argv[1], "--debug")) 148 if (argc > 1 && !strcasecmp(argv[1], "--debug"))
149 iphone_set_debug_mask(DBGMASK_MOBILESYNC); 149 iphone_set_debug_level(1);
150 150
151 if (IPHONE_E_SUCCESS != iphone_device_new(&phone, NULL)) { 151 if (IPHONE_E_SUCCESS != iphone_device_new(&phone, NULL)) {
152 printf("No iPhone found, is it plugged in?\n"); 152 printf("No iPhone found, is it plugged in?\n");
153 return -1; 153 return -1;
154 } 154 }
155 155
156 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new(phone, &client)) { 156 if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(phone, &client, "msyncclient")) {
157 iphone_device_free(phone); 157 iphone_device_free(phone);
158 return -1; 158 return -1;
159 } 159 }