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}"
30 CCODEC
=`getprop debug.stagefright.ccodec`
31 if [ ! -z $CCODEC ]; then
32 CCODEC_PROP
="debug.stagefright.ccodec=${CCODEC}"
35 echo "Asking for root access"
42 # remove LD_LIBRARY_PATH from /etc/environment to make life easier
43 if ! grep -q "#LD_LIBRARY_PATH" /etc/environment; then
44 sed -i -e "s/^LD_LIBRARY_PATH/#LD_LIBRARY_PATH/" /etc/environment
47 echo "Installing packages"
49 apt install -y qtwayland5 qml-module-qtwayland-compositor
50 rm anbox-sensors_0.1.0_arm64.deb
51 wget https://github.com/Anbox-halium/anbox-sensors/releases/download/v0.1.0/anbox-sensors_0.1.0_arm64.deb
52 dpkg -i anbox-sensors_0.1.0_arm64.deb
54 echo "Geting anbox images"
55 if [ -f anbox_arm64_system.img ]; then
56 mv anbox_arm64_system.img anbox_arm64_system.img.bak
57 mv anbox_arm64_vendor.img anbox_arm64_vendor.img.bak
59 rm -f latest-raw-images.zip
60 wget https://build.lolinet.com/file/lineage/anbox_arm64/latest-raw-images.zip
61 unzip latest-raw-images.zip
63 echo "Geting latest runner script"
64 rm -f run-container.sh
65 wget https://github.com/Anbox-halium/anbox-halium/raw/lineage-17.1/scripts/run-container.sh
66 chmod +x run-container.sh
68 if [ -f anbox.prop ]; then
69 mv anbox.prop anbox.prop.bak
71 if grep -q "spurv.display_height" anbox.prop.bak; then
72 grep "spurv.display_height" anbox.prop.bak >> anbox.prop
74 echo "NOTE: Edit /home/anbox/anbox.prop based on your device screen resolution"
75 echo "spurv.display_height=1920" >> anbox.prop
77 if grep -q "spurv.display_width" anbox.prop.bak; then
78 grep "spurv.display_width" anbox.prop.bak >> anbox.prop
80 echo "NOTE: Edit /home/anbox/anbox.prop based on your device screen resolution"
81 echo "spurv.display_width=1080" >> anbox.prop
83 echo "ro.hardware.gralloc=${GRALLOC}" >> anbox.prop
84 echo "${EGL_PROP}" >> anbox.prop
85 echo "${MEDIA_PROFILES_PROP}" >> anbox.prop
86 echo "${CCODEC_PROP}" >> anbox.prop
88 echo "Geting latest lxc config"
89 mkdir /var/lib/lxc/anbox
92 wget https://github.com/Anbox-halium/anbox-halium/raw/lineage-17.1/lxc-configs/config
94 if ! grep -q "module-native-protocol-unix auth-anonymous=1" /etc/pulse/touch-android9.pa; then
95 echo "Pulseaudio config patching"
96 sed -i "s/module-native-protocol-unix/module-native-protocol-unix auth-anonymous=1/" /etc/pulse/touch-android9.pa
99 if [ ! -f /etc/gbinder.d/anbox.conf ]; then
100 echo "Adding gbinder config"
103 wget https://github.com/Anbox-halium/anbox-halium/raw/lineage-17.1/gbinder/anbox.conf
106 mount -o remount,ro /
108 echo "Going back to phablet user"
112 echo "Installing anbox launcher"
113 rm anbox.rudiimmer_1.0_all.click
114 wget https
://build.lolinet.com
/file
/lineage
/anbox_arm
64/anbox.rudiimmer_1.0_all.click
115 pkcon
install-local anbox.rudiimmer_1.0_all.click
--allow-untrusted
117 echo "Restarting Pulseaudio service"
118 initctl
--user stop pulseaudio
119 initctl
--user start pulseaudio
121 echo "Installing Finished!"
122 echo "Run anbox container with /home/anbox/run-container.sh on terminal"