apk文件的解包和打包操作

1. apk文件的解包和打包

最新版的apktool:https://bitbucket.org/iBotPeaches/apktool/downloads/
首先更新apktool.jar为最新版本,apktool脚本也是,复制到usr/local/bin目录下,还有一改appt文件都是要复制

安装文档的网址
https://ibotpeaches.github.io/Apktool/install/

还需要通过chmod来修改
Download Linux wrapper script (Right click, Save Link As apktool)

  • Download apktool-2 (find newest here)
  • Make sure you have the 32bit libraries (ia32-libs) downloaded and installed by your linux package manager, if you are on a 64bit unix system.
  • (This helps provide support for the 32bit native binary aapt, which is required by apktool)
  • Rename downloaded jar to apktool.jar
  • Move both files (apktool.jar & apktool) to /usr/local/bin (root needed)
  • Make sure both files are executable (chmod +x)
  • Try running apktool via cli

[解包和打包命令]

apktool d xxx.apk

apktool b xxx

2. 解包后的修改

修改yml文件中的versionCode

3. 生成签名文件并签名

http://www.jianshu.com/p/e9a685c88258
生成签名文件的时候-alias后面那个是别名,可以自己给keystore文件设置一个别名,这个别名也是有密码的。

keytool -genkey -keystore test.keystore  -alias test -keyalg RSA -validity 10000

最后那个test是别名,也有可能是别的名比如mykey等

jarsigner -verbose -keystore test.keystore -signedjar signed.apk t.apk 'test'

4. 怎么查看versionCode

也是通过aapt工具来进行查看的

aapt dump badging C:/Users/kuguan/Desktop/app-release_1.0.9.apk

不过这里的aapt需要使用全路径,也即是andorid SDK下的build_tools

5. 查看签名文件

http://blog.csdn.net/wed110/article/details/38303637

用winrar打开待查看的apk,将其中META-INF文件夹解压出来,得到其中的CERT.RSA文件

keytool -printcert -file META-INF/CERT.RSA
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页