forked from termux/termux-app
-
Notifications
You must be signed in to change notification settings - Fork 1
/
recover
51 lines (50 loc) · 2.37 KB
/
recover
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
#!/data/data/com.termux/files/usr/bin/bash
function resetMobox(){
echo "moboxHomeEnv="$moboxHomeEnv
echo "pathEnv="$pathEnv
echo "winePathEnv="$winePathEnv
echo $moboxHomeEnv >> ~/.bashrc
echo $pathEnv >> ~/.bashrc
tar -xf ~/wine.tar -C $winePathEnv/lib/
cp -rf ~/wfm.exe $PREFIX/glibc/opt/apps/
cp -rf ~/winhandler.exe $PREFIX/glibc/opt/apps/
#sed -i '/"dinput"="builtin,native"/d' $PREFIX/glibc/opt/prefix/user.reg
#sed -i '/"dinput"="native,builtin"/d' $PREFIX/glibc/opt/prefix/user.reg
#sed -i '/"xinput1_4"="builtin,native"/d' $PREFIX/glibc/opt/prefix/user.reg
#sed -i '/"xinput1_4"="native,builtin"/d' $PREFIX/glibc/opt/prefix/user.reg
#sed -i '/"xinputuap"="builtin,native"/d' $PREFIX/glibc/opt/prefix/user.reg
#sed -i '/"xinputuap"="native,builtin"/d' $PREFIX/glibc/opt/prefix/user.reg
#sed -i '/^$/d' $PREFIX/glibc/opt/prefix/user.reg
sed -i 's/"dinput8"="native,builtin"/"dinput"="builtin,native"\n"dinput8"="builtin,native"/g' $PREFIX/glibc/opt/prefix/user.reg
sed -i 's/"xinput1_1"="native,builtin"/"xinput1_1"="builtin,native"/g' $PREFIX/glibc/opt/prefix/user.reg
sed -i 's/"xinput1_2"="native,builtin"/"xinput1_2"="builtin,native"/g' $PREFIX/glibc/opt/prefix/user.reg
sed -i 's/"xinput1_3"="native,builtin"/"xinput1_3"="builtin,native"\n"xinput1_4"="builtin,native"/g' $PREFIX/glibc/opt/prefix/user.reg
sed -i 's/"xinput9_1_0"="native,builtin"/"xinput9_1_0"="builtin,native"\n"xinputuap"="builtin,native"/g' $PREFIX/glibc/opt/prefix/user.reg
sed -i 's/\$PREFIX\/glibc\/opt\/apps\/tfm.exe/\$PREFIX\/glibc\/opt\/apps\/winhandler.exe/g' $PREFIX/glibc/opt/scripts/start-tfm
sed -i '/\$PREFIX\/glibc\/bin\/ib.exe/d' $PREFIX/glibc/opt/scripts/start-tfm
source ~/.bashrc
}
if [ -f ~/.bashrc ];then
echo ".bashrc already exist"
else
touch ~/.bashrc
fi
if [ -d "${PREFIX}/glibc" ];then
echo "mobox installed"
moboxHomeEnv="export MOBOX_HOME=\$PREFIX/glibc"
pathEnv="export PATH=\$PATH:\$MOBOX_HOME/opt/scripts"
prefixPath=$(echo $PREFIX)
winePath=$(cat $PREFIX/glibc/opt/conf/wine_path.conf|grep "WINE_PATH="|cut -d= -f2|sed 's/$PREFIX//g')
winePathEnv=$prefixPath$winePath
if [ $MOBOX_HOME ];then
echo "mobox env has been set, now update"
sed -i '/MOBOX_HOME/d' ~/.bashrc
sed -i '/^$/d' ~/.bashrc
resetMobox
else
echo "mobox env not set, now set"
resetMobox
fi
else
echo "mobox not installed"
fi