Merge pull request #989 from lrusak/usbmuxd

usbmuxd: initial add-on
This commit is contained in:
Christian Hewitt 2016-12-03 12:23:28 +04:00 committed by GitHub
commit be43c5794f
13 changed files with 351 additions and 4 deletions

View File

@ -0,0 +1,38 @@
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2016 Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
PKG_NAME="libimobiledevice"
PKG_VERSION="1.2.0"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://www.libimobiledevice.org"
PKG_URL="http://www.libimobiledevice.org/downloads/$PKG_NAME-$PKG_VERSION.tar.bz2"
PKG_DEPENDS_TARGET="toolchain libusbmuxd libressl"
PKG_SECTION="libs"
PKG_SHORTDESC="libimobiledevice is a cross-platform software library that talks the protocols to support iPhone®, iPod Touch®, iPad® and Apple TV® devices"
PKG_LONGDESC="libimobiledevice is a cross-platform software library that talks the protocols to support iPhone®, iPod Touch®, iPad® and Apple TV® devices"
PKG_AUTORECONF="yes"
PKG_CONFIGURE_OPTS_TARGET="--enable-static \
--disable-shared \
--without-cython \
--disable-largefile"
post_makeinstall_target() {
cp $ROOT/$PKG_BUILD/common/utils.h $SYSROOT_PREFIX/usr/include/libimobiledevice/
}

View File

@ -0,0 +1,12 @@
diff -u -r libimobiledevice-1.2.0/src/idevice.c libimobiledevice-1.2.0-nossl3/src/idevice.c
--- libimobiledevice-1.2.0/src/idevice.c 2015-01-28 02:10:32.000000000 +0100
+++ libimobiledevice-1.2.0-nossl3/src/idevice.c 2016-03-03 18:33:45.912308242 +0100
@@ -678,7 +678,7 @@
}
BIO_set_fd(ssl_bio, (int)(long)connection->data, BIO_NOCLOSE);
- SSL_CTX *ssl_ctx = SSL_CTX_new(SSLv3_method());
+ SSL_CTX *ssl_ctx = SSL_CTX_new(SSLv23_method());
if (ssl_ctx == NULL) {
debug_info("ERROR: Could not create SSL context.");
BIO_free(ssl_bio);

View File

@ -0,0 +1,34 @@
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2016 Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
PKG_NAME="libusbmuxd"
PKG_VERSION="1.0.10"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://www.libimobiledevice.org"
PKG_URL="http://www.libimobiledevice.org/downloads/$PKG_NAME-$PKG_VERSION.tar.bz2"
PKG_DEPENDS_TARGET="toolchain libplist"
PKG_SECTION="libs"
PKG_SHORTDESC="USB Multiplex Daemon"
PKG_LONGDESC="USB Multiplex Daemon"
PKG_AUTORECONF="no"
PKG_CONFIGURE_OPTS_TARGET="ac_cv_func_malloc_0_nonnull=yes \
ac_cv_func_realloc_0_nonnull=yes \
--enable-static \
--disable-shared"

View File

@ -0,0 +1,2 @@
8.1.100
- initial release

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1,48 @@
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2016 Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
PKG_NAME="usbmuxd"
PKG_VERSION="1.1.0"
PKG_REV="100"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://www.libimobiledevice.org"
PKG_URL="http://www.libimobiledevice.org/downloads/$PKG_NAME-$PKG_VERSION.tar.bz2"
PKG_DEPENDS_TARGET="toolchain libusb libimobiledevice"
PKG_SECTION="service"
PKG_SHORTDESC="USB Multiplex Daemon"
PKG_LONGDESC="USB Multiplex Daemon"
PKG_AUTORECONF="no"
PKG_IS_ADDON="yes"
PKG_ADDON_NAME="iPhone Tether"
PKG_ADDON_TYPE="xbmc.service"
PKG_DISCLAIMER="Additional data charges may occur. The LibreELEC team doesn't take any resposibility for extra data charges."
PKG_CONFIGURE_OPTS_TARGET="ac_cv_func_malloc_0_nonnull=yes \
ac_cv_func_realloc_0_nonnull=yes"
makeinstall_target() {
:
}
addon() {
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/bin
cp -P $PKG_BUILD/.$TARGET_NAME/src/usbmuxd $ADDON_BUILD/$PKG_ADDON_ID/bin/
}

View File

@ -0,0 +1,184 @@
diff -Naur a/src/utils.c b/src/utils.c
--- a/src/utils.c 2014-10-16 04:23:27.000000000 -0700
+++ b/src/utils.c 2015-11-12 14:41:05.656507596 -0800
@@ -156,149 +156,6 @@
#endif
/**
- * Concatenate strings into a newly allocated string
- *
- * @note: Specify NULL for the last string in the varargs list
- *
- * @str: The first string in the list
- * @...: Subsequent strings. Use NULL for the last item.
- *
- * @return a newly allocated string, or NULL if @str is NULL. This will also
- * return NULL and set errno to ENOMEM if memory is exhausted.
- */
-char *string_concat(const char *str, ...)
-{
- size_t len;
- va_list args;
- char *s;
- char *result;
- char *dest;
-
- if (!str)
- return NULL;
-
- /* Compute final length */
-
- len = strlen(str) + 1; /* plus 1 for the null terminator */
-
- va_start(args, str);
- s = va_arg(args, char *);
- while (s) {
- len += strlen(s);
- s = va_arg(args, char*);
- }
- va_end(args);
-
- /* Concat each string */
-
- result = malloc(len);
- if (!result)
- return NULL; /* errno remains set */
-
- dest = result;
-
- dest = stpcpy(dest, str);
-
- va_start(args, str);
- s = va_arg(args, char *);
- while (s) {
- dest = stpcpy(dest, s);
- s = va_arg(args, char *);
- }
- va_end(args);
-
- return result;
-}
-
-void buffer_read_from_filename(const char *filename, char **buffer, uint64_t *length)
-{
- FILE *f;
- uint64_t size;
-
- *length = 0;
-
- f = fopen(filename, "rb");
- if (!f) {
- return;
- }
-
- fseek(f, 0, SEEK_END);
- size = ftell(f);
- rewind(f);
-
- if (size == 0) {
- fclose(f);
- return;
- }
-
- *buffer = (char*)malloc(sizeof(char)*(size+1));
- if (fread(*buffer, sizeof(char), size, f) != size) {
- usbmuxd_log(LL_ERROR, "%s: ERROR: couldn't read %d bytes from %s", __func__, (int)size, filename);
- }
- fclose(f);
-
- *length = size;
-}
-
-void buffer_write_to_filename(const char *filename, const char *buffer, uint64_t length)
-{
- FILE *f;
-
- f = fopen(filename, "wb");
- if (f) {
- fwrite(buffer, sizeof(char), length, f);
- fclose(f);
- }
-}
-
-int plist_read_from_filename(plist_t *plist, const char *filename)
-{
- char *buffer = NULL;
- uint64_t length;
-
- if (!filename)
- return 0;
-
- buffer_read_from_filename(filename, &buffer, &length);
-
- if (!buffer) {
- return 0;
- }
-
- if ((length > 8) && (memcmp(buffer, "bplist00", 8) == 0)) {
- plist_from_bin(buffer, length, plist);
- } else {
- plist_from_xml(buffer, length, plist);
- }
-
- free(buffer);
-
- return 1;
-}
-
-int plist_write_to_filename(plist_t plist, const char *filename, enum plist_format_t format)
-{
- char *buffer = NULL;
- uint32_t length;
-
- if (!plist || !filename)
- return 0;
-
- if (format == PLIST_FORMAT_XML)
- plist_to_xml(plist, &buffer, &length);
- else if (format == PLIST_FORMAT_BINARY)
- plist_to_bin(plist, &buffer, &length);
- else
- return 0;
-
- buffer_write_to_filename(filename, buffer, length);
-
- free(buffer);
-
- return 1;
-}
-
-/**
* Get number of milliseconds since the epoch.
*/
uint64_t mstime64(void)
diff -Naur a/src/utils.h b/src/utils.h
--- a/src/utils.h 2014-10-16 04:29:50.000000000 -0700
+++ b/src/utils.h 2015-11-12 14:40:41.990644890 -0800
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <libimobiledevice/utils.h>
+
#ifndef UTILS_H
#define UTILS_H
@@ -73,18 +75,6 @@
#ifndef HAVE_STPCPY
char *stpcpy(char * s1, const char * s2);
#endif
-char *string_concat(const char *str, ...);
-
-void buffer_read_from_filename(const char *filename, char **buffer, uint64_t *length);
-void buffer_write_to_filename(const char *filename, const char *buffer, uint64_t length);
-
-enum plist_format_t {
- PLIST_FORMAT_XML,
- PLIST_FORMAT_BINARY
-};
-
-int plist_read_from_filename(plist_t *plist, const char *filename);
-int plist_write_to_filename(plist_t plist, const char *filename, enum plist_format_t format);
uint64_t mstime64(void);

View File

@ -0,0 +1,17 @@
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2016 Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################

View File

@ -0,0 +1,12 @@
[Unit]
Description=Socket daemon for the usbmux protocol used by Apple devices
[Service]
Type=simple
ExecStartPre=/sbin/modprobe ipheth
ExecStart=/storage/.kodi/addons/service.usbmuxd/bin/usbmuxd --systemd
PIDFile=/var/run/usbmuxd.pid
[Install]
WantedBy=multi-user.target

View File

@ -1536,7 +1536,7 @@ CONFIG_USB_NET_RNDIS_HOST=m
# CONFIG_USB_NET_KALMIA is not set # CONFIG_USB_NET_KALMIA is not set
# CONFIG_USB_NET_QMI_WWAN is not set # CONFIG_USB_NET_QMI_WWAN is not set
# CONFIG_USB_NET_INT51X1 is not set # CONFIG_USB_NET_INT51X1 is not set
# CONFIG_USB_IPHETH is not set CONFIG_USB_IPHETH=m
# CONFIG_USB_SIERRA_NET is not set # CONFIG_USB_SIERRA_NET is not set
# CONFIG_USB_VL600 is not set # CONFIG_USB_VL600 is not set
CONFIG_WLAN=y CONFIG_WLAN=y

View File

@ -1703,7 +1703,7 @@ CONFIG_USB_NET_RNDIS_HOST=m
# CONFIG_USB_NET_KALMIA is not set # CONFIG_USB_NET_KALMIA is not set
# CONFIG_USB_NET_QMI_WWAN is not set # CONFIG_USB_NET_QMI_WWAN is not set
# CONFIG_USB_NET_INT51X1 is not set # CONFIG_USB_NET_INT51X1 is not set
# CONFIG_USB_IPHETH is not set CONFIG_USB_IPHETH=m
# CONFIG_USB_SIERRA_NET is not set # CONFIG_USB_SIERRA_NET is not set
# CONFIG_USB_VL600 is not set # CONFIG_USB_VL600 is not set
CONFIG_USB_NET_QF9700=y CONFIG_USB_NET_QF9700=y

View File

@ -1531,7 +1531,7 @@ CONFIG_USB_NET_RNDIS_HOST=m
# CONFIG_USB_NET_QMI_WWAN is not set # CONFIG_USB_NET_QMI_WWAN is not set
# CONFIG_USB_HSO is not set # CONFIG_USB_HSO is not set
# CONFIG_USB_NET_INT51X1 is not set # CONFIG_USB_NET_INT51X1 is not set
# CONFIG_USB_IPHETH is not set CONFIG_USB_IPHETH=m
# CONFIG_USB_SIERRA_NET is not set # CONFIG_USB_SIERRA_NET is not set
# CONFIG_USB_VL600 is not set # CONFIG_USB_VL600 is not set
CONFIG_WLAN=y CONFIG_WLAN=y

View File

@ -1523,7 +1523,7 @@ CONFIG_USB_NET_RNDIS_HOST=m
# CONFIG_USB_NET_QMI_WWAN is not set # CONFIG_USB_NET_QMI_WWAN is not set
# CONFIG_USB_HSO is not set # CONFIG_USB_HSO is not set
# CONFIG_USB_NET_INT51X1 is not set # CONFIG_USB_NET_INT51X1 is not set
# CONFIG_USB_IPHETH is not set CONFIG_USB_IPHETH=m
# CONFIG_USB_SIERRA_NET is not set # CONFIG_USB_SIERRA_NET is not set
# CONFIG_USB_VL600 is not set # CONFIG_USB_VL600 is not set
CONFIG_WLAN=y CONFIG_WLAN=y