3 echo "Generating device properties"
4 GRALLOC
=`getprop ro.hardware.gralloc`
5 if [ -z $GRALLOC ] || [ ! -f /vendor
/lib
/hw
/gralloc.
$GRALLOC.so
]; then
6 GRALLOC
=`getprop ro.hardware`
7 if [ -z $GRALLOC ] || [ ! -f /vendor
/lib
/hw
/gralloc.
$GRALLOC.so
]; then
8 GRALLOC
=`getprop ro.product.board`
9 if [ -z $GRALLOC ] || [ ! -f /vendor
/lib
/hw
/gralloc.
$GRALLOC.so
]; then
10 GRALLOC
=`getprop ro.board.platform`
11 if [ -z $GRALLOC ] || [ ! -f /vendor
/lib
/hw
/gralloc.
$GRALLOC.so
]; then
12 GRALLOC
=`getprop ro.arch`
13 if [ -z $GRALLOC ] || [ ! -f /vendor
/lib
/hw
/gralloc.
$GRALLOC.so
]; then
20 EGL
=`getprop ro.hardware.egl`
21 if [ ! -z $EGL ]; then
22 EGL_PROP
="ro.hardware.egl=${EGL}"
25 MEDIA_PROFILES
=`getprop media.settings.xml`
26 if [ ! -z $MEDIA_PROFILES ]; then
27 MEDIA_PROFILES_EXTRA
=`getprop media.settings.xml | sed "s/vendor/vendor_extra/" | sed "s/odm/odm_extra/"`
28 MEDIA_PROFILES_PROP
="media.settings.xml=${MEDIA_PROFILES_EXTRA}"
31 echo "Asking for root access"
38 # remove LD_LIBRARY_PATH from /etc/environment to make life easier
39 if ! grep -q "#LD_LIBRARY_PATH" /etc/environment; then
40 sed -i -e "s/^LD_LIBRARY_PATH/#LD_LIBRARY_PATH/" /etc/environment
43 echo "Installing packages"
45 apt install -y qtwayland5 qml-module-qtwayland-compositor
46 rm anbox-sensors_0.1.0_arm64.deb
47 wget https://github.com/Anbox-halium/anbox-sensors/releases/download/v0.1.0/anbox-sensors_0.1.0_arm64.deb
48 dpkg -i anbox-sensors_0.1.0_arm64.deb
50 echo "Geting anbox images"
51 if [ -f anbox_arm64_system.img ]; then
52 mv anbox_arm64_system.img anbox_arm64_system.img.bak
53 mv anbox_arm64_vendor.img anbox_arm64_vendor.img.bak
55 rm -f latest-raw-images.zip
56 wget https://build.lolinet.com/file/lineage/anbox_arm64/latest-raw-images.zip
57 unzip latest-raw-images.zip
59 echo "Geting latest runner script"
60 rm -f run-container.sh
61 wget https://github.com/Anbox-halium/anbox-halium/raw/lineage-17.1/scripts/run-container.sh
62 chmod +x run-container.sh
64 if [ -f anbox.prop ]; then
65 mv anbox.prop anbox.prop.bak
67 if grep -q "spurv.display_height" anbox.prop.bak; then
68 grep "spurv.display_height" anbox.prop.bak >> anbox.prop
70 echo "NOTE: Edit /home/anbox/anbox.prop based on your device screen resolution"
71 echo "spurv.display_height=1920" >> anbox.prop
73 if grep -q "spurv.display_width" anbox.prop.bak; then
74 grep "spurv.display_width" anbox.prop.bak >> anbox.prop
76 echo "NOTE: Edit /home/anbox/anbox.prop based on your device screen resolution"
77 echo "spurv.display_width=1080" >> anbox.prop
79 echo "ro.hardware.gralloc=${GRALLOC}" >> anbox.prop
80 echo "${EGL_PROP}" >> anbox.prop
81 echo "${MEDIA_PROFILES_PROP}" >> anbox.prop
83 echo "Geting latest lxc config"
84 mkdir /var/lib/lxc/anbox
87 wget https://github.com/Anbox-halium/anbox-halium/raw/lineage-17.1/lxc-configs/config
89 if ! grep -q "module-native-protocol-unix auth-anonymous=1" /etc/pulse/touch-android9.pa; then
90 echo "Pulseaudio config patching"
91 sed -i "s/module-native-protocol-unix/module-native-protocol-unix auth-anonymous=1/" /etc/pulse/touch-android9.pa
94 if [ ! -f /etc/gbinder.d/anbox.conf ]; then
95 echo "Adding gbinder config"
98 wget https://github.com/Anbox-halium/anbox-halium/raw/lineage-17.1/gbinder/anbox.conf
101 mount -o remount,ro /
103 echo "Going back to phablet user"
107 echo "Installing anbox launcher"
108 rm anbox.rudiimmer_1.0_all.click
109 wget https
://build.lolinet.com
/file
/lineage
/anbox_arm
64/anbox.rudiimmer_1.0_all.click
110 pkcon
install-local anbox.rudiimmer_1.0_all.click
--allow-untrusted
112 echo "Restarting Pulseaudio service"
113 initctl
--user stop pulseaudio
114 initctl
--user start pulseaudio
116 echo "Installing Finished!"
117 echo "Run anbox container with /home/anbox/run-container.sh on terminal"