-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·282 lines (204 loc) · 7.78 KB
/
install
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
#!/bin/bash
clear
printf "\n"
printf "\n"
printf "\n"
echo -e "===================================================================="
echo -e "= Quest(1/2) sideloader for Linux & Mac(OSX) ======================="
echo -e "===================================================================="
echo -e "========================================= by Whitewhidow/BranchBit ="
echo -e "===================================== support:contact@branchbit.be ="
echo -e "============================== https://t.me/whitewhidow_q2_working ="
echo -e "================ www.github.com/whitewhidow/quest-sideloader-linux ="
echo -e "===================================================================="
printf "\n"
case "$OSTYPE" in
linux*) OSTYPE="linux" ;;
darwin*) OSTYPE="mac" ;;
*) echo "unknown OS: $OSTYPE DETECTED" && echo "please submit a ticket om github?" && sleep 30 && exit ;;
esac
function failed(){
LINE="\n\nInstall seems to have failed with the following reason:\n\n$1.\n\nPlease paste the terminal output to github,\nI will gladly assist! \n"
echo -e "$LINE"
read -p "Press [ENTER] to continue." < "$(tty 0>&2)"
exit 1
}
echo "CHECKING AND INSTALLING DEPENDENCIES:"
if [ $OSTYPE == "mac" ]; then
echo "Checking brew for mac."
if ! command -v brew &> /dev/null; then
echo "-> Please wait while we attempt to install missing 'brew' package. (requires sudo)"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" && echo "Brew installed."
fi
if ! command -v git &> /dev/null; then
failed "Brew could not be installed ?"
else
echo "Brew installed at $(which brew)"
fi
echo "Checking xcode command line tools for mac."
echo "test: $(xcode-select -p)"
if ! xcode-select -p 1>/dev/null ; then
echo "-> Please wait while we attempt to install xcode command line tools"
xcode-select --install && echo "Xcode command line tools installed."
fi
if ! xcode-select -p 1>/dev/null ; then
echo 'STILL NOT INSTALLED XCODE SHIT'
exit 1
else
echo "Xcode installed"
fi
echo "Checking OSXFUSE for mac."
[ -f "/usr/local/include/osxfuse/fuse.h" ] && OLDFUSE=true
if [[ -z $OLDFUSE ]]; then
brew cask install osxfuse
[ -f "/usr/local/include/osxfuse/fuse.h" ] && NEWFUSE=true
fi
fi
echo "Checking git installation."
if ! command -v git &> /dev/null; then
echo "-> Please wait while we attempt to install missing 'git' package. (requires sudo)"
(sudo apt install git 2> /dev/null || brew install git ) && echo "Git installed."
fi
if ! command -v git &> /dev/null; then
failed "Git could not be installed ?"
else
echo "Git installed at $(which git)"
fi
echo "Checking dialog installation."
if ! command -v dialog &> /dev/null; then
echo "-> Please wait while we attempt to install missing 'dialog' package. (requires sudo)"
(sudo apt install dialog 2> /dev/null || brew install dialog )
fi
if ! command -v dialog &> /dev/null; then
failed "Dialog could not be installed ?"
else
echo "Dialog installed at $(which dialog)"
fi
echo "Checking unzip installation."
if ! command -v unzip &> /dev/null; then
echo "-> Please wait while we attempt to install missing 'unzip' package. (requires sudo)"
(sudo apt install unzip 2> /dev/null || brew install unzip )
fi
if ! command -v unzip &> /dev/null; then
failed "Unzip could not be installed ?"
else
echo "Unzip installed at $(which unzip)"
fi
echo "Checking adb."
if ! command -v adb &> /dev/null; then
if [ "$OSTYPE" == "mac" ]; then
brew cask install android-platform-tools
fi
if [ "$OSTYPE" == "linux" ]; then
echo "-> Please wait while we attempt to install missing 'adb' package. (requires sudo)"
sudo apt install android-tools-adb 2> /dev/null
fi
fi
if ! command -v adb &> /dev/null; then
failed "Adb could not be installed ?"
else
echo "Adb installed at $(which adb)"
fi
echo "Checking aapt."
if ! command -v aapt &> /dev/null; then
if [ "$OSTYPE" == "linux" ]; then
echo "-> Please wait while we attempt to install missing 'aapt' package. (requires sudo)"
sudo apt install android-sdk-build-tools
fi
if [ "$OSTYPE" == "mac" ]; then
echo "-> Please wait while we attempt to install missing 'aapt' package. (requires sudo)"
curl -s https://raw.githubusercontent.com/whitewhidow/quest-sideloader-linux/main/mac_aapt_lib/aapt -o aapt
#https://dl.androidaapt.com/aapt-macos.zip
chmod +x ./aapt
sudo cp ./aapt /usr/local/bin/
fi
fi
if ! command -v aapt &> /dev/null; then
failed "Aapt could not be installed ?"
else
echo "Aapt installed at $(which aapt)"
fi
echo "Checking pv."
if ! command -v pv &> /dev/null; then
echo "-> Please wait while we attempt to install missing 'pv' package. (requires sudo)"
(sudo apt install pv 2> /dev/null || brew install pv)
fi
if ! command -v pv &> /dev/null; then
failed "pv could not be installed !"
else
echo "pv installed at $(which pv)"
fi
echo "Checking wmctrl."
if ! command -v wmctrl &> /dev/null; then
echo "-> Please wait while we attempt to install missing 'wmctrl' package. (requires sudo)"
(sudo apt install wmctrl 2> /dev/null || (brew cask install xquartz && brew install wmctrl))
fi
if ! command -v wmctrl &> /dev/null; then
failed "Wmctrl could not be installed !"
else
echo "Wctrl installed at $(which wmctrl)"
fi
echo "Checking rclone."
#big sur maybe needs instead : https://rclone.org/install/#macos-installation-from-precompiled-binary-using-curl
if ! command -v rclone &> /dev/null; then
echo "-> Please wait while we attempt to install missing 'rclone' package. (requires sudo)"
curl --silent https://rclone.org/install.sh | sudo bash > /dev/null
if [ $OSTYPE == "mac" ]; then
brew install rclone
fi
fi
if ! command -v rclone &> /dev/null; then
failed "Rclone could not be installed ?"
else
echo "Rclone installed at $(which rclone)"
RCLONEINSTALLED=true
fi
BRANCH="main"
if [ ! -z "$1" ]; then
BRANCH="$1"
fi
if [[ "$BRANCH" == "local" ]]; then
echo -ne ""
fi
echo "Fetching newest version ($BRANCH)."
OLDPATH="$PWD"
if [[ "$BRANCH" == "local" ]]; then
cd $OLDPATH
else
cd /tmp
rm -rf ./quest-sideloader-linux
git clone https://github.com/whitewhidow/quest-sideloader-linux.git
cd quest-sideloader-linux
git checkout $BRANCH
fi
echo "Copying executables to PATH (requires sudo)"
sudo cp ./install /usr/local/bin/sideload-update
sudo cp ./sideloader-config /usr/local/bin/sideloader-config
sudo cp ./sideload /usr/local/bin/sideload
sudo cp ./sideload-browser /usr/local/bin/sideload-browser
sudo cp ./sideload-gui /usr/local/bin/sideload-gui
sudo cp ./sideload-mount /usr/local/bin/sideload-mount
sudo cp ./sideload-wifi /usr/local/bin/sideload-wifi
sudo cp ./sideload-change-settings /usr/local/bin/sideload-change-settings
sudo cp ./sideload-change-username /usr/local/bin/sideload-change-username
sudo cp ./sideload-change-rate /usr/local/bin/sideload-change-rate
sudo cp ./sideload-change-res /usr/local/bin/sideload-change-res
sudo cp ./sideload-check-updates /usr/local/bin/sideload-check-updates
sudo cp ./sideload-updatebadges /usr/local/bin/sideload-updatebadges
VERSION=$(git rev-parse HEAD)
mkdir -p $HOME/quest-sideloader-linux
touch $HOME/quest-sideloader-linux/sideloader-version.txt
echo "$VERSION" > $HOME/quest-sideloader-linux/sideloader-version.txt
cd $OLDPATH
# IF INSTALL SUCCESS AND INSTALLED NEW OSXFUSE
if [ ! -z $NEWFUSE ]; then
SUCCESS="\n\n -> Install was almost successfull.\n\nHowever your system will need to reboot because (you are one mac osx) and we have just installed OSXFUSE.\n\n -> Please reboot and re-run this installer.\n\n\n"
echo -e "$SUCCESS"
else
# IF INSTALL SUCCESS AND NO NEW OSXFUSE INSTALLED
[ -z $CI ] && dialog --title "Success" --yesno "\n\n -> Install seems to have been successfull\n\nStart sideload-gui now?\n\n" 0 0
if [ $? = 0 ]; then
exec /usr/local/bin/sideload-gui
fi
fi
exit 0