如何提取Android NDK包?

Tho*_*ang 3 android 7zip android-ndk

我的操作系统是CentOS 32位.

我想用7-zip解压缩包,用rpm安装7-zip而不会出错.但是当我提取NDK包时,它不起作用.像这样:

[root@localhost ~]# ls
anaconda-ks.cfg                 jni-test
android-ndk-r10e-linux-x86.bin  p7zip-9.20.1-1.el5.rf.i386.rpm
install.log                     p7zip-plugins-9.20.1-1.el5.rf.i386.rpm
install.log.syslog
[root@localhost ~]# 7z x android-ndk-r10e-linux-x86.bin 

7-Zip 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
p7zip Version 9.20 (locale=zh_CN.UTF-8,Utf16=on,HugeFiles=on,1 CPU)

Processing archive: android-ndk-r10e-linux-x86.bin

Error: Can not open file as archive
Run Code Online (Sandbox Code Playgroud)

根据谷歌的官方文件操作:

[root@localhost ~]# ll
??? 307344
-rw-------. 1 root root      1096 6?  25 17:41 anaconda-ks.cfg
-rwxr-xr-x. 1 root root 309844799 6?  25 21:24 android-ndk-r10e-linux-x86.bin
-rw-r--r--. 1 root root      9119 6?  25 17:41 install.log
-rw-r--r--. 1 root root      3091 6?  25 17:41 install.log.syslog
drwxr-xr-x. 2 root root      4096 6?  25 20:04 jni-test
-rw-r--r--. 1 root root   4455529 4?  20 2011 p7zip-9.20.1-1.el5.rf.i386.rpm
-rw-r--r--. 1 root root    382577 4?  20 2011 p7zip-plugins-9.20.1-1.el5.rf.i386.rpm
[root@localhost ~]# ./android-ndk-r10e-linux-x86.bin 

7-Zip SFX 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
p7zip Version 9.20 (locale=zh_CN.UTF-8,Utf16=on,HugeFiles=on,1 CPU)

Processing archive: ./android-ndk-r10e-linux-x86.bin

Error: Can not open file as archive

Archive Errors: 1
[root@localhost ~]# file android-ndk-r10e-linux-x86.bin 
android-ndk-r10e-linux-x86.bin: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, stripped
Run Code Online (Sandbox Code Playgroud)

为什么?

更新: 此问题的原因是MD5值不相同.

ali*_*dro 6

如果是7zip格式包,可以用7zip解压缩.但事实并非如此,您可以从file命令中看到格式.

$ file android-ndk-r10e-linux-x86_64.bin 
android-ndk-r10e-linux-x86_64.bin: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=8c7de897dd2f5d869d108bed2f2152a68b2f7b0a, stripped
Run Code Online (Sandbox Code Playgroud)

从上面的输出结果中,我们可以看到它是一个ELF可执行文件,所以只需添加可执行位并执行它.

$ chmod u+x android-ndk-r10e-linux-x86_64.bin
$ ./android-ndk-r10e-linux-x86_64.bin
Run Code Online (Sandbox Code Playgroud)

它将解压缩到android-ndk-r10e当前目录下的目录.