diff --git a/packages/addons/addon-depends/libimobiledevice/package.mk b/packages/addons/addon-depends/libimobiledevice/package.mk new file mode 100644 index 0000000000..0499d165d5 --- /dev/null +++ b/packages/addons/addon-depends/libimobiledevice/package.mk @@ -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 . +################################################################################ + +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/ +} diff --git a/packages/addons/addon-depends/libimobiledevice/patches/libimobiledevice-0001-disable-sslv3.patch b/packages/addons/addon-depends/libimobiledevice/patches/libimobiledevice-0001-disable-sslv3.patch new file mode 100644 index 0000000000..c267427648 --- /dev/null +++ b/packages/addons/addon-depends/libimobiledevice/patches/libimobiledevice-0001-disable-sslv3.patch @@ -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); diff --git a/packages/addons/addon-depends/libusbmuxd/package.mk b/packages/addons/addon-depends/libusbmuxd/package.mk new file mode 100644 index 0000000000..375ef92349 --- /dev/null +++ b/packages/addons/addon-depends/libusbmuxd/package.mk @@ -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 . +################################################################################ + +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" diff --git a/packages/addons/service/usbmuxd/changelog.txt b/packages/addons/service/usbmuxd/changelog.txt new file mode 100644 index 0000000000..747949c2d5 --- /dev/null +++ b/packages/addons/service/usbmuxd/changelog.txt @@ -0,0 +1,2 @@ +8.1.100 +- initial release diff --git a/packages/addons/service/usbmuxd/icon/icon.png b/packages/addons/service/usbmuxd/icon/icon.png new file mode 100644 index 0000000000..9e57dfd852 Binary files /dev/null and b/packages/addons/service/usbmuxd/icon/icon.png differ diff --git a/packages/addons/service/usbmuxd/package.mk b/packages/addons/service/usbmuxd/package.mk new file mode 100644 index 0000000000..092b575d0a --- /dev/null +++ b/packages/addons/service/usbmuxd/package.mk @@ -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 . +################################################################################ + +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/ +} diff --git a/packages/addons/service/usbmuxd/patches/usbmuxd-0001-remove-duplicate-functions.patch b/packages/addons/service/usbmuxd/patches/usbmuxd-0001-remove-duplicate-functions.patch new file mode 100644 index 0000000000..b9bd887cc4 --- /dev/null +++ b/packages/addons/service/usbmuxd/patches/usbmuxd-0001-remove-duplicate-functions.patch @@ -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 ++ + #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); + diff --git a/packages/addons/service/usbmuxd/source/default.py b/packages/addons/service/usbmuxd/source/default.py new file mode 100644 index 0000000000..1a91d91ede --- /dev/null +++ b/packages/addons/service/usbmuxd/source/default.py @@ -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 . +################################################################################ diff --git a/packages/addons/service/usbmuxd/source/system.d/service.usbmuxd.service b/packages/addons/service/usbmuxd/source/system.d/service.usbmuxd.service new file mode 100644 index 0000000000..ae86307ebe --- /dev/null +++ b/packages/addons/service/usbmuxd/source/system.d/service.usbmuxd.service @@ -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 + diff --git a/projects/Odroid_C2/linux/linux.aarch64.conf b/projects/Odroid_C2/linux/linux.aarch64.conf index 9200b30a70..0f117e0cd0 100644 --- a/projects/Odroid_C2/linux/linux.aarch64.conf +++ b/projects/Odroid_C2/linux/linux.aarch64.conf @@ -1536,7 +1536,7 @@ CONFIG_USB_NET_RNDIS_HOST=m # CONFIG_USB_NET_KALMIA is not set # CONFIG_USB_NET_QMI_WWAN 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_VL600 is not set CONFIG_WLAN=y diff --git a/projects/WeTek_Core/linux/linux.arm.conf b/projects/WeTek_Core/linux/linux.arm.conf index 3334c0e11e..a0286406f6 100644 --- a/projects/WeTek_Core/linux/linux.arm.conf +++ b/projects/WeTek_Core/linux/linux.arm.conf @@ -1703,7 +1703,7 @@ CONFIG_USB_NET_RNDIS_HOST=m # CONFIG_USB_NET_KALMIA is not set # CONFIG_USB_NET_QMI_WWAN 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_VL600 is not set CONFIG_USB_NET_QF9700=y diff --git a/projects/WeTek_Hub/linux/linux.aarch64.conf b/projects/WeTek_Hub/linux/linux.aarch64.conf index 2fcdbb437f..7c4687189c 100644 --- a/projects/WeTek_Hub/linux/linux.aarch64.conf +++ b/projects/WeTek_Hub/linux/linux.aarch64.conf @@ -1531,7 +1531,7 @@ CONFIG_USB_NET_RNDIS_HOST=m # CONFIG_USB_NET_QMI_WWAN is not set # CONFIG_USB_HSO 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_VL600 is not set CONFIG_WLAN=y diff --git a/projects/WeTek_Play_2/linux/linux.aarch64.conf b/projects/WeTek_Play_2/linux/linux.aarch64.conf index 0a9f4bb3e2..dfb3261372 100644 --- a/projects/WeTek_Play_2/linux/linux.aarch64.conf +++ b/projects/WeTek_Play_2/linux/linux.aarch64.conf @@ -1523,7 +1523,7 @@ CONFIG_USB_NET_RNDIS_HOST=m # CONFIG_USB_NET_QMI_WWAN is not set # CONFIG_USB_HSO 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_VL600 is not set CONFIG_WLAN=y