From 684aed8d1177d449af12aed7131dd9eb424c5385 Mon Sep 17 00:00:00 2001 From: febrezo Date: Thu, 22 Jul 2021 17:43:32 +0200 Subject: [PATCH] Add compilation of libimobiledevice for iOS compatibility Added considering the feedback reported in the #16 discussion. --- Dockerfile | 42 ++++++++++++++++++++++++++++++++++++++---- README.md | 2 +- 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index b49239f..d7278a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,49 @@ FROM ubuntu:20.04 +# Ref. https://github.com/mvt-project/mvt + # Fixing major OS dependencies # ---------------------------- -RUN apt update \ - && apt install -y python3 python3-pip libusb-1.0-0 \ +RUN apt update \ + && apt install -y python3 python3-pip libusb-1.0-0-dev \ && apt install -y wget \ && apt install -y adb \ - && DEBIAN_FRONTEND=noninteractive apt-get -y install default-jre-headless \ - && apt-get clean \ + && DEBIAN_FRONTEND=noninteractive apt-get -y install default-jre-headless + +# Install build tools for libimobiledevice +# ---------------------------------------- +RUN apt install -y build-essential \ + checkinstall \ + git \ + autoconf \ + automake \ + libtool-bin \ + libplist-dev \ + libusbmuxd-dev \ + libssl-dev \ + pkg-config + +# Clean up +# -------- +RUN apt-get clean \ && rm -rf /var/lib/apt/lists/* + +# Build libimobiledevice +# ---------------------- +RUN git clone https://github.com/libimobiledevice/libplist +RUN git clone https://github.com/libimobiledevice/libusbmuxd +RUN git clone https://github.com/libimobiledevice/libimobiledevice +RUN git clone https://github.com/libimobiledevice/usbmuxd + +RUN cd libplist && ./autogen.sh && make && make install && ldconfig + +RUN cd libusbmuxd && PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./autogen.sh && make && make install && ldconfig + +RUN cd libimobiledevice && PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./autogen.sh --enable-debug && make && make install && ldconfig + +RUN cd usbmuxd && PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var --runstatedir=/run && make && make install + # Installing MVT # -------------- RUN pip3 install mvt diff --git a/README.md b/README.md index cf3145a..a93aa0f 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ This can be done using the `--privileged` parameter when launching Docker as fol docker run -it --privileged -v /dev/bus/usb:/dev/bus/usb mvt ``` -Note that using the `--pivileged` parameter is insecure for a number of reasons explained in detail [here](https://blog.trailofbits.com/2019/07/19/understanding-docker-container-escapes/) as it gives access to the whole system. +Note that using the `--privileged` parameter is insecure for a number of reasons explained in detail [here](https://blog.trailofbits.com/2019/07/19/understanding-docker-container-escapes/) as it gives access to the whole system. As a brief explanation, the `-v :` syntax maps the host path to the dockerized path to allow the connection. Modern versions of Docker have a `--device` option where you can specify the exact USB to mount without the `--privileged` option: