Saturday, January 16, 2016

How to build libimobiledevice from source in Linux (kali)

In this post and this post, I was able to restore an iphone 5 and iphone 4s using idevicerestore which uses the libimobiledevice library. Below is the procedure on how I build libimobiledevice from source.

My OS:

Linux sil3ntBox 4.0.0-kali1-686-pae #1 SMP Debian 4.0.4-1+kali2 (2015-06-03) i686 GNU/Linux


This is after I fresh-install the xfce version of kali linux.

A libimobiledevice library is already installed by default. It is called
as libimobiledevice4 when you do apt-cache search. This is the reason
why when I connect the iPhone, it is detected by the OS.

But the important thing is to use the utilities based on libimobiledevice
to communicate with the iPhone. The utilities such as ideviceinfo, idevice_id,
etc. To be able have the utilites, you have to download the source of
libimobiledevice. Using apt-get you can download the source of the library.

        apt-get source libimobiledevice

notice that I only use libimobiledevice rather than libimobiledevice4. They are
the same since according to apt-cache show libimobiledevice4:

        Package: libimobiledevice4
        Source: libimobiledevice

After downloading the source, extract them on the current folder or any folder
you want.


Inside the  extracted directory I run:

        ./configure


  eventhough according to the README file included

        to compile run:

           ./autogen.sh
           make
           make install

  since there is no autogen.sh file inside the folder.


This is where I encounter my first error.

Silly me. :)

According to the README

  ---------------------------------------------------
        Requirements
        ============

        Development Packages of:
                libgnutls or openssl
                libplist
                libusbmuxd

        Software:
                usbmuxd
                make
                autoheader
                automake
                autoconf
                libtool
                pkg-config
                gcc

        Optional:
                cython (Python bindings)
                doxygen (Documentation)
   -----------------------------------------------------

So I downloaded all the packages stated above.

This are the errors in sequence as I do ./configure after every package I
installed just to see what is going on..

    --------------------------------------------------------------------------------
        ERROR                                   |       SOLVED BY:
    --------------------------------------------------------------------------------
                                                |
    configure: error: The pkg-config script.... | apt-get install pkg-config

    No package 'libusbmuxd' found               | apt-get install libusbmuxd-dev

    No package 'libplist' found                 | apt-get install libplist-dev

    No package 'libplist++' found               | apt-get install libplist++-dev

    Error:                                      |
       You probably have to install the         |
       development version of the python        |
       package....                              | apt-get install cython

   ..cannot find libplist Cython bindings..     |
   configure: error: OpenSSL support            | apt-get install libssl-dev


After the last installation, ./configure continues without any error.

Then sudo make, sudo make install, to complete the installation.

----------------------

The above is copy-pasted from my notes as I do the installation. Sorry for being lazy.. :) ..










No comments:

Post a Comment