Skip to content

Commit

Permalink
add bytecode-viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
venshine committed Jan 15, 2020
1 parent 568e6a3 commit d415aa3
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 2 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@ The decompile-apk tool consists of some scripts and different tools, it can prov

![classyshark](screenshot/classyshark.png)

* bytecode-viewer

![bytecode-viewer](screenshot/bytecode-viewer.png)

## Tools
* [Apktool](https://github.com/iBotPeaches/Apktool) : v2.4.1
* [dex2jar](https://github.com/pxb1988/dex2jar) : v2.1
* [jd-gui](https://github.com/java-decompiler/jd-gui) : v1.6.6
* [jadx](https://github.com/skylot/jadx) : v1.1.0
* [android-classyshark](https://github.com/google/android-classyshark) : v8.2
* [bytecode-viewer](https://github.com/Konloch/bytecode-viewer) : v2.9.22

## Platforms
* Mac
Expand All @@ -42,6 +47,9 @@ sh jadx-apk.sh *.apk
# using classyshark to decompile apk
sh classyshark-apk.sh *.apk

# using bytecode-viewer to decompile apk
sh bytecode-viewer.sh *.apk

```

## Summary
Expand All @@ -67,6 +75,13 @@ sh classyshark-apk.sh *.apk
* disadvantage
* resource files partially missing

* bytecode-viewer
* advantage
* support apk, dex, jar, and so on
* better visual feedback
* disadvantage
* analyse file slower

## Todo
* more decompile tools
* support decompile dex/aar/jar files
Expand Down
27 changes: 27 additions & 0 deletions bytecode-viewer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh

# 校验参数合法性
source util.sh
check $1

# 得到新的目录
newfoldername=${foldername}"-bytecodeviewer"
rm -rf $foldername

if [ ! -d "$newfoldername" ];
then
mkdir $newfoldername
fi

# 切换到创建的目录
cd $newfoldername

# 打印该目录的路径
echo `pwd`

# 通过ClassyShark查看apk文件
echo "View the decompile file"

# 执行ClassyShark命令
#java -jar ../../tools/bytecode-viewer/Bytecode-Viewer.jar -i $absolutename -o . -t all
java -jar ../../tools/bytecode-viewer/Bytecode-Viewer.jar
9 changes: 7 additions & 2 deletions decompile-apk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ function input() {
echo "1: using apktool/dex2jar/jd-gui to decompile apk"
echo "2: using ClassyShark to decompile apk"
echo "3: using jadx to decompile apk"
echo "4: using bytecode-viewer to decompile apk"
echo "q: exit"
fi

#echo "Please input your choice(1, 2, 3):"
read -p "Please input your choice(1, 2, 3):" input
#echo "Please input your choice(1, 2, 3, 4):"
read -p "Please input your choice(1, 2, 3, 4):" input

case $input in
1)
Expand All @@ -29,6 +30,10 @@ function input() {
## 执行jadx-apk命令
sh jadx-apk.sh $arg
;;
4)
## 执行bytecode-viewer-apk命令
sh bytecode-viewer.sh $arg
;;
q)
## 退出命令
exit
Expand Down
Binary file added screenshot/bytecode-viewer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tools/bytecode-viewer/Bytecode-Viewer.jar
Binary file not shown.

0 comments on commit d415aa3

Please sign in to comment.