-
Notifications
You must be signed in to change notification settings - Fork 4
/
deodex.sh
executable file
·53 lines (48 loc) · 1.25 KB
/
deodex.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
#!/bin/bash
ver="2.1"
dedeox () {
a=`echo $1 | sed "s/odexed\///"`
mkdir -p tmp/$a
if [ -f $1.apk ]; then
echo "Dedeoxing $a.apk"
elif [ -f $1.jar ]; then
echo "Dedeoxing $a.jar"
fi
java -jar -Duser.language=en oat2dex.jar $1.odex tmp/$a.dex > /dev/null 2>&1
java -jar baksmali.jar -a 21 -x tmp/$a.dex -o tmp/$a
java -jar smali.jar -a 21 tmp/$a -o tmp/$a/classes.dex
if [ -f $1.apk ]; then
echo "$a.apk classes.dex created"
elif [ -f $1.jar ]; then
echo "$a.jar classes.dex created"
fi
echo
}
inject () {
a=`echo $1 | sed "s/odexed\///"`
mkdir -p deodexed
if [ -f $1.apk ]; then
echo "Injecting $a classex.dex into $a.apk"
cp $1.apk deodexed/.
cd tmp/$a
zip -r ../../deodexed/$a.apk classes.dex
cd ../../
elif [ -f $1.jar ]; then
echo "Injecting $a classex.dex into $a.jar"
cp $1.jar deodexed/.
cd tmp/$a
zip -r ../../deodexed/$a.jar classes.dex
cd ../../
fi
echo "classex.dex injected"
echo
}
cleanup () {
rm -rf tmp
}
echo "Dedeox tool by @luca020400 ver $ver"
echo "It supports only LOLLIPOP"
echo "Every *.apk/*.jar and *.odex in odexed folder will be deodex and the clesses.dex will be injected into the *.apk/*.jar"
for l in `ls odexed/*.odex | sed "s/.odex//"`; do dedeox $l && inject $l; done
cleanup
echo "Done"