Skip to content

Commit f03d5f7

Browse files
committed
Update idevice to fix retransmission and debug proxy issue jkcoxson/idevice#14
1 parent 354333d commit f03d5f7

4 files changed

Lines changed: 5 additions & 19 deletions

File tree

StikJIT/JSSupport/IDeviceJSBridgeDebugProxy.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
command = debugserver_command_new([commandStr UTF8String], NULL, 0);
1818

1919
char* attach_response = 0;
20-
IdeviceFfiError* err = debug_proxy_send_command2(debugProxy, command, &attach_response);
20+
IdeviceFfiError* err = debug_proxy_send_command(debugProxy, command, &attach_response);
2121
debugserver_command_free(command);
2222
if (err) {
2323
context.exception = [JSValue valueWithObject:[NSString stringWithFormat:@"error code %d, msg %s", err->code, err->message] inContext:context];

StikJIT/idevice/jit.c

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,6 @@
1818

1919
#include "jit.h"
2020

21-
IdeviceFfiError* debug_proxy_send_command2(struct DebugProxyHandle *handle, struct DebugserverCommandHandle *command, char **response) {
22-
IdeviceFfiError* err = debug_proxy_send_command(handle, command, response);
23-
if(err) {
24-
return err;
25-
}
26-
for(int i = 0; i < 10; ++i) {
27-
if(*response) {
28-
return err;
29-
}
30-
debug_proxy_read_response(handle, response);
31-
}
32-
return err;
33-
}
34-
3521
void runDebugServerCommand(int pid, DebugProxyHandle* debug_proxy, LogFuncC logger, DebugAppCallback callback) {
3622
// enable QStartNoAckMode
3723
char *disableResponse = NULL;
@@ -61,7 +47,7 @@ void runDebugServerCommand(int pid, DebugProxyHandle* debug_proxy, LogFuncC logg
6147
}
6248

6349
char *attach_response = NULL;
64-
err = debug_proxy_send_command2(debug_proxy, attach_cmd, &attach_response);
50+
err = debug_proxy_send_command(debug_proxy, attach_cmd, &attach_response);
6551
debugserver_command_free(attach_cmd);
6652

6753
if (err) {
@@ -79,11 +65,12 @@ void runDebugServerCommand(int pid, DebugProxyHandle* debug_proxy, LogFuncC logg
7965
logger("Failed to create detach command");
8066
} else {
8167
char *detach_response = NULL;
82-
err = debug_proxy_send_command2(debug_proxy, detach_cmd, &detach_response);
68+
err = debug_proxy_send_command(debug_proxy, detach_cmd, &detach_response);
8369
debugserver_command_free(detach_cmd);
8470

8571
if (err) {
86-
logger("Failed to detach from process: %d", err);
72+
logger("Failed to detach from process: %d", err->code);
73+
idevice_error_free(err);
8774
} else if (detach_response != NULL) {
8875
logger("Detach response: %s", detach_response);
8976
idevice_string_free(detach_response);

StikJIT/idevice/jit.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
typedef void (^LogFuncC)(const char* message, ...);
1414
typedef void (^DebugAppCallback)(int pid, struct DebugProxyHandle* debug_proxy, dispatch_semaphore_t semaphore);
1515
int debug_app(IdeviceProviderHandle* tcp_provider, const char *bundle_id, LogFuncC logger, DebugAppCallback callback);
16-
IdeviceFfiError* debug_proxy_send_command2(struct DebugProxyHandle *handle, struct DebugserverCommandHandle *command, char **response);
1716
int debug_app_pid(IdeviceProviderHandle* tcp_provider, int pid, LogFuncC logger, DebugAppCallback callback);
1817

1918
#endif /* JIT_H */

StikJIT/idevice/libidevice_ffi.a

376 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)