Skip to content

Commit d02ed21

Browse files
committed
require libimobiledevice >= 1.3.0
new release of libimobiledevice is out. - allows to drop custom implementation of idevice_connection_get_fd - simplifies troubleshooting
1 parent 6d499e0 commit d02ed21

File tree

3 files changed

+6
-59
lines changed

3 files changed

+6
-59
lines changed

Diff for: README.md

+5-16
Original file line numberDiff line numberDiff line change
@@ -195,21 +195,11 @@ or
195195

196196
> Could not connect to lockdownd, error code -\<number\>. Exiting.
197197
198-
Please upgrade libimobiledevice to version from master and rebuild ios-webkit-debug-proxy. Upcoming 1.2.1 has many fixes but not marked for release just yet. If you're on OS X:
199-
200-
brew update
201-
brew uninstall --force libimobiledevice ios-webkit-debug-proxy usbmuxd
202-
brew install --HEAD usbmuxd
203-
brew install --HEAD libimobiledevice
204-
brew install -s ios-webkit-debug-proxy
205-
198+
Make sure you're using latest version of ios-webkit-debug-proxy
206199

207200
##### Inspectable pages list is empty for iOS >= 12.2
208201

209-
Please upgrade usbmuxd to version from master
210-
211-
brew update
212-
brew install --HEAD usbmuxd
202+
Make sure you're using latest version of ios-webkit-debug-proxy
213203

214204
##### Can not see Simulator
215205

@@ -243,7 +233,6 @@ Google BSD license <https://developers.google.com/google-bsd-license>
243233
Copyright 2012 Google Inc. <[email protected]>
244234

245235
The proxy uses the following open-source packages:
246-
- [libplist 1.10](http://cgit.sukimashita.com/libplist.git)
247-
- [libusbmuxd 1.0.8](http://cgit.sukimashita.com/usbmuxd.git/)
248-
- [libimobiledevice 1.2.0](http://cgit.sukimashita.com/libimobiledevice.git)
249-
- libimobiledevice 1.2.1 _if your target iOS10+_
236+
- [libplist 2.2.0](http://cgit.sukimashita.com/libplist.git)
237+
- [libusbmuxd 2.0.0](http://cgit.sukimashita.com/usbmuxd.git/)
238+
- [libimobiledevice 1.3.0](http://cgit.sukimashita.com/libimobiledevice.git)

Diff for: configure.ac

+1-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ AC_PROG_INSTALL
1616
PKG_PROG_PKG_CONFIG
1717

1818
# Checks for libraries.
19-
PKG_CHECK_MODULES(libimobiledevice, libimobiledevice-1.0 >= 1.2.0)
19+
PKG_CHECK_MODULES(libimobiledevice, libimobiledevice-1.0 >= 1.3.0)
2020
PKG_CHECK_MODULES(libplist, libplist-2.0 >= 2.2.0)
2121
PKG_CHECK_MODULES(openssl, openssl >= 0.9.8)
2222
AC_CHECK_LIB([plist-2.0], [plist_to_xml],
@@ -79,11 +79,6 @@ fi
7979

8080
AC_CHECK_FUNCS([memmove memset regcomp select socket strcasecmp strncasecmp strchr strdup strndup strrchr strstr strtol strcasestr getline])
8181

82-
SAVE_CFLAGS=$CFLAGS
83-
CFLAGS="$CFLAGS $libimobiledevice_CFLAGS"
84-
AC_CHECK_DECL(idevice_connection_get_fd, [AC_DEFINE([HAVE_IDEVICE_CONNECTION_GET_FD], 1, [ ])], [], [#include <libimobiledevice/libimobiledevice.h>])
85-
CFLAGS=$SAVE_CFLAGS
86-
8782
AC_CONFIG_FILES([Makefile src/Makefile include/Makefile examples/Makefile])
8883

8984
CFLAGS="${CFLAGS} -Wall -Werror"

Diff for: src/webinspector.c

-37
Original file line numberDiff line numberDiff line change
@@ -53,50 +53,13 @@ struct wi_private {
5353
// CONNECT
5454
//
5555

56-
#ifndef HAVE_IDEVICE_CONNECTION_GET_FD
57-
// based on libimobiledevice 1.2.0
58-
enum connection_type {
59-
CONNECTION_USBMUXD = 1
60-
};
61-
struct idevice_connection_private {
62-
char *udid; // added in v1.1.6
63-
enum connection_type type;
64-
void *data;
65-
void *ssl_data;
66-
};
67-
68-
wi_status idevice_connection_get_fd(idevice_connection_t connection,
69-
int *to_fd) {
70-
if (!connection || !to_fd) {
71-
return WI_ERROR;
72-
}
73-
idevice_connection_private *c = (
74-
(sizeof(*connection) == sizeof(idevice_connection_private)) ?
75-
(idevice_connection_private *) connection : NULL);
76-
if (!c || c->type != CONNECTION_USBMUXD || c->data <= 0) {
77-
perror("Invalid idevice_connection struct. Please verify that "
78-
__FILE__ "'s idevice_connection_private matches your version of"
79-
" libimbiledevice/src/idevice.h");
80-
return WI_ERROR;
81-
}
82-
int fd = (int)(long)c->data;
83-
struct stat fd_stat;
84-
if (fstat(fd, &fd_stat) < 0 || !S_ISSOCK(fd_stat.st_mode)) {
85-
perror("idevice_connection fd is not a socket?");
86-
return WI_ERROR;
87-
}
88-
*to_fd = fd;
89-
return WI_SUCCESS;
90-
}
91-
#else
9256
// based on latest libimobiledevice/src/idevice.h
9357
struct idevice_connection_private {
9458
idevice_t device;
9559
enum idevice_connection_type type;
9660
void *data;
9761
void *ssl_data;
9862
};
99-
#endif
10063

10164
struct ssl_data_private {
10265
SSL *session;

0 commit comments

Comments
 (0)