最新idevicerestore源码编译问题与解决

在Linux环境下,编译idevicerestore源码时遇到zip_ftell和zip_fseek函数未定义的问题。解决方法是更新到libzip 1.2.0版本,然后重新编译idevicerestore。运行idevicerestore时,由于找不到libzip.so.3库,需要创建软链接。完成这些步骤后,idevicerestore可以成功运行并显示使用选项。
摘要由CSDN通过智能技术生成

第一步,克隆最新idevicerestore源码:
git clone https://github.com/libimobiledevice/idevicerestore.git
cd idevicerestore
./autogen.sh 
make
编译出现问题:
idevicerestore-ipsw.o: In function `ipsw_file_tell':
/home/a/hui/deguang/idevicerestore/idevicerestore/src/ipsw.c:1398: undefined reference to `zip_ftell'
idevicerestore-ipsw.o: In function `ipsw_file_seek':
/home/a/hui/deguang/idevicerestore/idevicerestore/src/ipsw.c:1379: undefined reference to `zip_fseek'
原因:这是因为新版本的idevicerestore用了新的libzip 1.2.0库,更新libzip库到1.2.0版本即可。

解决方法:libzip缺zip_ftell函数解决方法:wget https://libzip.org/download/libzip-1.2.0.tar.xz
tar -xf libzip-1.2.0.tar.xz 
cd libzip-1.2.0/cmake .
make
sudo make install
编译安装libzip 1.2.0库后,重复第一步编译idevicerestore,编辑顺利通过。

运行idevicerestore程序报错。
cd idevicerestore 
./src/idevicerestore            
error while loading shared libraries: libzip.so.3: cannot open shared object file: No such file or directory
解决方法:提示找不到libzip.so.3库,在/usr/lib/路径做个链接即可。
sudo ln -s /usr/local/lib/libzip.so.3.0 /usr/lib/libzip.so.3

运行idevicerestore成功
cd idevicerestore 
./src/idevicerestore
 

Usage: idevicerestore [OPTIONS] PATH

Restore IPSW firmware at PATH to an iOS device.

PATH can be a compressed .ipsw file or a directory containing all files
extracted from an IPSW.

OPTIONS:
  -i, --ecid ECID       Target specific device by its ECID
                        e.g. 0xaabb123456 (hex) or 1234567890 (decimal)
  -u, --udid UDID       Target specific device by its device UDID
                        NOTE: only works with devices in normal mode.
  -l, --latest          Use latest available firmware (with download on demand).
                        Before performing any action it will interactively ask
                        to select one of the currently signed firmware versions,
                        unless -y has been given too.
                        The PATH argument is ignored when using this option.
                        DO NOT USE if you need to preserve the baseband/unlock!
                        USE WITH CARE if you want to keep a jailbreakable
                        firmware!
  -e, --erase           Perform full restore instead of update, erasing all data
                        DO NOT USE if you want to preserve user data on the device!
  -y, --no-input        Non-interactive mode, do not ask for any input.
                        WARNING: This will disable certain checks/prompts that
                        are supposed to prevent DATA LOSS. Use with caution.
  -n, --no-action       Do not perform any restore action. If combined with -l
                        option the on-demand ipsw download is performed before
                        exiting.
  --ipsw-info           Print information about the IPSW at PATH and exit.
  -h, --help            Prints this usage information
  -C, --cache-path DIR  Use specified directory for caching extracted or other
                        reused files.
  -d, --debug           Enable communication debugging
  -v, --version         Print version information

Advanced/experimental options:
  -c, --custom          Restore with a custom firmware (requires bootrom exploit)
  -s, --server URL      Override default signing server request URL
  -x, --exclude         Exclude nor/baseband upgrade (legacy devices)
  -t, --shsh            Fetch TSS record and save to .shsh file, then exit
  -z, --no-restore      Do not restore and end after booting to the ramdisk
  -k, --keep-pers       Write personalized components to files for debugging
  -p, --pwn             Put device in pwned DFU mode and exit (limera1n devices)
  -P, --plain-progress  Print progress as plain step and progress
  -R, --restore-mode    Allow restoring from Restore mode
  -T, --ticket PATH     Use file at PATH to send as AP ticket
  --variant VARIANT     Use given VARIANT to match the build identity to use,
                        e.g. 'Customer Erase Install (IPSW)'
  --ignore-errors       Try to continue the restore process after certain
                        errors (like a failed baseband update)
                        WARNING: This might render the device unable to boot
                        or only partially functioning. Use with caution.
  -Q, --quit program when the step is 'Sending Cryptex1,SystemOS now...'. 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值