-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathflutter-spy.sh
110 lines (96 loc) · 3.51 KB
/
flutter-spy.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
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
if ! command -v termux-setup-storage; then
echo "This script can be executed only on Termux"
exit 1
fi
termux-setup-storage
cd $HOME
pkg update
pkg upgrade -y
pkg i -y ncurses-utils
green="$(tput setaf 2)"
nocolor="$(tput sgr0)"
red="$(tput setaf 1)"
blue="$(tput setaf 32)"
yellow="$(tput setaf 3)"
note="$(tput setaf 6)"
echo "${green}━━━ Basic Requirements Setup ━━━${nocolor}"
pkg i -y python git cmake rust golang clang make wget ndk-sysroot zlib libxml2 libxslt pkg-config python-cryptography libjpeg-turbo which
LDFLAGS="-L${PREFIX}/lib/" CFLAGS="-I${PREFIX}/include/" pip install --upgrade wheel pillow
pip install cython setuptools
CFLAGS="-Wno-error=incompatible-function-pointer-types -O0" pip install lxml
echo "${green}━━━ Starting JADX installation ━━━${nocolor}"
if [ -d "$PREFIX/lib/jadx" ]; then
echo "${red}Seems like JADX is already installed, skipping...${nocolor}"
else
cd $HOME
wget https://github.com/skylot/jadx/releases/download/v1.5.0/jadx-1.5.0.zip
mkdir -p $PREFIX/lib/jadx
unzip jadx-1.5.0.zip -d $PREFIX/lib/jadx
fi
echo "${yellow}JADX Successfully Installed!${nocolor}"
echo "${green}━━━ Starting SDK Tools installation ━━━${nocolor}"
if [ -d "android-sdk" ]; then
echo "${red}Seems like sdk tools already installed, skipping...${nocolor}"
elif [ -d "androidide-tools" ]; then
rm -rf androidide-tools
git clone https://github.com/AndroidIDEOfficial/androidide-tools
cd androidide-tools/scripts
./idesetup -c
else
git clone https://github.com/AndroidIDEOfficial/androidide-tools
cd androidide-tools/scripts
./idesetup -c
fi
echo "${yellow}ANDROID SDK TOOLS Successfully Installed!${nocolor}"
cd $HOME
echo
echo "${green}━━━ Setting up apktool ━━━${nocolor}"
if [ -f "$PREFIX/bin/apktool.jar" ]; then
echo "${blue}apktool is already installed${nocolor}"
else
sh -c 'wget https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.9.3.jar -O $PREFIX/bin/apktool.jar'
chmod +r $PREFIX/bin/apktool.jar
sh -c 'wget https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool -O $PREFIX/bin/apktool' && chmod +x $PREFIX/bin/apktool || exit 2
fi
echo "${yellow}apktool Successfully Installed!${nocolor}"
echo
echo "${green}━━━ Starting flutter-spy installation ━━━${nocolor}"
cd $HOME
if [ -d "flutter-spy" ]; then
rm -rf flutter-spy
git clone https://github.com/anasfik/flutter-spy
cd flutter-spy
chmod +x INSTALLER.sh
./INSTALLER.sh || exit 2
else
git clone https://github.com/anasfik/flutter-spy
cd flutter-spy
chmod +x INSTALLER.sh
./INSTALLER.sh || exit 2
fi
echo "${yellow}Made with ⌨ by Abhi${nocolor}"
if [ -f "~/.bashrc" ]; then
cat <<- EOL >> ~/.bashrc
export ANDROID_HOME=$HOME/android-sdk
export PATH=$PATH:$HOME/android-sdk/cmdline-tools/latest/bin
export PATH=$PATH:$HOME/android-sdk/platform-tools
export PATH=$PATH:$HOME/android-sdk/build-tools/34.0.4
export PATH=$PATH:$PREFIX/lib/jadx/bin
EOL
elif [ -f "~/.zshrc" ]; then
cat <<- EOL >> ~/.zshrc
export ANDROID_HOME=$HOME/android-sdk
export PATH=$PATH:$HOME/android-sdk/cmdline-tools/latest/bin
export PATH=$PATH:$HOME/android-sdk/platform-tools
export PATH=$PATH:$HOME/android-sdk/build-tools/34.0.4
export PATH=$PATH:$PREFIX/lib/jadx/bin
EOL
else
cat <<- EOL >> $PREFIX/etc/bash.bashrc
export ANDROID_HOME=$HOME/android-sdk
export PATH=$PATH:$HOME/android-sdk/cmdline-tools/latest/bin
export PATH=$PATH:$HOME/android-sdk/platform-tools
export PATH=$PATH:$HOME/android-sdk/build-tools/34.0.4
export PATH=$PATH:$PREFIX/lib/jadx/bin
EOL
fi