-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup
executable file
·116 lines (104 loc) · 3.59 KB
/
setup
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
#!/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 <manual/apt/>$Y
╰[manual]─➤$W automate installation with this script command by command$Y
╰[apt(recommend)]─➤$W Installation over advance package tool(apt)""";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
wget --tries=20 --progress=dot $GIT/termux-packages/gh-pages/ivam3-termux-packages.list \
-O $PREFIX/etc/apt/sources.list.d/ivam3-termux-packages.list
apt update && yes|apt upgrade
}
manually(){
printf "$G(_>)─➤$W Upgrading and installing dependecies.\n"
apt update && yes|apt upgrade
yes|apt install ruby git wget axel tar aapt apksigner openjdk-17
instaAPKtool
command -v msfconsole >/dev/null || {
printf "$R\n(_>)─➤$W Metasploit-framework 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 metasploit-framework
} || {
printf >&2 "$R(_>)─➤$W Metasploit is needed, please install it... Aborting."
exit 1
}
}
printf "$Y(_>)─➤$W Fixing argument '-x' in metasploit.\n"
wget --tries=20 --quiet $GIT/java/master/.embed/apk.rb \
-O $PREFIX/opt/metasploit-framework/lib/msf/core/payload/apk.rb
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
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
manual) manually;;
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.