-
Notifications
You must be signed in to change notification settings - Fork 2
/
install.sh
138 lines (124 loc) · 4.14 KB
/
install.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
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
#!/usr/bin/env bash
set -xe
echo "removing any old files."
rm -rf ~/.config/autodroid
mkdir ~/.config/autodroid
cd ~/.config/autodroid
echo "Starting Installation."
git clone https://aur.archlinux.org/python-pyclip.git
cd python-pyclip || exit
makepkg -cfsi
cd ..
sudo rm -rf python-pyclip
sudo pacman -S dkms android-tools
# Determine the current kernel
current_kernel=$(uname -r)
echo "Current kernel version is $current_kernel"
# Prompt the user to choose which kernel headers to install
echo "Which kernel headers do you want to install?"
echo "1. linux-headers"
echo "2. linux-lts-headers"
echo "3. linux-zen-headers"
echo "4. linux-xanmod-anbox-headers"
echo "5. linux-xanmod-headers"
echo "6. I have my headers already"
read -r -p "Enter your choice (1-6): " choice
case $choice in
1)
if pacman -Qs "linux-headers" > /dev/null ; then
echo "linux-headers is already installed"
else
sudo pacman -S --noconfirm linux-headers
fi
sudo dkms install binder_linux/1.3.1 -k "$current_kernel"
sudo dkms install ashmem_linux/1.3.1 -k "$current_kernel"
;;
2)
if pacman -Qs "linux-lts-headers" > /dev/null ; then
echo "linux-lts-headers is already installed"
else
sudo pacman -S --noconfirm linux-lts-headers
fi
sudo dkms install binder_linux/1.3.1 -k "$current_kernel"
sudo dkms install ashmem_linux/1.3.1 -k "$current_kernel"
;;
3)
if pacman -Qs "linux-zen-headers" > /dev/null ; then
echo "linux-zen-headers is already installed"
else
sudo pacman -S --noconfirm linux-zen-headers
fi
;;
4)
if pacman -Qs "linux-xanmod-anbox-headers" > /dev/null ; then
echo "linux-xanmod-anbox-headers is already installed"
else
git clone https://aur.archlinux.org/linux-xanmod-anbox-headers.git
cd linux-xanmod-anbox-headers || exit
makepkg -cfsi
cd ..
sudo rm -rf linux-xanmod-headers
fi
;;
5)
if pacman -Qs "linux-xanmod-headers" > /dev/null ; then
echo "linux-xanmod-headers is already installed"
else
git clone https://aur.archlinux.org/linux-xanmod-headers.git
cd linux-xanmod-headers || exit
makepkg -cfsi
cd ..
sudo rm -rf linux-xanmod-headers
fi
;;
6)
echo "Skipping headers..."
;;
*)
echo "Invalid choice"
exit 1
;;
esac
# Install Waydroid
echo "Installing Waydroid, Waydroid Script and Waydroid Settings"
git clone https://aur.archlinux.org/waydroid-git.git
cd waydroid-git || exit
makepkg -cfsi
cd ..
sudo rm -rf waydroid-git
git clone https://github.com/casualsnek/waydroid_script
cd waydroid_script || exit
mv * ..
cd ..
git clone https://aur.archlinux.org/waydroid-settings-git.git
cd waydroid-settings-git || exit
makepkg -cfsi
cd ..
sudo rm -rf waydroid-settings-git
# Run Waydroid init
echo "Do you want to run Waydroid init? (y/n)"
read -r run_init
if [[ $run_init =~ ^[Yy]$ ]]; then
echo "Which version of Waydroid do you want to install? Vanilla(v) or GAPPS(g)"
read -r waydroid_version
if [[ $waydroid_version =~ ^[Gg]$ ]]; then
sudo waydroid init -s GAPPS -f
elif [[ $waydroid_version =~ ^[Vv]$ ]]; then
sudo waydroid init -f
else
echo "Invalid option entered. Please enter 'v' for Vanilla or 'g' for GAPPS."
fi
fi
# Ask user if they want to start and enable the waydroid-container.service
echo "Do you want to start and enable waydroid-container.service? (y/n)"
read -r start_service
if [[ $start_service =~ ^[Yy]$ ]]; then
# Start and enable waydroid-container.service
sudo systemctl start waydroid-container.service
sudo systemctl enable waydroid-container.service
echo "waydroid-container.service has been started and enabled."
else
echo "waydroid-container.service has not been started or enabled."
fi
echo "Installation complete. Reboot the system to start using Waydroid."
echo "To use Waydroid Script goto ~/.config/autodroid in Terminal & Enter Waydroid Script's Commands."