CentOS下反编译apk并重新打包

2015/03/1717:04:59 发表评论浏览:226

使用的工具:

apktool,aapt,jdk环境

这些工具的获取这里不再多说。

其中,aapt是一个32位的工具,如果你的系统是32位的,那么无须做过多解释,如果是64位,那跟着我一起来折腾吧。

我们来反编译一个apk包:

apktool d yourapk.apk  newdirectory

其中,d参数表示decode,反编译,yourapk为你要反编译的apk名,newdirectory表示解压到的新目录。

修改解压出来的文件后,再重新打包:

apktool b newdirectory  yournewapk.apk
newdirectory为反编译出来的目录,yournewapk为新生成的文件名。

此时,你可能会碰到如下问题:

ld-linux-x86-64.so.2 ^ elf no such....

这里需要安装glibc.i686库:

yum install glibc.i686

再次编译打包,又出现如下问题:

Exception in thread "main" aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory

使用如下命令查询该库属于哪个安装包:

yum provides libz.so.1

查到结果如下:

zlib-1.2.3-29.el6.i686 : The zlib compression and decompression library

安装zlib:

yum install zlib-1.2.3-29.el6.i686

编译打包,Again!!

MLGB,还有问题:

aapt: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

继续查找该库属于哪个包,查询结果如下:

aapt: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

更新libstdc++.so.6,为什么要更新?不然你可能会碰到:

Error: Protected multilib versions: libstdc++-4.4.7-11.el6.i686 != libstdc++-4.4.6-3.el6.x86_64

 You could try using --skip-broken to work around the problem

yum update libstdc++.so.6
yum install glibc.i686 zlib.i686 libstdc++.i686

 

 

  • 微信扫码赞助
  • weinxin
  • 支付宝赞助
  • weinxin

发表评论

您必须才能发表评论!