Ubuntu上安装apktool

点击打开链接

下载两个文件

解压这两个文件

bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/下载$ ls
apktool1.5.2.tar.bz2 apktool-install-linux-r05-ibot.tar.bz2 book.pdf spark_2.4_h5.apk

# 解压bz2文件的方法1,先使用bunzip2转成tar文件,再使用tar xvf 进行解压
bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/下载$ bunzip2 apktool1.5.2.tar.bz2

bunzip2: apktool1.5.2.tar.bz2: trailing garbage after EOF ignored
bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/下载$ ls 
apktool1.5.2.tar apktool-install-linux-r05-ibot.tar.bz2 book.pdf spark_2.4_h5.apk
bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/下载$ tar xvf apktool1.5.2.tar 
apktool1.5.2/
apktool1.5.2/apktool.jar

# 解压bz2文件的方法2,直接解压:tar jxvf  文件.bz2
bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/下载$ tar jxvf apktool-install-linux-r05-ibot.tar.bz2 
apktool-install-linux-r05-ibot/aapt

bzip2: (stdin): trailing garbage after EOF ignored
apktool-install-linux-r05-ibot/
apktool-install-linux-r05-ibot/apktool
bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/下载$ ls -al
总用量 11740
drwxr-xr-x 4 bixiaopeng bixiaopeng 4096 10月 12 10:42 .
drwxr-xr-x 35 bixiaopeng bixiaopeng 4096 10月 12 10:38 ..
drwxrwxr-x 2 bixiaopeng bixiaopeng 4096 2月 3 2013 apktool1.5.2
-rw------- 1 bixiaopeng bixiaopeng 2658304 10月 12 10:37 apktool1.5.2.tar
drwxrwxr-x 2 bixiaopeng bixiaopeng 4096 12月 23 2012 apktool-install-linux-r05-ibot
-rw-rw-r-- 1 bixiaopeng bixiaopeng 419840 10月 12 10:37 apktool-install-linux-r05-ibot.tar.bz2
-rw-rw-r-- 1 bixiaopeng bixiaopeng 943231 10月 12 09:13 book.pdf
-rw-rw-r-- 1 bixiaopeng bixiaopeng 7963744 10月 11 15:21 spark_2.4_h5.apk

#将解压后得到的三个文件apktool.jar /aapt /apktool copy 到 /usr/local/bin/目录下

[plain] view plain copy
  1. bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/下载/apktool-install-linux-r05-ibot$ cd /usr/local/bin/  
  2. bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:/usr/local/bin$ ls -al  
  3. 总用量 3704  
  4. drwxr-xr-x 2 root root 4096 10月 12 10:51 .  
  5. drwxr-xr-x 10 root root 4096 4月 25 01:11 ..  
  6. -rwxr-x--- 1 root root 1119899 10月 12 10:51 aapt  
  7. -rwxr-xr-x 1 root root 2320 10月 12 10:51 apktool  
  8. -rw-r--r-- 1 root root 2655843 10月 12 10:50 apktool.jar  

#下面就可以直接使用apktool了,先查看一下帮助文件

[plain] view plain copy
  1. bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~$ apktool  
  2. Apktool v1.5.2 - a tool for reengineering Android apk files  
  3. Copyright 2010 Ryszard Wiśniewski <brut.alll@gmail.com>  
  4. with smali v1.4.1, and baksmali v1.4.1  
  5. Updated by @iBotPeaches <connor.tumbleson@gmail.com>   
  6. Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)  
  7.   
  8. Usage: apktool [-q|--quiet OR -v|--verbose] COMMAND [...]  
  9.   
  10. COMMANDs are:  
  11.   
  12. d[ecode] [OPTS] <file.apk> [<dir>]  
  13. Decode <file.apk> to <dir>.  
  14.   
  15. OPTS:  
  16.   
  17. -s, --no-src  
  18. Do not decode sources.  
  19. -r, --no-res  
  20. Do not decode resources.  
  21. -d, --debug  
  22. Decode in debug mode. Check project page for more info.  
  23. -b, --no-debug-info  
  24. Baksmali -- don't write out debug info (.local, .param, .line, etc.)  
  25. -f, --force  
  26. Force delete destination directory.  
  27. -t <tag>, --frame-tag <tag>  
  28. Try to use framework files tagged by <tag>.  
  29. --frame-path <dir>  
  30. Use the specified directory for framework files  
  31. --keep-broken-res  
  32. Use if there was an error and some resources were dropped, e.g.:  
  33. "Invalid config flags detected. Dropping resources", but you  
  34. want to decode them anyway, even with errors. You will have to  
  35. fix them manually before building.  
  36.   
  37. b[uild] [OPTS] [<app_path>] [<out_file>]  
  38. Build an apk from already decoded application located in <app_path>.  
  39.   
  40. It will automatically detect, whether files was changed and perform  
  41. needed steps only.  
  42.   
  43. If you omit <app_path> then current directory will be used.  
  44. If you omit <out_file> then <app_path>/dist/<name_of_original.apk>  
  45. will be used.  
  46.   
  47. OPTS:  
  48.   
  49. -f, --force-all  
  50. Skip changes detection and build all files.  
  51. -d, --debug  
  52. Build in debug mode. Check project page for more info.  
  53. -a, --aapt  
  54. Loads aapt from specified location.  
  55.   
  56. if|install-framework <framework.apk> [<tag>] --frame-path [<location>]   
  57. Install framework file to your system.  
  58.   
  59. For additional info, see: http://code.google.com/p/android-apktool/  
  60. For smali/baksmali info, see: http://code.google.com/p/smali/  
 

至于如何使用apktool,请参考我的另一篇博客http://blog.csdn.net/wirelessqa/article/details/8997168

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值