Repository navigation
Expand file tree
/
Copy pathsetup.sh
More file actions
148 lines (112 loc) · 3.57 KB
/
Copy pathsetup.sh
File metadata and controls
148 lines (112 loc) · 3.57 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
141
142
143
144
145
146
147
148
#!/bin/bash
if [ "$(ls $PREFIX | grep glibc)" == "glibc" ] || [ -d /sdcard/androBox ]
then
echo -e "I have detected an already existing install. I will proceed to wipe it now".
rm -rf $PREFIX/glibc /sdcard/androBox
fi
cleanup(){
rm -rf $HOME/glibc_prefix.tar.xz $HOME/wine-9.0-amd64.tar.xz ~/setup.sh
exit
}
install_repo_files(){
git clone --depth=1 https://github.com/Pipetto-crypto/androBox.git -b androBoxNew
for item in $HOME/androBox/scripts/*
do
if [ ! -d $item ]
then
chmod +x $item && mv $item $PREFIX/bin
else
chmod -R 777 $item
cp -r $item $PREFIX/glibc/opt
fi
done
wget https://github.com/Pipetto-crypto/androBox-extra/raw/master/programs.tar.xz -P $HOME
tar -xf $HOME/programs.tar.xz -C $HOME
mv $HOME/Programs $PREFIX/glibc/opt
mv $HOME/androBox/androBox $PREFIX/bin && chmod +x $PREFIX/bin/androBox
mkdir -p /sdcard/androBox
mv $HOME/androBox/configs/* /sdcard/androBox
}
install_glibc_pfx(){
glibc_sha1sum="2401d6bef70834d71211daf1822f215bd4709d92"
[[ ! -f $HOME/glibc_prefix.tar.xz ]] && wget https://github.com/Pipetto-crypto/androBox/releases/download/glibc_prefix/glibc_prefix.tar.xz -P $HOME
if [ -f $HOME/glibc_prefix.tar.xz ]
then
curr_glibc_sha1sum="$(sha1sum $HOME/glibc_prefix.tar.xz | awk '{print $1}')"
if [ $curr_glibc_sha1sum == $glibc_sha1sum ]
then
tar -xf $HOME/glibc_prefix.tar.xz -C $PREFIX
else
echo -e "glibc archive sha1sum mismatch, leaving..."
cleanup
fi
else
echo -e "Unable to find the glibc archive, leaving..."
cleanup
fi
}
install_wine(){
wine_sha1sum="a94354f6f15b492b8cb6e94291ff3b2147883100"
echo -e "\nInstalling latest wine devel"
[[ ! -f $HOME/wine-9.0-amd64.tar.xz ]] && wget https://github.com/Pipetto-crypto/androBox/releases/download/wine-9.0-rc4/wine-9.0-amd64.tar.xz -P $HOME
if [ -f $HOME/wine-9.0-amd64.tar.xz ]
then
curr_wine_sha1sum="$(sha1sum $HOME/wine-9.0-amd64.tar.xz | awk '{print $1}')"
if [ "$curr_wine_sha1sum" == "$wine_sha1sum" ]
then
tar -xf $HOME/wine-9.0-amd64.tar.xz -C $PREFIX/glibc/opt
else
echo -e "wine archive sha1sum mismatch, leaving..."
cleanup
fi
else
echo -e "Unable to find the wine archive, leaving..."
cleanup
fi
}
do_prefix_creation(){
env BOX64_LD_LIBRARY_PATH=$PREFIX/glibc/lib/x86_64-linux-gnu \
BOX64_PATH=$PREFIX/glibc/opt/wine/bin \
LD_PRELOAD= \
WINEESYNC=0 \
BOX64_LOG=1 \
WINEDEBUG="+err" \
WINEDLLOVERRIDES="mscoree=" \
$PREFIX/glibc/bin/box64 wine64 wineboot >$HOME/wine_log.txt 2>&1
sleep 3
pfxupdate
}
echo -e "\nInstalling required dependencies"
pkg upgrade -y
pkg install x11-repo tur-repo -y
pkg install pulseaudio git virglrenderer-android mesa wget fontconfig freetype libpng termux-x11-nightly cabextract zenity openbox file xorg-xrandr xterm iconv termux-exec nnn -y
if [ ! -d ~/storage ]
then
echo -e "\nGranting internal storage permissions"
termux-setup-storage
sleep 25
fi
if [ ! -d ~/storage ]
then
echo -e "\nStorage is still not set, I will retry again"
termux-setup-storage
sleep 25
fi
if [ ! -d ~/storage ]
then
echo -e "I couldn't setup storage, I will leave now"
exit
fi
if [ -d ~/storage ]
then
touch /sdcard/tmp.txt
[[ ! -f /sdcard/tmp.txt ]] && echo -e "Seems like storage permissions are not set properly. I can't do anything else, set them manually and retry" && exit
rm -rf /sdcard/tmp.txt
fi
install_glibc_pfx
install_wine
install_repo_files
echo "check_certificate = off" > $HOME/.wgetrc
rm -rf $HOME/androBox && rm -rf $HOME/.wine
do_prefix_creation
cleanup