-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathsetup
More file actions
executable file
·140 lines (124 loc) · 4.14 KB
/
setup
File metadata and controls
executable file
·140 lines (124 loc) · 4.14 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#!/system/bin/env bash
# Coded by Ivam3 on Ago 2018
#set -euo pipefail
IFS=$'\n\t'
trap ctrl_c 2
ctrl_c(){ printf "$Y\n\n [¿] Need a help [?]$B\nTelegram : t.me/Ivam3_Bot$W\n\n";exit;}
GIT="https://raw.githubusercontent.com/ivam3"
apktoolV="2.7.0"
apktool_releases="https://github.com/iBotPeaches/Apktool/releases/download/v$apktoolV/apktool_$apktoolV.jar"
R='\033[1;31m'
G='\033[1;32m'
Y='\033[1;33m'
B='\033[1;34m'
M='\033[1;35m'
C='\033[1;36m'
W='\033[0m'
usage(){ printf """$Y[usage]:$W ./setup <option>$Y
╰[apt(recommend)]─➤$W Installation over advance package tool(apt)
╰[apktool]─➤$W Install a diferent version of apktool$Y
╰[java8]─➤$W deprecate openjdk at version 8$Y
╰[keystore]─➤$W Download andoird keystore into ~/.android PATH$Y
╰[install]─➤$W Install manually all dependecies$Y
""";exit 0
}
instajava8() {
printf "$G(_>)─➤$W Installing JAVA_[it could take a while]\n"
git clone --quiet https://github.com/ivam3/java.git $PREFIX/share/java >/dev/null 2>&1
if [ -d $PREFIX/share/java ]; then
cd $PREFIX/share/java
chmod -R 711 $PREFIX/share/java
bash $PREFIX/share/java/setup java8
rm -rf $PREFIX/share/java
else
printf "$R(_>)_ERR─➤$W java donwload fail.\n"
ctrl_c
fi
}
instaAPKtool(){
[[ -d ${PREFIX}/var/spool ]] || mkdir -p ${PREFIX}/var/spool
wget --tries=20 --progress=dot $apktool_releases -O $PREFIX/var/spool/apktool.jar
cat <<- CONF > $PREFIX/bin/apktool
#!/usr/bin/bash
#COLORS
W="\e[0m"
R="\e[31m"
G="\e[32m"
Y="\e[33m"
B="\e[34m"
dirPATH="${PREFIX}/var/spool/"
if [[ -e \$dirPATH/\$(basename \$0).jar ]]
then
exec \$(command -v java) -jar \$dirPATH/\$(basename \$0).jar \${@:1}
else
echo -en \$R"E:\$W \$(basename \$0) PATH missing ...\$Y Aborting.\$W"
exit 1
fi
CONF
chmod 751 $PREFIX/bin/apktool
}
aptKey(){
mkdir -p $PREFIX/etc/apt/sources.list.d
yes|apt install wget gnupg
curl -s https://raw.githubusercontent.com/ivam3/termux-packages/gh-pages/ivam3-termux-packages.list \
-o ${PREFIX}/etc/apt/sources.list.d/ivam3-termux-packages.list
curl -fsSL "https://raw.githubusercontent.com/ivam3/termux-packages/gh-pages/dists/stable/public_key.gpg" \
|gpg --dearmor|tee "$PREFIX/etc/apt/trusted.gpg.d/ivam3.gpg" >/dev/null
apt update && yes|apt upgrade
}
androidKeystore(){
printf "$Y(_>)─➤$W Downloading an android keystore.$W\n"
[[ -d ~/.android ]] || mkdir ~/.android
[[ -d $PREFIX/opt/metasploit-framework/lib/msf/core/payload ]] || mkdir -p $PREFIX/opt/metasploit-framework/lib/msf/core/payload
wget --tries=20 --quiet $GIT/java/master/.embed/apk.rb \
-O $PREFIX/opt/metasploit-framework/lib/msf/core/payload/apk.rb
wget --tries=20 --quiet $GIT/embed/master/.IbyC/debug.keystore \
-O ~/.android/debug.keystore
}
install(){
printf "$G(_>)─➤$W Upgrading and installing dependecies.\n"
apt update && yes|apt upgrade
yes|apt install ruby git wget axel tar aapt apksigner openjdk-21
instaAPKtool
for i in metasploit-framework xml2axml; do
case $i in
metasploit-framework)
cmd="msfconsole"
pkg=$i
;;
xml2axml)
cmd=pkg=$i
;;
esac
command -v $cmd >/dev/null || {
printf "$R\n(_>)─➤$W $pkg is not in PATH\n ╰────|Do you wanna install it [y/n] ?\n"
while read -p " ╰[y/n]─➤ " answ && [ -z $answ ]; do
continue
done
[[ $answ = 'y' ]] || [[ $answ = 'Y' ]] && {
aptKey
yes|apt install $pkg
} || {
printf >&2 "$R(_>)─➤$W $pkg is needed, please install it... Aborting."
exit 1
}
}
done
}
androidKeystore
printf "$Y(_>)─➤$W Installing ruby gems.\n"
gem install bundle
bundle update --bundler
bundle install -j$(nproc --all) --verbose
}
[[ $# -eq '0' ]] && { usage;}
case $1 in
install) install;;
keystore) androidKeystore;;
apt) aptKey;yes|apt install metasploit-framework embed;;
apktool) instaAPKtool;;
java8) instajava8;;
*) usage;;
esac
printf "$Y\n(_>)-> ::::::::::::::: DONE !! :::::::::::::::: <-(<_)$G\n\tTo fix issues going to$B t.me/Ivam3_Bot$W\n"
# @Ivam3.