Android反编译


  • 安装必要的工具(MAC OS)
1
2
3
4
5
6
brew install apktool 
brew install smali
brew install dex2jar
brew install jadx
brew cask install jd-gui

  • apktool
1
2
3
4
5
6
// 提取资源  同时将 Binaray XML 形式转化成 xml 
apktool d test.apk
// 提取资源并指定输出目录
apktool d test.apk -o test
// 重新打包apk
apktool b test
  • jadx 将 .dex/.jar/.class 文件反编译成 .java 源码
1
2
3
4
5
6
7
8
9
10
11
// 反编译 test.dex 并输出到 test 目录
jadx test.dex -d test

// 反编译 test.apk
jadx test.apk -d test

// 反编译 test.jar
jadx test.jar -d test

// 反编译 test.class
jadx test.class -d test
  • 签名
1
2
3
4
5
6
7
8
9
jarsigner -verbose -keystore /Users/cuihp/Downloads/a/appkey  -signedjar /Users/cuihp/Downloads/a/abc.apk /Users/cuihp/Downloads/a/swfplayer/dist/swfplayer.apk  key0

/Users/cuihp/Downloads/a/appkey 签名文件路径
/Users/cuihp/Downloads/a/abc.apk 签名后文件输出路径
/Users/cuihp/Downloads/a/swfplayer/dist/swfplayer.apk 要签名的文件路径
key0 签名文件别名

adb install -r /Users/cuihp/Downloads/a/abc.apk

  • jd-gui 查看jar 文件

参考链接