From 12b62b8d2d001e03d8b640afbc44d943d14f24b5 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Mon, 3 Aug 2009 19:58:55 +0100 Subject: Make distcheck pass from a clean tree Signed-off-by: Matt Colyer --- Makefile.am | 5 ++--- configure.ac | 3 +++ dev/Makefile.am | 5 +++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index bf4205d..04358f9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = src include fdi swig $(DEV_SUB) tools +SUBDIRS = src include fdi swig dev tools DISTCHECK_CONFIGURE_FLAGS = --enable-dev-tools @@ -8,9 +8,8 @@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libiphone-1.0.pc EXTRA_DIST= docs -dist-hook: doc -doc: +docs: rm -fr docs doxygen doxygen.cfg diff --git a/configure.ac b/configure.ac index d6b27f4..55f5bae 100644 --- a/configure.ac +++ b/configure.ac @@ -59,6 +59,9 @@ if test "$build_dev_tools" = true; then else DEV_SUB= fi + +AM_CONDITIONAL([ENABLE_DEVTOOLS],[test "x$DEV_SUB" = "xdev"]) + AC_SUBST([DEV_SUB]) AC_ARG_ENABLE([debug-code], diff --git a/dev/Makefile.am b/dev/Makefile.am index 70cd52b..cd43623 100644 --- a/dev/Makefile.am +++ b/dev/Makefile.am @@ -3,6 +3,7 @@ INCLUDES = -I$(top_srcdir)/include AM_CFLAGS = $(GLOBAL_CFLAGS) $(libglib2_CFLAGS) $(libgnutls_CFLAGS) $(libtasn1_CFLAGS) $(libgthread2_CFLAGS) $(LFS_CFLAGS) AM_LDFLAGS = $(libglib2_LIBS) $(libgnutls_LIBS) $(libtasn1_LIBS) $(libgthread2_LIBS) +if ENABLE_DEVTOOLS noinst_PROGRAMS = iphoneclient lckd-client afccheck msyncclient iphoneclient_SOURCES = iphoneclient.c @@ -22,3 +23,7 @@ msyncclient_SOURCES = msyncclient.c msyncclient_CFLAGS = $(AM_CFLAGS) msyncclient_LDFLAGS = $(AM_LDFLAGS) msyncclient_LDADD = ../src/libiphone.la + +endif # ENABLE_DEVTOOLS + +EXTRA_DIST = iphoneclient.c lckdclient.c afccheck.c msyncclient.c -- cgit v1.1-32-gdbae From 04dc8e66956ff66f6438fd3ca151d58f528a03ea Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Tue, 4 Aug 2009 00:00:32 +0200 Subject: Invalid check for host_id in userpref_get_host_id On a system without a previous pairing, libiphone fails to connect to the device: userpref_get_host_id: Using (null) as HostID The code checks if host_id is NULL but it needs to check if *host_id is NULL, otherwise it won't generate a new HostID. [#69 state:resolved] Signed-off-by: Matt Colyer --- src/userpref.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/userpref.c b/src/userpref.c index b930693..9dd1a01 100644 --- a/src/userpref.c +++ b/src/userpref.c @@ -148,7 +148,7 @@ void userpref_get_host_id(char **host_id) g_key_file_free(key_file); g_free(config_file); - if (!host_id) { + if (!*host_id) { /* no config, generate host_id */ *host_id = userpref_generate_host_id(); userpref_set_host_id(*host_id); -- cgit v1.1-32-gdbae From a2644dc696951435f05bba6219085fad333ef076 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Sat, 1 Aug 2009 18:54:59 +0200 Subject: Add new iphoneenterrecovery dev tool to make a device enter recovery mode [#68 state:resolved] Signed-off-by: Matt Colyer --- dev/Makefile.am | 7 +++- dev/iphoneenterrecovery.c | 94 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 dev/iphoneenterrecovery.c diff --git a/dev/Makefile.am b/dev/Makefile.am index 70cd52b..c41b663 100644 --- a/dev/Makefile.am +++ b/dev/Makefile.am @@ -3,7 +3,7 @@ INCLUDES = -I$(top_srcdir)/include AM_CFLAGS = $(GLOBAL_CFLAGS) $(libglib2_CFLAGS) $(libgnutls_CFLAGS) $(libtasn1_CFLAGS) $(libgthread2_CFLAGS) $(LFS_CFLAGS) AM_LDFLAGS = $(libglib2_LIBS) $(libgnutls_LIBS) $(libtasn1_LIBS) $(libgthread2_LIBS) -noinst_PROGRAMS = iphoneclient lckd-client afccheck msyncclient +noinst_PROGRAMS = iphoneclient lckd-client afccheck msyncclient iphoneenterrecovery iphoneclient_SOURCES = iphoneclient.c iphoneclient_LDADD = ../src/libiphone.la @@ -22,3 +22,8 @@ msyncclient_SOURCES = msyncclient.c msyncclient_CFLAGS = $(AM_CFLAGS) msyncclient_LDFLAGS = $(AM_LDFLAGS) msyncclient_LDADD = ../src/libiphone.la + +iphoneenterrecovery_SOURCES = iphoneenterrecovery.c +iphoneenterrecovery_CFLAGS = $(AM_CFLAGS) +iphoneenterrecovery_LDFLAGS = $(AM_LDFLAGS) +iphoneenterrecovery_LDADD = ../src/libiphone.la diff --git a/dev/iphoneenterrecovery.c b/dev/iphoneenterrecovery.c new file mode 100644 index 0000000..2f7891c --- /dev/null +++ b/dev/iphoneenterrecovery.c @@ -0,0 +1,94 @@ +/* + * iphoneenterrecovery.c + * Simple utility to make a device in normal mode enter recovery mode. + * + * Copyright (c) 2009 Martin Szulecki All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include +#include + +#include +#include + +static void print_usage(int argc, char **argv) +{ + char *name = NULL; + + name = strrchr(argv[0], '/'); + printf("Usage: %s [OPTIONS] UUID\n", (name ? name + 1: argv[0])); + printf("Makes a device with the supplied 40-digit UUID enter recovery mode immediately.\n\n"); + printf(" -d, --debug\t\tenable communication debugging\n"); + printf(" -h, --help\t\tprints usage information\n"); + printf("\n"); +} + +int main(int argc, char *argv[]) +{ + lockdownd_client_t client = NULL; + iphone_device_t phone = NULL; + iphone_error_t ret = IPHONE_E_UNKNOWN_ERROR; + int i; + char uuid[41]; + uuid[0] = 0; + + /* parse cmdline args */ + for (i = 1; i < argc; i++) { + if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) { + iphone_set_debug_mask(DBGMASK_ALL); + iphone_set_debug_level(1); + continue; + } + else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) { + print_usage(argc, argv); + return 0; + } + } + + i--; + if (!argv[i] || (strlen(argv[i]) != 40)) { + print_usage(argc, argv); + return 0; + } + strcpy(uuid, argv[i]); + + ret = iphone_get_device_by_uuid(&phone, uuid); + if (ret != IPHONE_E_SUCCESS) { + printf("No device found with uuid %s, is it plugged in?\n", uuid); + return -1; + } + + if (LOCKDOWN_E_SUCCESS != lockdownd_client_new(phone, &client)) { + iphone_device_free(phone); + return -1; + } + + /* run query and output information */ + printf("Telling device with uuid %s to enter recovery mode.}\n", uuid); + if(lockdownd_enter_recovery(client) != LOCKDOWN_E_SUCCESS) + { + printf("Failed to enter recovery mode.\n"); + } + printf("Device is successfully switching to recovery mode.\n"); + + lockdownd_client_free(client); + iphone_device_free(phone); + + return 0; +} -- cgit v1.1-32-gdbae From 84620d89f988b0b763daea1f4ccae66acc062b19 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Tue, 4 Aug 2009 09:11:31 -0700 Subject: Bump version numbers to 0.9.3 and raise libusbmux required version. --- configure.ac | 4 ++-- doxygen.cfg | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 55f5bae..1303e23 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT(libiphone, 0.9.2, nospam@nowhere.com) +AC_INIT(libiphone, 0.9.3, nospam@nowhere.com) AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip]) AC_CONFIG_SRCDIR([src/]) AC_CONFIG_HEADERS([config.h]) @@ -20,7 +20,7 @@ AC_PROG_CC AM_PROG_CC_C_O # Checks for libraries. -PKG_CHECK_MODULES(libusbmuxd, libusbmuxd >= 0.1.0) +PKG_CHECK_MODULES(libusbmuxd, libusbmuxd >= 0.1.3) PKG_CHECK_MODULES(libglib2, glib-2.0 >= 2.14.1) PKG_CHECK_MODULES(libgthread2, gthread-2.0 >= 2.14.1) PKG_CHECK_MODULES(libgnutls, gnutls >= 1.6.3 ) diff --git a/doxygen.cfg b/doxygen.cfg index 0942031..5aff928 100644 --- a/doxygen.cfg +++ b/doxygen.cfg @@ -31,7 +31,7 @@ PROJECT_NAME = libiphone # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 0.9.1 +PROJECT_NUMBER = 0.9.3 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. -- cgit v1.1-32-gdbae