diff options
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | src/ideviceinstaller.c | 28 |
2 files changed, 32 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index ab3945b..4dc3d76 100644 --- a/configure.ac +++ b/configure.ac @@ -20,6 +20,10 @@ PKG_CHECK_MODULES(libimobiledevice10, libimobiledevice-1.0 >= 1.0.0, libimobiled if test x"$libimobiledevice_1_0" = xyes; then AC_DEFINE([HAVE_LIBIMOBILEDEVICE_1_0], 1, [Define if libimobiledevice is using 1.0.0 API]) fi +PKG_CHECK_MODULES(libimobiledevice11, libimobiledevice-1.0 >= 1.1.0, libimobiledevice_1_1=yes, libimobiledevice_1_1=no) +if test x"$libimobiledevice_1_1" = xyes; then + AC_DEFINE([HAVE_LIBIMOBILEDEVICE_1_1], 1, [Define if libimobiledevice is using 1.1.0 API]) +fi PKG_CHECK_MODULES(libplist, libplist >= 0.15) PKG_CHECK_MODULES(libzip, libzip >= 0.8) diff --git a/src/ideviceinstaller.c b/src/ideviceinstaller.c index 86c6fe7..c8bc239 100644 --- a/src/ideviceinstaller.c +++ b/src/ideviceinstaller.c @@ -75,7 +75,11 @@ static void notifier(const char *notification) notified = 1; } +#ifdef HAVE_LIBIMOBILEDEVICE_1_1 +static void status_cb(const char *operation, plist_t status, void *unused) +#else static void status_cb(const char *operation, plist_t status) +#endif { if (status && operation) { plist_t npercent = plist_dict_get_item(status, "PercentComplete"); @@ -665,17 +669,29 @@ run_again: } if (install_mode) { printf("Installing '%s'\n", pkgname); +#ifdef HAVE_LIBIMOBILEDEVICE_1_1 + instproxy_install(ipc, pkgname, client_opts, status_cb, NULL); +#else instproxy_install(ipc, pkgname, client_opts, status_cb); +#endif } else { printf("Upgrading '%s'\n", pkgname); +#ifdef HAVE_LIBIMOBILEDEVICE_1_1 + instproxy_upgrade(ipc, pkgname, client_opts, status_cb, NULL); +#else instproxy_upgrade(ipc, pkgname, client_opts, status_cb); +#endif } instproxy_client_options_free(client_opts); free(pkgname); wait_for_op_complete = 1; notification_expected = 1; } else if (uninstall_mode) { +#ifdef HAVE_LIBIMOBILEDEVICE_1_1 + instproxy_uninstall(ipc, appid, NULL, status_cb, NULL); +#else instproxy_uninstall(ipc, appid, NULL, status_cb); +#endif wait_for_op_complete = 1; notification_expected = 1; } else if (list_archives_mode) { @@ -834,7 +850,11 @@ run_again: } } +#ifdef HAVE_LIBIMOBILEDEVICE_1_1 + instproxy_archive(ipc, appid, client_opts, status_cb, NULL); +#else instproxy_archive(ipc, appid, client_opts, status_cb); +#endif instproxy_client_options_free(client_opts); wait_for_op_complete = 1; if (skip_uninstall) { @@ -968,11 +988,19 @@ run_again: } goto leave_cleanup; } else if (restore_mode) { +#ifdef HAVE_LIBIMOBILEDEVICE_1_1 + instproxy_restore(ipc, appid, NULL, status_cb, NULL); +#else instproxy_restore(ipc, appid, NULL, status_cb); +#endif wait_for_op_complete = 1; notification_expected = 1; } else if (remove_archive_mode) { +#ifdef HAVE_LIBIMOBILEDEVICE_1_1 + instproxy_remove_archive(ipc, appid, NULL, status_cb, NULL); +#else instproxy_remove_archive(ipc, appid, NULL, status_cb); +#endif wait_for_op_complete = 1; } else { printf |