forked from venshine/decompile-apk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jdgui-apk.sh
executable file
·58 lines (42 loc) · 1.06 KB
/
jdgui-apk.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
SCRIPT_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
export SCRIPT_DIR
source $SCRIPT_DIR/util.sh
check $1
newfoldername=$foldername
rm -rf $newfoldername
function isEmptyDir(){
return `ls -A $1|wc -w`
}
sh $SCRIPT_DIR/tools/apktool/apktool d -f $absolutename
if [ ! -d "$foldername" ];
then
echo "Resource files decompile failed"
exit
fi
if isEmptyDir $foldername;
then
echo "Resource files decompile failed"
exit
fi
echo "Resource files decompile successful"
cd $foldername
echo `pwd`
#sh $SCRIPT_DIR/tools/dex2jar/d2j-dex2jar.sh $absolutename
sh $SCRIPT_DIR/tools/dex-tools-2.x/d2j-dex2jar.sh $absolutename
suffix="-dex2jar.jar"
jarname=${foldername}${suffix}
if [ ! -f "$jarname" ];
then
echo "Dex file decompile failed"
exit
fi
echo "Dex file decompile successful"
path=`pwd`
pathname=${path}"/"${jarname}
echo ${pathname}
foldname=${path}"/"${jarname}"_jadx"
rm -rf $foldname
sh /content/dec/tools/jadx/bin/jadx -d $foldname $pathname
#echo "View the decompile file"
#java -jar $SCRIPT_DIR/tools/jd-gui/jd-gui.jar $jarname