Git Product home page Git Product logo

libirecovery's Introduction

libimobiledevice

A library to communicate with services on iOS devices using native protocols.

Features

libimobiledevice is a cross-platform software library that talks the protocols to interact with iOS devices.

Unlike other projects, it does not depend on using any existing proprietary libraries and does not require jailbreaking.

Some key features are:

  • Interface: Implements many high-level interfaces for device services
  • Implementation: Object oriented architecture and service abstraction layer
  • Cross-Platform: Tested on Linux, macOS, Windows and Android platforms
  • Utilities: Provides various command-line utilities for device services
  • SSL: Allows choosing between OpenSSL, GnuTLS, or MbedTLS to handle SSL communication
  • Network: Supports network connections with "WiFi sync" enabled devices
  • Python: Provides Cython based bindings for Python

The implemented interfaces of many device service protocols allow applications to:

  • Access filesystem of a device
  • Access documents of file sharing apps
  • Retrieve information about a device and modify various settings
  • Backup and restore the device in a native way compatible with iTunes
  • Manage app icons arrangement on the device
  • Install, remove, list and basically manage apps
  • Activate a device using official servers
  • Manage contacts, calendars, notes and bookmarks
  • Retrieve and remove crashreports
  • Retrieve various diagnostics information
  • Establish a debug connection for app debugging
  • Mount filesystem images
  • Forward device notifications
  • Manage device provisioning
  • Take screenshots from the device screen (requires mounted developer image)
  • Simulate changed geolocation of the device (requires mounted developer image)
  • Relay the syslog of the device
  • Expose a connection for WebKit remote debugging

... and much more.

The library is in development since August 2007 with the goal to bring support for these devices to the Linux Desktop.

Installation / Getting started

Debian / Ubuntu Linux

First install all required dependencies and build tools:

sudo apt-get install \
	build-essential \
	pkg-config \
	checkinstall \
	git \
	autoconf \
	automake \
	libtool-bin \
	libplist-dev \
	libusbmuxd-dev \
	libimobiledevice-glue-dev \
	libtatsu-dev \
	libssl-dev \
	usbmuxd

NOTE: libtatsu (and thus libtatsu-dev) is a new library that was just published recently, you have to build it from source.

If you want to optionally build the documentation or Python bindings use:

sudo apt-get install \
	doxygen \
	cython

Then clone the actual project repository:

git clone https://github.com/libimobiledevice/libimobiledevice.git
cd libimobiledevice

Now you can build and install it:

./autogen.sh
make
sudo make install

If you require a custom prefix or other option being passed to ./configure you can pass them directly to ./autogen.sh like this:

./autogen.sh --prefix=/opt/local --enable-debug
make
sudo make install

By default, OpenSSL will be used as TLS/SSL library. If you prefer GnuTLS, configure with --with-gnutls like this:

./autogen.sh --with-gnutls

MbedTLS is also supported and can be enabled by passing --with-mbedtls to configure. If mbedTLS is not installed in a default location, you need to set the environment variables mbedtls_INCLUDES to the path that contains the MbedTLS headers and mbedtls_LIBDIR to set the library path. Optionally, mbedtls_LIBS can be used to set the library names directly. Example:

./autogen.sh --with-mbedtls mbedtls_INCLUDES=/opt/local/include mbedtls_LIBDIR=/opt/local/lib

Usage

Documentation about using the library in your application is not available yet. The "hacker way" for now is to look at the implementation of the included utilities.

Utilities

The library bundles the following command-line utilities in the tools directory:

Utility Description
idevice_id List attached devices or print device name of given device
idevicebackup Create or restore backup for devices (legacy)
idevicebackup2 Create or restore backups for devices running iOS 4 or later
idevicebtlogger Capture Bluetooth HCI traffic from a device (requires log profile)
idevicecrashreport Retrieve crash reports from a device
idevicedate Display the current date or set it on a device
idevicedebug Interact with the debugserver service of a device
idevicedebugserverproxy Proxy a debugserver connection from a device for remote debugging
idevicediagnostics Interact with the diagnostics interface of a device
ideviceenterrecovery Make a device enter recovery mode
ideviceimagemounter Mount disk images on the device
ideviceinfo Show information about a connected device
idevicename Display or set the device name
idevicenotificationproxy Post or observe notifications on a device
idevicepair Manage host pairings with devices and usbmuxd
ideviceprovision Manage provisioning profiles on a device
idevicescreenshot Gets a screenshot from the connected device
idevicesetlocation Simulate location on device
idevicesyslog Relay syslog of a connected device
afcclient Interact with device filesystem via AFC/HouseArrest

Please consult the usage information or manual pages of each utility for a documentation of available command line options and usage examples like this:

ideviceinfo --help
man ideviceinfo

Contributing

We welcome contributions from anyone and are grateful for every pull request!

If you'd like to contribute, please fork the master branch, change, commit and send a pull request for review. Once approved it can be merged into the main code base.

If you plan to contribute larger changes or a major refactoring, please create a ticket first to discuss the idea upfront to ensure less effort for everyone.

Please make sure your contribution adheres to:

  • Try to follow the code style of the project
  • Commit messages should describe the change well without being too short
  • Try to split larger changes into individual commits of a common domain
  • Use your real name and a valid email address for your commits

We are still working on the guidelines so bear with us!

Links

License

This library and utilities are licensed under the GNU Lesser General Public License v2.1, also included in the repository in the COPYING file.

Credits

Apple, iPhone, iPad, iPod, iPod Touch, Apple TV, Apple Watch, Mac, iOS, iPadOS, tvOS, watchOS, and macOS are trademarks of Apple Inc.

This project is an independent software and has not been authorized, sponsored, or otherwise approved by Apple Inc.

README Updated on: 2024-06-27

libirecovery's People

Contributors

aburgh avatar cfergeau avatar crystall1nedev avatar danthemann15 avatar danyl avatar funkym avatar jaywalker avatar linushenze avatar mexmer avatar neheb avatar nhaunold avatar nikias avatar posixninja avatar rickmark avatar s0uthwest avatar skortela avatar tihmstar avatar westbaer avatar zhuowei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libirecovery's Issues

can't read /usr/lib/x86_64-linux-gnu/libudev.la

makefile assumes, incorrectly, that libudev.la exists.
This ultimately breaks compilation of idevicerestore

ubuntu 14.04.4 LTS

make all-recursive
make[1]: Entering directory /usr/local/src/libirecovery' Making all in src make[2]: Entering directory /usr/local/src/libirecovery/src'
CC libirecovery_la-libirecovery.lo
CCLD libirecovery.la
/bin/sed: can't read /usr/lib/x86_64-linux-gnu/libudev.la: No such file or directory
libtool: link: /usr/lib/x86_64-linux-gnu/libudev.la' is not a valid libtool archive make[2]: *** [libirecovery.la] Error 1 make[2]: Leaving directory /usr/local/src/libirecovery/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/libirecovery'
make: *** [all] Error 2

ii libudev1:amd64 204-5ubuntu2 amd64 libudev shared library
ii libudev1:i386 204-5ubuntu2 i386 libudev shared library
ii libudev-dev 204-5ubuntu2 amd64 libudev development files

dpkg --listfiles libudev1/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/libudev1
/usr/share/doc/libudev1/changelog.Debian.gz
/usr/share/doc/libudev1/copyright
/lib
/lib/x86_64-linux-gnu
/lib/x86_64-linux-gnu/libudev.so.1.3.5
/lib/x86_64-linux-gnu/libudev.so.1

dpkg --listfiles libudev-dev
/.
/usr
/usr/include
/usr/include/libudev.h
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/pkgconfig
/usr/lib/x86_64-linux-gnu/pkgconfig/libudev.pc
/usr/share
/usr/share/gtk-doc
/usr/share/gtk-doc/html
/usr/share/gtk-doc/html/libudev
/usr/share/gtk-doc/html/libudev/libudev-udev-list.html
/usr/share/gtk-doc/html/libudev/up-insensitive.png
/usr/share/gtk-doc/html/libudev/ch01.html
/usr/share/gtk-doc/html/libudev/api-index-full.html
/usr/share/gtk-doc/html/libudev/style.css
/usr/share/gtk-doc/html/libudev/index.html
/usr/share/gtk-doc/html/libudev/home.png
/usr/share/gtk-doc/html/libudev/left.png
/usr/share/gtk-doc/html/libudev/libudev-udev-hwdb.html
/usr/share/gtk-doc/html/libudev/libudev-udev-enumerate.html
/usr/share/gtk-doc/html/libudev/index.sgml
/usr/share/gtk-doc/html/libudev/left-insensitive.png
/usr/share/gtk-doc/html/libudev/right-insensitive.png
/usr/share/gtk-doc/html/libudev/up.png
/usr/share/gtk-doc/html/libudev/libudev-udev-monitor.html
/usr/share/gtk-doc/html/libudev/libudev.devhelp2
/usr/share/gtk-doc/html/libudev/libudev-udev-device.html
/usr/share/gtk-doc/html/libudev/right.png
/usr/share/gtk-doc/html/libudev/libudev-udev-util.html
/usr/share/gtk-doc/html/libudev/libudev-udev-queue.html
/usr/share/gtk-doc/html/libudev/libudev-udev.html
/usr/share/doc
/usr/share/doc/libudev-dev
/usr/share/doc/libudev-dev/copyright
/usr/lib/x86_64-linux-gnu/libudev.so
/usr/share/doc/libudev-dev/changelog.Debian.gz

Problem during make

Hi all
I'm trying to compile libirecovery on my arch linux but I didn't succeed on make phase. Is there anyone who can help about the error i got? Thank you.
Screenshot_2020-02-05_22-52-39

Macos 10.15.4 PKG_CHECK_MODULES error during ./autogen.sh (and potensial fix)

Hi,

I tried compiling libirecovery today and ran into a error with PKG_CHECK_MODULES

checking for PTHREAD_PRIO_INHERIT... yes
./configure: line 17646: syntax error near unexpected token `libusb,'
./configure: line 17646: `			PKG_CHECK_MODULES(libusb, libusb-1.0 >= $LIBUSB_VERSION)'

Is this not the wrong syntax for PKG_CHECK_MODULES? CMake

My fix was to remove the comma from PKG_CHECK_MODULES in configure
PKG_CHECK_MODULES(libusb libusb-1.0 >= $LIBUSB_VERSION)

Cygwin build issues; patch included

diff -nr libirecovery.orig/configure.ac libirecovery/configure.ac
d73 3
a75 2
		CFLAGS+=" -I/usr/include/libusb-1.0"
		GLOBAL_LDFLAGS+=" -static-libgcc -lkernel32 -lsetupapi"
diff -nr libirecovery.orig/src/libirecovery.c libirecovery/src/libirecovery.c
a62 2
#include <windows.h>
#include <setupapi.h>

irecovery broken on Ubuntu 16.04

Hi,
It seems irecovery is broken on Ubuntu 16.04, I tested the shell and exit from recovery, it didn't work.
Tested on iOS 9 and 10b1
Here is the output. Maybe it's a libusb issue ?

$ sudo irecovery -s -v
Attempting to connect...
opening device 05ac:1281...
irecv_copy_nonce_with_tag: WARNING: couldn't find tag SNON in string  NONC:3BB31                                                                                                                                                             DC8A588E874EBBC7D9A7E0D587E48D9FDE1
Setting to configuration 1
Setting to interface 0:0
Attempting to connect...
opening device 05ac:1281...
irecv_copy_nonce_with_tag: WARNING: couldn't find tag SNON in string  NONC:3BB31                                                                                                                                                             DC8A588E874EBBC7D9A7E0D587E48D9FDE1
Setting to configuration 1
Setting to interface 0:0
Attempting to connect...
opening device 05ac:1281...
irecv_copy_nonce_with_tag: WARNING: couldn't find tag SNON in string  NONC:3BB31                                                                                                                                                             DC8A588E874EBBC7D9A7E0D587E48D9FDE1
Setting to configuration 1
Setting to interface 0:0
Attempting to connect...
opening device 05ac:1281...
irecv_copy_nonce_with_tag: WARNING: couldn't find tag SNON in string  NONC:3BB31                                                                                                                                                             DC8A588E874EBBC7D9A7E0D587E48D9FDE1
Setting to configuration 1
Setting to interface 0:0
Attempting to connect...
opening device 05ac:1281...
irecv_copy_nonce_with_tag: WARNING: couldn't find tag SNON in string  NONC:3BB31DC8A588E874EBBC7D9A7E0D587E48D9FDE1
Setting to configuration 1
Setting to interface 0:0
Attempting to connect...
opening device 05ac:1281...
irecv_copy_nonce_with_tag: WARNING: couldn't find tag SNON in string  NONC:3BB31DC8A588E874EBBC7D9A7E0D587E48D9FDE1
Setting to configuration 1
Setting to interface 0:0

thread.h: No such file or directory after latest commits

Arch
gcc 9.1.0-2

libtoolize: putting auxiliary files in '.'.
libtoolize: linking file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: linking file 'm4/libtool.m4'
libtoolize: linking file 'm4/ltoptions.m4'
libtoolize: linking file 'm4/ltsugar.m4'
libtoolize: linking file 'm4/ltversion.m4'
libtoolize: linking file 'm4/lt~obsolete.m4'
configure.ac:26: installing './compile'
configure.ac:29: installing './config.guess'
configure.ac:29: installing './config.sub'
configure.ac:6: installing './install-sh'
configure.ac:6: installing './missing'
src/Makefile.am: installing './depcomp'
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for ANSI C header files... (cached) yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for ssize_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint8_t... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for strdup... yes
checking for strerror... yes
checking for strndup... yes
checking readline/readline.h usability... yes
checking readline/readline.h presence... yes
checking for readline/readline.h... yes
checking for platform-specific build settings... linux-gnu
checking whether gcc is Clang... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking whether more special flags are required for pthreads... no
checking for PTHREAD_PRIO_INHERIT... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for libusb... yes
checking for supported compiler flags...  -Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -fvisibility=hidden -pthread
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for native large file support... yes
checking for _LARGEFILE_SOURCE value needed for large files... no
checking whether make supports nested variables... (cached) yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating include/Makefile
config.status: creating tools/Makefile
config.status: creating libirecovery.pc
config.status: creating udev/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands

Configuration for libirecovery 0.2.0:
-------------------------------------------

  Install prefix: .........: /usr
  USB backend: ............: libusb 1.0.23

  Now type 'make' to build libirecovery 0.2.0,
  and then 'make install' for installation.

make  all-recursive
make[1]: Entering directory '/home/parker/.cache/yay/libirecovery-git/src/libirecovery'
Making all in src
make[2]: Entering directory '/home/parker/.cache/yay/libirecovery-git/src/libirecovery/src'
make[2]: *** No rule to make target 'utils.c', needed by 'libirecovery_la-utils.lo'.  Stop.
make[2]: *** Waiting for unfinished jobs....
  CC       libirecovery_la-libirecovery.lo
libirecovery.c:74:10: fatal error: thread.h: No such file or directory
   74 | #include "thread.h"
      |          ^~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:475: libirecovery_la-libirecovery.lo] Error 1
make[2]: Leaving directory '/home/parker/.cache/yay/libirecovery-git/src/libirecovery/src'
make[1]: *** [Makefile:471: all-recursive] Error 1
make[1]: Leaving directory '/home/parker/.cache/yay/libirecovery-git/src/libirecovery'
make: *** [Makefile:380: all] Error 2

Restoring iPhone 5c (dfu mode)

If you start in DFU mode, after the iBEC is uploaded an attempt is made to put the device into restore mode, which fails because line 439 says "break;" if the device isn't switched to dfu mode in 500 milliseconds. This stems from a problem in /libirecovery-master/src/irecovery.c

Go to line number 429 change

break;

to

return 0;

and recompile....this fixes all the issues like if you start out in dfu mode and it needs to go to restore mode after uploading the iBEC and it will just tell you it can't go into restore mode. This fix works on all devices. Your code was breaking from the For, Loop after one attempt. Now it will return 0 when it succeeds and continue the loop when it doesn't.

Fails to connect on Fedora 19 when phone not in recovery mode.

sudo irecovery -? fails to connect to phone or return any information if phone is not in recovery mode on Fedora 19. It does reset a phone in recovery mode but in normal or dfu mode without a sim card it fails to connect. After an exhaustive search dfu mode to upgrade is only active when a sim card is installed, In this case the application should inform the user that a sim card is not present and not try to connect.

failed to build libirecovery on mingw-x64

file configure.ac

checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking readline/readline.h usability... yes
checking readline/readline.h presence... yes
checking for readline/readline.h... yes
./configure: line 16067: syntax error near unexpected token `fi'
./configure: line 16067: `fi'

created 'configure' file after launching bash autogen.sh

# Check whether --with-iokit was given.
if test "${with_iokit+set}" = set; then :
  withval=$with_iokit;
else
  with_iokit=yes
fi


else


fi








if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
	if test -n "$ac_tool_prefix"; then
  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.

-n false positive; stays in DFU mode

Model: iPhone 5s

root@kali:~# lsusb | grep Apple
Bus 004 Device 005: ID 05ac:1227 Apple, Inc. Mobile Device (DFU Mode)
root@kali:~# irecovery -vv -r
Attempting to connect... 
opening device 05ac:1227...
Setting to configuration 1
Setting to interface 0:0
Connected to iPhone6,1, model n51ap, cpid 0x8960, bdid 0x00
root@kali:~# irecovery -vv -m
Attempting to connect... 
opening device 05ac:1227...
Setting to configuration 1
Setting to interface 0:0
Connected to iPhone6,1, model n51ap, cpid 0x8960, bdid 0x00
DFU Mode
root@kali:~# irecovery -vv -n
Attempting to connect... 
opening device 05ac:1227...
Setting to configuration 1
Setting to interface 0:0
Connected to iPhone6,1, model n51ap, cpid 0x8960, bdid 0x00
Command completed successfully
root@kali:~# irecovery -vv -m
Attempting to connect... 
opening device 05ac:1227...
Setting to configuration 1
Setting to interface 0:0
Connected to iPhone6,1, model n51ap, cpid 0x8960, bdid 0x00
DFU Mode
root@kali:~# 

Side note: Is it possible to reflash & keep data intact?

Trying to build on msys2

getting error on make while building on msys2

config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating include/Makefile
config.status: creating tools/Makefile
config.status: creating libirecovery.pc
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands

Configuration for libirecovery 0.2.0:
-------------------------------------------

  Install prefix: .........: /usr
  USB backend: ............: libusb 1.0.21

  Now type 'make' to build libirecovery 0.2.0,
  and then 'make install' for installation.
# make
make  all-recursive
make[1]: Entering directory '/home/rpayne/github/libirecovery-master'
Making all in src
make[2]: Entering directory '/home/rpayne/github/libirecovery-master/src'
  CC       libirecovery_la-libirecovery.lo
libirecovery.c: In function ‘mobiledevice_connect’:
libirecovery.c:505:2: error: unknown type name ‘SP_DEVICE_INTERFACE_DATA’
  SP_DEVICE_INTERFACE_DATA currentInterface;
  ^~~~~~~~~~~~~~~~~~~~~~~~
libirecovery.c:506:2: error: unknown type name ‘HDEVINFO’
  HDEVINFO usbDevices;
  ^~~~~~~~
libirecovery.c:512:15: warning: implicit declaration of function ‘SetupDiGetClassDevs’ [-Wimplicit-function-declaration]
  usbDevices = SetupDiGetClassDevs(&GUID_DEVINTERFACE_DFU, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
               ^~~~~~~~~~~~~~~~~~~
libirecovery.c:512:71: error: ‘DIGCF_PRESENT’ undeclared (first use in this function)
  usbDevices = SetupDiGetClassDevs(&GUID_DEVINTERFACE_DFU, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
                                                                       ^~~~~~~~~~~~~
libirecovery.c:512:71: note: each undeclared identifier is reported only once for each function it appears in
libirecovery.c:512:87: error: ‘DIGCF_DEVICEINTERFACE’ undeclared (first use in this function)
  usbDevices = SetupDiGetClassDevs(&GUID_DEVINTERFACE_DFU, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
                                                                                       ^~~~~~~~~~~~~~~~~~~~~
libirecovery.c:513:41: error: ‘SP_DEVICE_INTERFACE_DATA’ undeclared (first use in this function)
  memset(&currentInterface, '\0', sizeof(SP_DEVICE_INTERFACE_DATA));
                                         ^~~~~~~~~~~~~~~~~~~~~~~~
libirecovery.c:514:18: error: request for member ‘cbSize’ in something not a structure or union
  currentInterface.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
                  ^
libirecovery.c:515:27: warning: implicit declaration of function ‘SetupDiEnumDeviceInterfaces’ [-Wimplicit-function-declaratio ]
  for(i = 0; usbDevices && SetupDiEnumDeviceInterfaces(usbDevices, NULL, &GUID_DEVINTERFACE_DFU, i, &currentInterface); i++) {
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
libirecovery.c:522:3: error: unknown type name ‘PSP_DEVICE_INTERFACE_DETAIL_DATA’
   PSP_DEVICE_INTERFACE_DETAIL_DATA details;
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libirecovery.c:523:3: warning: implicit declaration of function ‘SetupDiGetDeviceInterfaceDetail’ [-Wimplicit-function-declaration]
   SetupDiGetDeviceInterfaceDetail(usbDevices, &currentInterface, NULL, 0, &requiredSize, NULL);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libirecovery.c:524:14: error: ‘PSP_DEVICE_INTERFACE_DETAIL_DATA’ undeclared (first use in this function)
   details = (PSP_DEVICE_INTERFACE_DETAIL_DATA) malloc(requiredSize);
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libirecovery.c:524:48: error: expected ‘;’ before ‘malloc’
   details = (PSP_DEVICE_INTERFACE_DETAIL_DATA) malloc(requiredSize);
                                                ^~~~~~
libirecovery.c:525:10: error: invalid type argument of ‘->’ (have ‘int’)
   details->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA);
          ^~
libirecovery.c:525:28: error: ‘SP_DEVICE_INTERFACE_DETAIL_DATA’ undeclared (first use in this function)
   details->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA);
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libirecovery.c:527:9: warning: passing argument 1 of ‘free’ makes pointer from integer without a cast [-Wint-conversion]
    free(details);
         ^~~~~~~
In file included from /usr/include/stdio.h:29:0,
                 from libirecovery.c:25:
/usr/include/stdlib.h:93:7: note: expected ‘void *’ but argument is of type ‘int’
 _VOID _EXFUN_NOTHROW(free,(_PTR));
       ^
libirecovery.c:531:34: error: invalid type argument of ‘->’ (have ‘int’)
    memcpy((void*) result, details->DevicePath, requiredSize - sizeof(DWORD));
                                  ^~
libirecovery.c:532:9: warning: passing argument 1 of ‘free’ makes pointer from integer without a cast [-Wint-conversion]
    free(details);
         ^~~~~~~
In file included from /usr/include/stdio.h:29:0,
                 from libirecovery.c:25:
/usr/include/stdlib.h:93:7: note: expected ‘void *’ but argument is of type ‘int’
 _VOID _EXFUN_NOTHROW(free,(_PTR));
       ^
libirecovery.c:591:2: warning: implicit declaration of function ‘SetupDiDestroyDeviceInfoList’ [-Wimplicit-function-declaratio ]
  SetupDiDestroyDeviceInfoList(usbDevices);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
libirecovery.c:601:18: error: request for member ‘cbSize’ in something not a structure or union
  currentInterface.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
                  ^
libirecovery.c:609:36: error: expected ‘;’ before ‘details’
   PSP_DEVICE_INTERFACE_DETAIL_DATA details;
                                    ^~~~~~~
libirecovery.c:611:3: error: ‘details’ undeclared (first use in this function)
   details = (PSP_DEVICE_INTERFACE_DETAIL_DATA) malloc(requiredSize);
   ^~~~~~~
libirecovery.c:611:48: error: expected ‘;’ before ‘malloc’
   details = (PSP_DEVICE_INTERFACE_DETAIL_DATA) malloc(requiredSize);
                                                ^~~~~~
make[2]: *** [Makefile:455: libirecovery_la-libirecovery.lo] Error 1
make[2]: Leaving directory '/home/rpayne/github/libirecovery-master/src'
make[1]: *** [Makefile:466: all-recursive] Error 1
make[1]: Leaving directory '/home/rpayne/github/libirecovery-master'
make: *** [Makefile:375: all] Error 2

Mac OS X Mojave doesn't work with iPhone3,1 in DFU Mode

With LibUSB and irecovery -v -m I get

Attempting to connect...
opening device 05ac:1227...
irecv_copy_nonce_with_tag: WARNING: couldn't find tag NONC in string Apple Inc.
irecv_copy_nonce_with_tag: WARNING: couldn't find tag SNON in string Apple Inc.
Setting to configuration 1
Setting to interface 0:0
ERROR: Unable to set device interface

And it errors out.

If I build with IOKit instead of LibUSB I only get

Attempting to connect...
ERROR: Unknown error

Issue with ./autogen.sh and subsequently make

Currently, on OS X, ./autogen ends with an error after trying to create the Makefile

config.status: error: cannot find input file: src/Makefile.in'`

It appears that a makefile gets created anyway.
When trying to make, the current output is

cd . && /bin/sh ./config.status config.h
config.status: creating config.h
/Library/Developer/CommandLineTools/usr/bin/make  all-recursive
Making all in src
make[2]: *** No rule to make target `all'.  Stop.
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Make install fails similarly

Making install in src
make[1]: *** No rule to make target `install'.  Stop.
make: *** [install-recursive] Error 1

problem when run make with fedora v 21

when i run ./aurogen.sh is work perfect without error but when i run make he don't make anything
help me please
[root@localhost libirecovery]# ./autogen.sh
libtoolize: putting auxiliary files in .'. libtoolize: linking file./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, m4'. libtoolize: linking filem4/libtool.m4'
libtoolize: linking file m4/ltoptions.m4' libtoolize: linking filem4/ltsugar.m4'
libtoolize: linking file m4/ltversion.m4' libtoolize: linking filem4/lt~obsolete.m4'
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @file support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for libusb... yes
checking for ANSI C header files... (cached) yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for ssize_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint8_t... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for strcasecmp... yes
checking for strdup... yes
checking for strerror... yes
checking for strndup... yes
checking whether to enable WIN32 build settings... no
checking for supported compiler flags... -Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -fvisibility=hidden
checking whether make supports nested variables... (cached) yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating include/Makefile
config.status: creating tools/Makefile
config.status: creating libirecovery.pc
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands

Configuration for libirecovery 0.2.0:

Install prefix: .........: /usr/local

Now type 'make' to build libirecovery 0.2.0,
and then 'make install' for installation.

[root@localhost libirecovery]# make
make all-recursive
make[1]: Entering directory '/root/Téléchargements/libirecovery'
Making all in src
make[2]: Entering directory '/root/Téléchargements/libirecovery/src'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/root/Téléchargements/libirecovery/src'
Making all in include
make[2]: Entering directory '/root/Téléchargements/libirecovery/include'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/root/Téléchargements/libirecovery/include'
Making all in tools
make[2]: Entering directory '/root/Téléchargements/libirecovery/tools'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/root/Téléchargements/libirecovery/tools'
make[2]: Entering directory '/root/Téléchargements/libirecovery'
make[2]: Leaving directory '/root/Téléchargements/libirecovery'
make[1]: Leaving directory '/root/Téléchargements/libirecovery'
[root@localhost libirecovery]#

Q: Use irecovery/irestore to ssh/mount root (/)?

Greetings,

Is there any way to use your tools to achieve the above mentioned? I'm trying to rescue some photos before wiping out the phone.

My phone won't boot now. I believe the culprit is a full root (/). The Delete function in Photos stopped working.

I tried everything else, like make_noerase_ipsw, and ran into different roadblocks.

My phone:

  • iPhone 5s
  • Probably on iOS 8.x

Or, if there's a way for me to free up some space in root (/) and try reboot, or just copy those photos out before I do a full restore.

Or, using your tools to perform an equivalent of "Update". Tried that in iTunes and it would stop dead with an Apple logo and one tiny blob on the progress bar and eventually timed out.

Also the interactive shell from "irecovery -s" leads me to think that it may have the ability to deal with the filesystems except there are no documentations I can find regarding the commands available. The only example that kept coming up in Google is the "setenv/saveenv" example.

Any pointers or tricks to try are much appreciated. My phone is not jailbroken.

Cheers,

Alex

libusb error

Greetings,

Not sure what does this mean.

Alexs-MBP:idevicerestore-master alex$ irecovery -i 476ab325e30 -s -v
Attempting to connect...
opening device 05ac:1227...
found device with ECID 00000476ab325e30
Setting to configuration 1
Setting to interface 0:0
libusb: error [submit_bulk_transfer] endpoint not found on any open interface
libusb: error [darwin_clear_halt] endpoint not found on any open interface

Thanks.

Alex

Question about the 'make' error

Hi,

First of all, thank you for providing the open source.

While I'm using this open source, I have one trouble with this 'make' command.
the problem is as shown below. What is the meaning of '-mno-cygwin' in the picture? I don't know how to solve this problem now.
Have you ever face with this kinda problem? if you had, please let me know how to fix this problem.

Thank you.

image

iPad6,12 - J72tAP: [Error] ERROR: Unable to discover device model [Error] Fail code=-2

Hi,

Could someone please assist. Having an issue trying to restore to 11.2.6. Using Future Restore on MacOS, most recent version and dependencies.

Using an iPad6,12 - J72tAP with (assumed) valid SHSH blobs from TSSSAVER. I've seen a post here > encounter#32 and checked libirecovery.c and can see: {"iPad6,12", "j72tap", 0x12, 0x8003 }, is present

I've also referred to exact file paths rather than relative during command execution

Please see below for paste of terminal

Could someone please advise?

Thanks,
Christian

Version: b99eb81 - 152
Libipatcher Version: f32e41d850f51448bd6c588ead9c7d6455733f3c - 44
Odysseus Support: yes
[INFO] 64bit device detected
futurerestore init done
reading ticket /Users/user/Downloads/downgrade/blob.shsh2 done
[Error] ERROR: Unable to discover device model
[Error] Fail code=-2
Failed with errorcode=-2

Shell and command mode doesn't work

I have a similar issue as described here #53
I'm using Ubuntu 18.04 (libusb 1.0.23) and trying to get some information from iPhone 5 and 5s NVRAM.
When entering shell mode I can see iBoot version however the following commands don't produce any output:
sudo ./irecovery -c getenv com.apple.System.boot-nonce

sudo ./irecovery -s
> help
>

Problem during MAKE

Hi everyone,

After long hours to look for a solution, I finally decide to post what i have in hope of getting the job done.

I installed dependencies, cloned the github directory, and after lauchning "./autogen.sh" i had to use
aclocal
autoconf
autoheader

so that autogen.sh can run properly.

I finally come up with :
1_github

But then , during MAKE phase, i have:

2github
3git

I get similar error during the make install phase, with "Nothing to be done"..
By the way , i actually have an iphone 7 ,running under iOS 10. i have ubunutu 16.04,
I hope libimobiledevice will help me to fully enjoy this new phone,

I would reaaly appreciate your help,

kindly ,

iPhone SE connect loop

# jamiebishop at JamieMac.local in ~ on git:master ● [17:11:01]
→ irecovery -s -v
Attempting to connect...
Attempting to connect...
Attempting to connect...
Attempting to connect...
Attempting to connect...
Attempting to connect...

iTunes can see the device

failure to find functions in libreadline on compiling libirecovery (and fix)

Some distro's fail to compile libirecovery because ncurses is not compiled in (lib)readline. To fix this problem, edit the Makefile in the tools directory and add -lncurses to the line which includes -lreadline
(note -LNCURSES in lower case) .The line should now read.
AM_LDFLAGS = $(libusb_LIBS) -lreadline -lncurses

Problem during make

I can't get libirecovery to install on my system. It encounters an error during make.

root@Kali:/idevice/libirecovery# make
make all-recursive
make[1]: Entering directory '/root/idevice/libirecovery'
Making all in src
make[2]: Entering directory '/root/idevice/libirecovery/src'
CC libirecovery_la-libirecovery.lo
CCLD libirecovery.la
make[2]: Leaving directory '/root/idevice/libirecovery/src'
Making all in include
make[2]: Entering directory '/root/idevice/libirecovery/include'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/root/idevice/libirecovery/include'
Making all in tools
make[2]: Entering directory '/root/idevice/libirecovery/tools'
CC irecovery-irecovery.o
CCLD irecovery
//usr/local/lib/libreadline.so: undefined reference to tputs' //usr/local/lib/libreadline.so: undefined reference totgoto'
//usr/local/lib/libreadline.so: undefined reference to tgetflag' //usr/local/lib/libreadline.so: undefined reference toUP'
//usr/local/lib/libreadline.so: undefined reference to tgetent' //usr/local/lib/libreadline.so: undefined reference totgetnum'
//usr/local/lib/libreadline.so: undefined reference to PC' //usr/local/lib/libreadline.so: undefined reference totgetstr'
//usr/local/lib/libreadline.so: undefined reference to `BC'
collect2: error: ld returned 1 exit status
Makefile:391: recipe for target 'irecovery' failed
make[2]: *** [irecovery] Error 1
make[2]: Leaving directory '/root/idevice/libirecovery/tools'
Makefile:456: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/idevice/libirecovery'
Makefile:364: recipe for target 'all' failed
make: *** [all] Error 2
root@Kali:
/idevice/libirecovery#

Release for homebrew integration

libirecovery is a requirement of idevicerestore, which expects at least version 0.0.2. I currently try to make a homebrew formula that builds idevicerestore and for that I created a formula for libirecovery. Since homebrew accepts only tagged versions it would be cool if you could make a new 0.0.2 release, so I can progress with the formula.

Related pull request: Homebrew/homebrew-core#1259

WIN32: Libirecovery is not working with Apple device drivers 423.36.0.0 from Windows Update

libirecovery is not working with Apple device drivers 423.36.0.0 from Window Update. I tried to use idevicerestore -e -l command with iPhone 5S model and it cannot complete. iTunes can do restore process with this Windows Update driver and older Apple delivered driver from AppleApplicationSupport.msi.

Not working driver:
'''
Original Name: appleusb.inf
Provider Name: Apple, Inc.
Class Name: Universal Serial Bus -laitteet
Class GUID: {88bae032-5a81-49f0-bc3d-a4ff138216d6}
Driver Version: 05/07/2018 423.36.0.0
Signer Name: Microsoft Windows Hardware Compatibility Publisher
'''

Device instance path line seems to be changed to line like on libirecovery mobiledevice_connect(recv_client_t* client, unsigned long long ecid) "get iBoot path" line 669 :
'''
\?\usb#vid_05ac&pid_1281&mi_00#8&37932c9b&0&0000#{ed82a167-d61a-4af6-9ab6-11e52236c576}\usb#vid_05ac&pid_1281#cpid:8960_cprv:11_cpfm:03_scep:01_bdid:02_ecid:000007f6f24358d0_ibfl:1d_srnm:[dnplr9abffgc]#mux1
'''

I modified that code to like this and was able to move little longer on idevicerestore process with those drivers.

My modified code:

'''

        char serial_str[256];
        serial_str[0] = '\0';
        if (((sscanf(result, "\\\\?\\usb#vid_%*04x&pid_%*04x#%s#", serial_str) != 1) && (sscanf(result, "\\\\?\\usb#%s\\#vid_%*04x&pid_%*04x#%s#", serial_str) != 1)) || (serial_str[0] == '\0')) {
            mobiledevice_closepipes(_client);
            continue;
        }

        char* pChar;
        pChar = strtok(serial_str, "#");

        while (pChar != NULL)
        {
            printf ("%s\n", pChar);
            if (strstr(pChar, "ecid:") > 0)
            {
                strncpy(serial_str, pChar, sizeof(serial_str));
                break;
            }
            pChar = strtok(NULL, "#");
        }

        char* p = strchr(serial_str, '#');
        if (p) {
            *p = '\0';
        }

'''

After this modification idevicerestore fails at libidevicerestore at this point:
Sending iBEC (714456 bytes)...
ERROR: Unable to send iBEC component: Unable to upload data to device

Error when run make with openSUSE 13.2

There's no error runing ./autogen.sh
After that,I run make and it showed that below

mcjoeng@mcj:~/libirecovery> make
make all-recursive
make[1]: Entering directory '/home/mcjoeng/libirecovery'
Making all in src
make[2]: Entering directory '/home/mcjoeng/libirecovery/src'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/mcjoeng/libirecovery/src'
Making all in include
make[2]: Entering directory '/home/mcjoeng/libirecovery/include'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/mcjoeng/libirecovery/include'
Making all in tools
make[2]: Entering directory '/home/mcjoeng/libirecovery/tools'
CC irecovery-irecovery.o
irecovery.c:26:31: fatal error: readline/readline.h: 没有那个文件或目录
#include <readline/readline.h>
^
compilation terminated.
Makefile:424: recipe for target 'irecovery-irecovery.o' failed
make[2]: *** [irecovery-irecovery.o] Error 1
make[2]: Leaving directory '/home/mcjoeng/libirecovery/tools'
Makefile:456: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/mcjoeng/libirecovery'
Makefile:364: recipe for target 'all' failed
make: *** [all] Error 2

Won't compile?

So I am attempting to compile this and as I run

sh autogen.sh
it gives me this and refuses to "autogen":
glibtoolize: putting auxiliary files in .'. glibtoolize: linking file./ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIR, m4'. glibtoolize: linking filem4/libtool.m4'
glibtoolize: linking file m4/ltoptions.m4' glibtoolize: linking filem4/ltsugar.m4'
glibtoolize: linking file m4/ltversion.m4' glibtoolize: linking filem4/lt~obsolete.m4'
configure.ac:6: error: Autoconf version 2.65 or higher is required
/usr/local/Cellar/automake/1.14.1/share/aclocal-1.14/init.m4:29: AM_INIT_AUTOMAKE is expanded from...
configure.ac:6: the top level
autom4te: /sw/bin/m4 failed with exit status: 63
aclocal: error: echo failed with exit status: 63
configure.ac: error: no proper invocation of AM_INIT_AUTOMAKE was found.
configure.ac: You should verify that configure.ac invokes AM_INIT_AUTOMAKE,
configure.ac: that aclocal.m4 is present in the top-level directory,
configure.ac: and that aclocal.m4 was recently regenerated (using aclocal)
src/Makefile.am:11: error: WIN32 does not appear in AM_CONDITIONAL
src/Makefile.am:6: error: Libtool library used but 'LIBTOOL' is undefined
src/Makefile.am:6: The usual way to define 'LIBTOOL' is to add 'LT_INIT'
src/Makefile.am:6: to 'configure.ac' and run 'aclocal' and 'autoconf' again.
src/Makefile.am:6: If 'LT_INIT' is in 'configure.ac', make sure
src/Makefile.am:6: its definition is in aclocal's search path.
/usr/local/Cellar/automake/1.14.1/share/automake-1.14/am/depend2.am: error: am__fastdepCC does not appear in AM_CONDITIONAL
/usr/local/Cellar/automake/1.14.1/share/automake-1.14/am/depend2.am: The usual way to define 'am__fastdepCC' is to add 'AC_PROG_CC'
/usr/local/Cellar/automake/1.14.1/share/automake-1.14/am/depend2.am: to 'configure.ac' and run 'aclocal' and 'autoconf' again
/usr/local/Cellar/automake/1.14.1/share/automake-1.14/am/depend2.am: error: AMDEP does not appear in AM_CONDITIONAL
/usr/local/Cellar/automake/1.14.1/share/automake-1.14/am/depend2.am: The usual way to define 'AMDEP' is to add one of the compiler tests
/usr/local/Cellar/automake/1.14.1/share/automake-1.14/am/depend2.am: AC_PROG_CC, AC_PROG_CXX, AC_PROG_OBJC, AC_PROG_OBJCXX,
/usr/local/Cellar/automake/1.14.1/share/automake-1.14/am/depend2.am: AM_PROG_AS, AM_PROG_GCJ, AM_PROG_UPC
/usr/local/Cellar/automake/1.14.1/share/automake-1.14/am/depend2.am: to 'configure.ac' and run 'aclocal' and 'autoconf' again
./configure: line 1789: syntax error near unexpected token dist-bzip2' ./configure: line 1789:AM_INIT_AUTOMAKE(dist-bzip2 no-dist-gzip)'

Now, I will tell you that I have autoconf version 2.69. So I have no idea why it is telling me I do not have version 2.65 or above. Please help. Thanks!

Shell mode doesn't really work

When starting the irecovery tool in shell mode, the output looks like so:

shinvou@hjerne_en ~> irecovery -s
>

or when entering commands (which actually execute)

shinvou@hjerne_en ~> irecovery -s
> help
>

I remember that some time ago, when starting in shell mode, irecovery would actually display some info like iBoot version and blah. Also, when executing commands I don't see a response from iBoot on the device. help should display a command list.

Do you have any clue?
I tried with different devices (iPhone 5s, iPhone X and iPad Air), both recovery and DFU mode and also on various versions of macOS (10.14, 10.15).

Unable to connect to device iphone5s

i try to connect iphone with DFU mode. and use this master branch with ‘commit 10a1f8d’(Author: Nikias Bassen [email protected]
Date: Tue Jan 14 16:20:08 2020 +0100);

 .\irecovery.exe -v -q
Attempting to connect...
Attempting to connect...
Attempting to connect...
Attempting to connect...
Attempting to connect...
Attempting to connect...
ERROR: Unable to connect to device

but iTunes can find it!!!
device info:

Identified device as n53ap, iPhone6,2
Extracting BuildManifest from IPSW
Product Version: 12.4.4
Product Build: 16G140 Major: 16
Device supports Image4: true
libusbmuxd:
commit 5cbf7635e34b68125b01dbc71b333525ad3cea40 (HEAD -> master, origin/master, origin/HEAD)
Author: Nikias Bassen <[email protected]>
Date:   Tue Jan 14 16:24:53 2020 +0100

mingw64-i686-libusb :1.2.6.0-1
mingw64-i686-libusb1.0 :1.0.21-1

all compile with cygwin64 in win10.

iPod Touch1'2'3 the BM of firmwares , CPID is wrong?

A question, see below:
libirecovery.cpp:
{"iPod2,1", "n72ap", 0x00, 0x8920 },
{"iPod3,1", "n18ap", 0x02, 0x8922 },

BM of firmware:

ApBoardID
0x00
ApChipID
0x8720
Is there '8920' should change to '8720'?
But no device to prove that.

iPad mini 5th genration issue

NOTE: Updated version data.
Reading data from version.xml
Found device in Normal mode
ERROR: Unable to discover device type

irecovery not properly grabbing nonce

I found an interesting problem that I think might be a hardware issue (on the iPhone, not the computer) but would like to put it here so other people can examine. I'm using Ubuntu 16.10.

I was messing around with an iPhone 3GS that has a bricked baseband or something like that, and was trying to downgrade it to iOS 3.0 using idevicerestore. I hadn't booted it into pwned dfu or anything like that. I noticed that it kept failing, with similar output each time:

Reading data from version.xml
NOTE: using cached version data
opening device 05ac:1281...
irecv_copy_nonce_with_tag: WARNING: couldn't find tag NONC in string Apple Inc.
irecv_copy_nonce_with_tag: WARNING: couldn't find tag SNON in string Apple Inc.
Setting to configuration 1
Setting to interface 0:0
Found device in Recovery mode
opening device 05ac:1281...
irecv_copy_nonce_with_tag: WARNING: couldn't find tag NONC in string Apple Inc.
irecv_copy_nonce_with_tag: WARNING: couldn't find tag SNON in string Apple Inc.
Setting to configuration 1
Setting to interface 0:0
Identified device as n88ap, iPhone2,1
Extracting Restore.plist from IPSW
Product Version: 3.0
Product Build: 7A341 Major: 7
opening device 05ac:1281...
irecv_copy_nonce_with_tag: WARNING: couldn't find tag NONC in string Apple Inc.
irecv_copy_nonce_with_tag: WARNING: couldn't find tag SNON in string Apple Inc.
Setting to configuration 1
Setting to interface 0:0
Device supports Image4: false
Custom firmware requested. Disabled TSS request.
Variant: Customer Erase Install (IPSW)
This restore will erase your device data.
Using cached filesystem from '/home/me/Projects/iOS/Bundles/iPhone2,1_3.0_7A341_Restore/018-5302-002.dmg'
Extracting iBEC.n88ap.RELEASE.dfu...
Not personalizing component iBEC...
Writing data to iBEC
Sending iBEC (104772 bytes)...
ERROR: could not retrieve device serial number. Can't continue.

I was kind of confused, so I went into irecovery (where irecv_copy_nonce_with_tag is) and using my basic C skills, I added debug("Magically, a tag appeared: %s\n", nonce); right below src/libirecovery.c#L332.

This changed the output to the following (which is a snippet):

Magically, a tag appeared: 
irecv_copy_nonce_with_tag: WARNING: couldn't find tag NONC in string Apple Inc.
Magically, a tag appeared: 
irecv_copy_nonce_with_tag: WARNING: couldn't find tag SNON in string Apple Inc.

The tag passed to irecv_copy_nonce_with_tag appears to be null, if I understood printing stuff in C correctly. So, I went up to src/libirecovery.c#L650 and added the following:

debug("Your ap: %s\n", &client->device_info.ap_nonce);
debug("Your sep: %s\n", &client->device_info.sep_nonce);
debug("Here's a bonus for working with us: %s\n", serial_str);

Well, this produced the following snippet:

Your ap: 
Your sep: 
Here's a bonus for working with us: CPID:8920 CPRV:14 CPFM:03 SCEP:03 BDID:00 ECID:redacted IBFL:01 IMEI:[redacted]

ap and sep are both empty as well. I honestly don't know what's wrong here, perhaps it's hardware, libirecovery, or my C skills aren't outputting anything because I messed up.

(If you think this is an idevicerestore issue, please tell me.)

Doesn't even communicate..

So I have rebuilt libirecovery a few times now and that seems to be doing nothing. Every time I run

irecovery -s
or
irecovery -c
it does nothing for a few seconds and then it exits. No error messages or anything. Some of the other options work, but it is just being very frustrating. Please Help.

add support for the Spring 2020 iPad Pros and iPhone SE

// iPad Pro 11-inch (2020) WiFi //
Model: iPad8,9
Board: j417ap
Platform: t8027
APBoardID: 0x3C

// iPad Pro 11-inch (2020) WiFi + Cellular //

Model: iPad8,10
Board: j418ap
Platform: t8027
APBoardID: 0x3E
BBChipID: 0x00000068

// iPad Pro 12.9-inch (2020) WiFi //
Model: iPad8,11
Board: j420ap
Platform: t8027
APBoardID: 0x38

// iPad Pro 12.9-inch (2020) WiFi + Cellular //

Model: iPad8,12
Board: j421ap
Platform: t8027
APBoardID: 0x3A
BBChipID: 0x00000068


IPSW Links:
11-inch: https://updates.cdn-apple.com/2020WinterFCS/fullrestores/041-42554/2971A61F-8071-43AC-93BB-F68D1BEAD94E/iPad_Spring_2020_13.4_17E255_Restore.ipsw

12.9-inch: https://updates.cdn-apple.com/2020WinterFCS/fullrestores/041-44040/C7006F64-A1F3-4671-84A3-2E77DFB04A8E/iPad8,11,iPad8,12_13.4_17E255_Restore.ipsw

should retry be incremented in the loop ?

line 1789 of libirecovery.c
`
if (!recovery_mode && status != 5) {
int retry = 0;

		while (retry < 20) {
			irecv_get_status(client, &status);
			if (status == 5) {
				break;
			}
			sleep(1);
		}

		if (status != 5) {
			return IRECV_E_USB_UPLOAD;
		}
	}`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.