3 SUPPORTED_ARCHS
="x86_64 aarch64 armv8l"
6 for a
in $SUPPORTED_ARCHS; do
7 if [ $UNAME_ARCH == $a ]; then
11 if [ -z ${ARCH} ]; then
12 echo "ERROR: Your system with arch $UNAME_ARCH is not supported"
15 if [ $UNAME_ARCH == "aarch64" ]; then
18 if [ $UNAME_ARCH == "armv8l" ]; then
21 if [ $UNAME_ARCH == "armv7l" ]; then
24 if [ $UNAME_ARCH == "i386" ]; then
27 if [ $UNAME_ARCH == "i686" ]; then
31 echo "Generating device properties"
32 rm -f generate
-props.sh
33 wget https
://github.com
/Anbox
-halium/anbox
-halium/raw
/lineage
-17.1
/scripts
/generate
-props.sh
34 chmod +x generate
-props.sh
37 echo "Asking for root access"
44 # remove LD_LIBRARY_PATH from /etc/environment to make life easier
45 if ! grep -q "#LD_LIBRARY_PATH" /etc/environment; then
46 sed -i -e "s/^LD_LIBRARY_PATH/#LD_LIBRARY_PATH/" /etc/environment
49 echo "Installing packages"
51 apt install -y lxc1 qtwayland5 qml-module-qtwayland-compositor
52 apt install -y libgbinder sensorfw-qt5 libsensorfw-qt5-plugins || touch NO_SENSORS
53 if [ ! -f NO_SENSORS ]; then
54 rm anbox-sensors_0.1.0_${ARCH}.deb
55 wget https://github.com/Anbox-halium/anbox-sensors/releases/download/v0.1.0/anbox-sensors_0.1.0_${ARCH}.deb
56 dpkg -i anbox-sensors_0.1.0_${ARCH}.deb || touch NO_SENSORS
59 echo "Geting anbox images"
60 if [ -f anbox_${ARCH}_system.img ]; then
61 mv anbox_${ARCH}_system.img anbox_${ARCH}_system.img.bak
62 mv anbox_${ARCH}_vendor.img anbox_${ARCH}_vendor.img.bak
64 rm -f latest-raw-images.zip
65 wget https://build.lolinet.com/file/lineage/anbox_${ARCH}/latest-raw-images.zip
66 unzip latest-raw-images.zip
67 mkdir -p /home/anbox/rootfs
68 mkdir -p /home/anbox/data
70 echo "Geting latest runner script"
71 rm -f run-container.sh
72 wget https://github.com/Anbox-halium/anbox-halium/raw/lineage-17.1/scripts/run-container.sh
73 chmod +x run-container.sh
74 rm -f stop-container.sh
75 wget https://github.com/Anbox-halium/anbox-halium/raw/lineage-17.1/scripts/stop-container.sh
76 chmod +x stop-container.sh
78 wget https://github.com/Anbox-halium/anbox-halium/raw/lineage-17.1/scripts/anbox-net.sh
81 if [ -f anbox.prop ]; then
82 mv anbox.prop anbox.prop.bak
84 if grep -q "anbox.display_height" anbox.prop.bak; then
85 grep "anbox.display_height" anbox.prop.bak >> anbox.prop
87 echo "NOTE: Edit /home/anbox/anbox.prop based on your device screen resolution"
88 echo "anbox.display_height=1920" >> anbox.prop
90 if grep -q "anbox.display_width" anbox.prop.bak; then
91 grep "anbox.display_width" anbox.prop.bak >> anbox.prop
93 echo "NOTE: Edit /home/anbox/anbox.prop based on your device screen resolution"
94 echo "anbox.display_width=1080" >> anbox.prop
96 echo "${GRALLOC_PROP}" >> anbox.prop
97 echo "${EGL_PROP}" >> anbox.prop
98 echo "${MEDIA_PROFILES_PROP}" >> anbox.prop
99 echo "${CCODEC_PROP}" >> anbox.prop
100 echo "${EXT_LIB_PROP}" >> anbox.prop
101 echo "${VULKAN_PROP}" >> anbox.prop
102 echo "${DPI_PROP}" >> anbox.prop
103 echo "${GLES_VER_PROP}" >> anbox.prop
104 echo "${XDG_PROP}" >> anbox.prop
105 echo "${WAYLAND_DISP_PROP}" >> anbox.prop
106 echo "${PULSE_PROP}" >> anbox.prop
107 if [ -f NO_SENSORS ]; then
108 echo "anbox.stub_sensors_hal=1" >> anbox.prop
112 # TODO: Get rid of this
113 rm -f vendor-fixup.sh
114 wget https://github.com/Anbox-halium/anbox-halium/raw/lineage-17.1/scripts/vendor-fixup.sh
115 chmod +x vendor-fixup.sh
116 ./vendor-fixup.sh $ARCH
118 echo "Geting latest lxc config"
119 mkdir /var/lib/lxc/anbox
120 cd /var/lib/lxc/anbox
122 wget https://github.com/Anbox-halium/anbox-halium/raw/lineage-17.1/lxc-configs/config
123 sed -i "s/LXCARCH/$UNAME_ARCH/" config
125 if ! grep -q "module-native-protocol-unix auth-anonymous=1" /etc/pulse/touch-android9.pa; then
126 echo "Pulseaudio config patching"
127 sed -i "s/module-native-protocol-unix/module-native-protocol-unix auth-anonymous=1/" /etc/pulse/touch-android9.pa
130 if [ ! -f /etc/gbinder.d/anbox.conf ]; then
131 echo "Adding gbinder config"
134 wget https://github.com/Anbox-halium/anbox-halium/raw/lineage-17.1/gbinder/anbox.conf
137 mount -o remount,ro /
139 echo "Going back to phablet user"
143 echo "Installing anbox launcher"
144 rm anbox.rudiimmer_1.0_all.click
145 wget https
://build.lolinet.com
/file
/lineage
/anbox_
${ARCH}/anbox.rudiimmer_1.0_all.click
146 pkcon
install-local anbox.rudiimmer_1.0_all.click
--allow-untrusted
148 echo "Restarting Pulseaudio service"
149 initctl
--user stop pulseaudio
150 initctl
--user start pulseaudio
152 echo "Installing Finished!"
153 echo "Run anbox container with \"sudo /home/anbox/run-container.sh\" on terminal"
154 echo "Stop anbox container with \"sudo /home/anbox/stop-container.sh\" on terminal"