├── .github ├── FUNDING.yml └── ISSUE_TEMPLATE │ └── bug_report.md ├── README.md ├── LICENSE ├── ubuntutouchanbox-installplaystore.sh ├── install-houdini-only.sh └── install-playstore.sh /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: geeks-r-us 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: geeks_r_us 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Log output** 24 | Output from adb logcat 25 | 26 | **Screenshots** 27 | If applicable, add screenshots to help explain your problem. 28 | 29 | **Desktop (please complete the following information):** 30 | - OS: [e.g. Ubuntu] 31 | - Version [e.g. 20.04] 32 | 33 | **Additional context** 34 | Add any other context about the problem here. 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # anbox-playstore-installer 2 | Install script that automates installation of googles playstore in anbox (an LX container based environment to run Android apps on Linux https://www.anbox.io/ ) 3 | 4 | A detailed description of the installation steps can be found under: 5 | ~~https://geeks-r-us.de/2017/08/26/android-apps-auf-dem-linux-desktop/~~ 6 | https://geeks-r-us.de/2018/09/04/anbox-update-overlay/ 7 | 8 | Tested with Anbox Snap 186 on Ubuntu 20.04 and 20.10 9 | 10 | COMMANDS: 11 | --clean remove downloads and temporary files 12 | --layout installs specific keyboard layout options are: da_DK de_CH de_DE en_GB en_UK en_US es_ES es_US fr_BE fr_CH fr_FR it_IT nl_NL pt_BR pt_PT ru_RU 13 | 14 | ## Installation 15 | 16 | **Ubuntu** 17 | 18 | ```bash 19 | sudo apt install lzip 20 | wget -O - https://raw.githubusercontent.com/geeks-r-us/anbox-playstore-installer/master/install-playstore.sh | bash 21 | ``` 22 | 23 | ## Support 24 | If you find this software useful please support me with a cup of [coffee](https://ko-fi.com/geeks_r_us) or start [sponsoring](https://github.com/sponsors/geeks-r-us) my work 25 | 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 geeks-r-us 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ubuntutouchanbox-installplaystore.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2018 root@geeks-r-us.de 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights to 8 | # use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 9 | # of the Software, and to permit persons to whom the Software is furnished to do so, 10 | # subject to the following conditions: 11 | 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 16 | # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 17 | # PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 18 | # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 19 | # CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 20 | # OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # For further information see: http://geeks-r-us.de/2017/08/26/android-apps-auf-dem-linux-desktop/ 23 | 24 | # If you find this piece of software useful and or want to support it's development think of 25 | # buying me a coffee https://www.buymeacoffee.com/YdV7B1rex 26 | 27 | # die when an error occurs 28 | set -e 29 | 30 | 31 | #OPENGAPPS_URL="https://github.com/opengapps/x86_64/releases/download/$OPENGAPPS_RELEASEDATE/$OPENGAPPS_FILE" 32 | 33 | OPENGAPPS_RELEASEDATE="20190209" 34 | OPENGAPPS_FILE="open_gapps-arm-7.1-mini-$OPENGAPPS_RELEASEDATE.zip" 35 | 36 | ####SWITCH FOR TESTING##### 37 | OVERLAYDIR="/home/phablet/anbox-data/rootfs" 38 | SYSTEMDIR="/home/phablet/anbox-data" 39 | WORKDIR="/home/phablet/anbox-work" 40 | ###### 41 | IMGFILE="$SYSTEMDIR/android.img" 42 | APPDIR="$OVERLAYDIR/system/priv-app" 43 | BINDIR="$OVERLAYDIR/system/bin" 44 | LIBDIR="$OVERLAYDIR/system/lib" 45 | PERMDIR="$OVERLAYDIR/system/etc/permissions/" 46 | 47 | 48 | #setup google play services +google play permissions after script 49 | 50 | #SETUP "Create $WORKDIR with $OPENGAPPS_FILE", run anbox.appmgr once(click settings), install required dependencies, check guide updates, set opengapps release date, testing(recreate anbox-data+anbox-work using new files+device files,check filesystem(unsquashfs -s android.img)) 51 | 52 | # check if script was started with BASH 53 | if [ ! "$(ps -p $$ -oargs= | awk '{print $1}' | grep -E 'bash$')" ]; then 54 | echo "Please use BASH to start the script!" 55 | exit 1 56 | fi 57 | 58 | # check if user is root 59 | if [ "$(whoami)" != "root" ]; then 60 | echo "Sorry, you are not root. Please run with sudo $0" 61 | exit 1 62 | fi 63 | 64 | if [ ! -f "$SYSTEMDIR/android.img" ]; then 65 | echo -e "No android.img at $SYSTEMDIR" 66 | exit 1 67 | fi 68 | 69 | if [ ! -d "$WORKDIR" ]; then 70 | echo -e "Create $WORKDIR with $OPENGAPPS_FILE" 71 | exit 1 72 | fi 73 | 74 | if [ ! -d "$APPDIR" ]; then 75 | echo -e "$OVERLAYDIR doesn't contain $APPDIR!" 76 | exit 1 77 | fi 78 | 79 | if [ ! -d "$BINDIR" ]; then 80 | echo -e "$OVERLAYDIR doesn't contain $BINDIR!" 81 | exit 1 82 | fi 83 | 84 | if [ ! -d "$PERMDIR" ]; then 85 | echo -e "$OVERLAYDIR doesn't contain $PERMDIR!" 86 | exit 1 87 | fi 88 | 89 | if [ ! -d "$LIBDIR" ]; then 90 | echo -e "$OVERLAYDIR doesn't contain $LIBDIR!" 91 | exit 1 92 | fi 93 | 94 | if [ ! -f "$WORKDIR/$OPENGAPPS_FILE" ]; then 95 | echo -e "Place $OPENGAPPS_FILE in $WORKDIR" 96 | exit 1 97 | fi 98 | 99 | if [ ! -d "$OVERLAYDIR" ]; then 100 | echo -e "Anbox-data/rootfs folder not found at $OVERLAYDIR" 101 | exit 1 102 | fi 103 | 104 | # check if lzip is installed 105 | if [ ! "$(which lzip)" ]; then 106 | echo -e "lzip is not installed. Please install lzip.\nExample: sudo apt install lzip" 107 | exit 1 108 | fi 109 | 110 | # check if squashfs-tools are installed 111 | if [ ! "$(which mksquashfs)" ] || [ ! "$(which unsquashfs)" ]; then 112 | echo -e "squashfs-tools is not installed. Please install squashfs-tools.\nExample: sudo apt install squashfs-tools" 113 | exit 1 114 | else 115 | MKSQUASHFS=$(which mksquashfs) 116 | UNSQUASHFS=$(which unsquashfs) 117 | fi 118 | 119 | # check if wget is installed 120 | if [ ! "$(which wget)" ]; then 121 | echo -e "wget is not installed. Please install wget.\nExample: sudo apt install wget" 122 | exit 1 123 | else 124 | WGET=$(which wget) 125 | fi 126 | 127 | # check if unzip is installed 128 | if [ ! "$(which unzip)" ]; then 129 | echo -e "unzip is not installed. Please install unzip.\nExample: sudo apt install unzip" 130 | exit 1 131 | else 132 | UNZIP=$(which unzip) 133 | fi 134 | 135 | # check if tar is installed 136 | if [ ! "$(which tar)" ]; then 137 | echo -e "tar is not installed. Please install tar.\nExample: sudo apt install tar" 138 | exit 1 139 | else 140 | TAR=$(which tar) 141 | fi 142 | 143 | # use sudo if installed 144 | if [ ! "$(which sudo)" ]; then 145 | SUDO="" 146 | else 147 | SUDO=$(which sudo) 148 | fi 149 | 150 | $SUDO anbox-tool disable 151 | sudo mount -o rw,remount / 152 | 153 | cd "$WORKDIR" 154 | 155 | if [ -d "$WORKDIR/squashfs-root" ]; then 156 | $SUDO rm -rf squashfs-root 157 | fi 158 | 159 | #get image from anbox 160 | cp "$SYSTEMDIR/android.img" . 161 | $SUDO $UNSQUASHFS android.img 162 | 163 | # get opengapps and install it 164 | cd "$WORKDIR" 165 | $UNZIP -d opengapps ./$OPENGAPPS_FILE 166 | 167 | cd ./opengapps/Core/ 168 | for filename in *.tar.lz 169 | do 170 | $TAR --lzip -xvf ./$filename 171 | done 172 | 173 | cd "$WORKDIR" 174 | 175 | APPDIR="$WORKDIR/squashfs-root/system/priv-app" 176 | 177 | $SUDO cp -r ./$(find opengapps -type d -name "PrebuiltGmsCore") $APPDIR 178 | $SUDO cp -r ./$(find opengapps -type d -name "GoogleLoginService") $APPDIR 179 | $SUDO cp -r ./$(find opengapps -type d -name "Phonesky") $APPDIR 180 | $SUDO cp -r ./$(find opengapps -type d -name "GoogleServicesFramework") $APPDIR 181 | 182 | cd "$APPDIR" 183 | $SUDO chown -R 100000:100000 Phonesky GoogleLoginService GoogleServicesFramework PrebuiltGmsCore 184 | 185 | cd "$WORKDIR" 186 | mv android.img androidbackup.img 187 | sudo mksquashfs squashfs-root android.img -comp xz -no-xattrs -b 131072 -Xbcj arm 188 | sudo rm -r squashfs-root 189 | sudo cp android.img "$SYSTEMDIR" 190 | sudo chown root:root "$SYSTEMDIR/android.img" 191 | sudo rm android.img 192 | sudo mount -o ro,remount / 193 | $SUDO anbox-tool enable 194 | -------------------------------------------------------------------------------- /install-houdini-only.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2019 root@geeks-r-us.de 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights to 8 | # use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 9 | # of the Software, and to permit persons to whom the Software is furnished to do so, 10 | # subject to the following conditions: 11 | 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 16 | # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 17 | # PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 18 | # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 19 | # CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 20 | # OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # For further information see: http://geeks-r-us.de/2017/08/26/android-apps-auf-dem-linux-desktop/ 23 | 24 | # If you find this piece of software useful and or want to support it's development think of 25 | # buying me a coffee https://ko-fi.com/geeks_r_us 26 | 27 | # die when an error occurs 28 | set -e 29 | 30 | WORKDIR="$(pwd)/anbox-work" 31 | 32 | # use sudo if installed 33 | if [ ! "$(which sudo)" ]; then 34 | SUDO="" 35 | else 36 | SUDO=$(which sudo) 37 | fi 38 | 39 | # clean downloads 40 | if [ "$1" = "--clean" ]; then 41 | $SUDO rm -rf "$WORKDIR" 42 | exit 0 43 | fi 44 | 45 | # check if script was started with BASH 46 | if [ ! "$(ps -p $$ -oargs= | awk '{print $1}' | grep -E 'bash$')" ]; then 47 | echo "Please use BASH to start the script!" 48 | exit 1 49 | fi 50 | 51 | # check if lzip is installed 52 | if [ ! "$(which lzip)" ]; then 53 | echo -e "lzip is not installed. Please install lzip.\nExample: sudo apt install lzip" 54 | exit 1 55 | fi 56 | 57 | # check if squashfs-tools are installed 58 | if [ ! "$(which mksquashfs)" ] || [ ! "$(which unsquashfs)" ]; then 59 | echo -e "squashfs-tools is not installed. Please install squashfs-tools.\nExample: sudo apt install squashfs-tools" 60 | exit 1 61 | else 62 | MKSQUASHFS=$(which mksquashfs) 63 | UNSQUASHFS=$(which unsquashfs) 64 | fi 65 | 66 | # check if wget is installed 67 | if [ ! "$(which wget)" ]; then 68 | echo -e "wget is not installed. Please install wget.\nExample: sudo apt install wget" 69 | exit 1 70 | else 71 | WGET=$(which wget) 72 | fi 73 | 74 | # check if curl is installed 75 | if [ ! "$(which curl)" ]; then 76 | echo -e "curl is not installed. Please install curl.\nExample: sudo apt install curl" 77 | exit 1 78 | else 79 | CURL=$(which curl) 80 | fi 81 | 82 | # check if unzip is installed 83 | if [ ! "$(which unzip)" ]; then 84 | echo -e "unzip is not installed. Please install unzip.\nExample: sudo apt install unzip" 85 | exit 1 86 | else 87 | UNZIP=$(which unzip) 88 | fi 89 | 90 | # check if tar is installed 91 | if [ ! "$(which tar)" ]; then 92 | echo -e "tar is not installed. Please install tar.\nExample: sudo apt install tar" 93 | exit 1 94 | else 95 | TAR=$(which tar) 96 | fi 97 | 98 | HOUDINI_Y_URL="http://dl.android-x86.org/houdini/7_y/houdini.sfs" 99 | HOUDINI_Z_URL="http://dl.android-x86.org/houdini/7_z/houdini.sfs" 100 | 101 | KEYBOARD_LAYOUTS="da_DK de_CH de_DE en_GB en_UK en_US es_ES es_US fr_BE fr_CH fr_FR it_IT nl_NL pt_BR pt_PT ru_RU" 102 | 103 | contains() { 104 | local list="$1" 105 | local item="$2" 106 | if [[ "$list" =~ (^|[[:space:]])"$item"($|[[:space:]]) ]] ; then 107 | return 0 108 | else 109 | return 1 110 | fi 111 | } 112 | 113 | 114 | if [ "$1" = "--layout" ]; then 115 | if ! contains "$KEYBOARD_LAYOUTS" "$2" ; then 116 | echo "$2 is not a supported keyboard layout. Supported layouts are: $KEYBOARD_LAYOUTS" 117 | exit 1 118 | else 119 | echo "Keyboard layout $2 selected" 120 | fi 121 | fi 122 | 123 | 124 | ANBOX=$(which anbox) 125 | SNAP_TOP="" 126 | if ( [ -d '/var/snap' ] || [ -d '/snap' ] ) && \ 127 | ( [ ${ANBOX} = "/snap/bin/anbox" ] || [ ${ANBOX} == /var/lib/snapd/snap/bin/anbox ] );then 128 | if [ -d '/snap' ];then 129 | SNAP_TOP=/snap 130 | else 131 | SNAP_TOP=/var/lib/snapd/snap 132 | fi 133 | COMBINEDDIR="/var/snap/anbox/common/combined-rootfs" 134 | OVERLAYDIR="/var/snap/anbox/common/rootfs-overlay" 135 | WITH_SNAP=true 136 | else 137 | COMBINEDDIR="/var/lib/anbox/combined-rootfs" 138 | OVERLAYDIR="/var/lib/anbox/rootfs-overlay" 139 | WITH_SNAP=false 140 | fi 141 | 142 | if [ ! -d "$COMBINEDDIR" ]; then 143 | # enable overlay fs 144 | if $WITH_SNAP;then 145 | $SUDO snap set anbox rootfs-overlay.enable=true 146 | $SUDO snap restart anbox.container-manager 147 | else 148 | $SUDO cat >/etc/systemd/system/anbox-container-manager.service.d/override.conf<\n 249 | \n 250 | \n 251 | \n 252 | \n 253 | \n 254 | \n 255 | \n 256 | \n 257 | \n 258 | \n 259 | " 260 | END 261 | ) 262 | 263 | 264 | C=$(echo $C | sed 's/\//\\\//g') 265 | C=$(echo $C | sed 's/\"/\\\"/g') 266 | 267 | if [ ! -d "$OVERLAYDIR/system/etc/permissions/" ]; then 268 | $SUDO mkdir -p "$OVERLAYDIR/system/etc/permissions/" 269 | $SUDO cp "$WORKDIR/squashfs-root/system/etc/permissions/anbox.xml" "$OVERLAYDIR/system/etc/permissions/anbox.xml" 270 | fi 271 | 272 | $SUDO sed -i "/<\/permissions>/ s/.*/${C}\n&/" "$OVERLAYDIR/system/etc/permissions/anbox.xml" 273 | 274 | # make wifi and bt available 275 | $SUDO sed -i "//d" "$OVERLAYDIR/system/etc/permissions/anbox.xml" 276 | $SUDO sed -i "//d" "$OVERLAYDIR/system/etc/permissions/anbox.xml" 277 | 278 | if [ ! -x "$OVERLAYDIR/system/build.prop" ]; then 279 | $SUDO cp "$WORKDIR/squashfs-root/system/build.prop" "$OVERLAYDIR/system/build.prop" 280 | fi 281 | 282 | if [ ! -x "$OVERLAYDIR/default.prop" ]; then 283 | $SUDO cp "$WORKDIR/squashfs-root/default.prop" "$OVERLAYDIR/default.prop" 284 | fi 285 | 286 | # set processors 287 | $SUDO sed -i "/^ro.product.cpu.abilist=x86_64,x86/ s/$/,armeabi-v7a,armeabi,arm64-v8a/" "$OVERLAYDIR/system/build.prop" 288 | $SUDO sed -i "/^ro.product.cpu.abilist32=x86/ s/$/,armeabi-v7a,armeabi/" "$OVERLAYDIR/system/build.prop" 289 | $SUDO sed -i "/^ro.product.cpu.abilist64=x86_64/ s/$/,arm64-v8a/" "$OVERLAYDIR/system/build.prop" 290 | 291 | echo "persist.sys.nativebridge=1" | $SUDO tee -a "$OVERLAYDIR/system/build.prop" 292 | $SUDO sed -i '/ro.zygote=zygote64_32/a\ro.dalvik.vm.native.bridge=libhoudini.so' "$OVERLAYDIR/default.prop" 293 | 294 | # enable opengles 295 | echo "ro.opengles.version=131072" | $SUDO tee -a "$OVERLAYDIR/system/build.prop" 296 | 297 | echo "Restart anbox" 298 | 299 | if $WITH_SNAP;then 300 | $SUDO snap restart anbox.container-manager 301 | else 302 | $SUDO systemctl restart anbox-container-manager.service 303 | fi 304 | -------------------------------------------------------------------------------- /install-playstore.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2019 root@geeks-r-us.de 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights to 8 | # use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 9 | # of the Software, and to permit persons to whom the Software is furnished to do so, 10 | # subject to the following conditions: 11 | 12 | # The above copyright notice and this permission notice shall be included in all 13 | # copies or substantial portions of the Software. 14 | 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 16 | # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 17 | # PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 18 | # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 19 | # CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 20 | # OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # For further information see: http://geeks-r-us.de/2017/08/26/android-apps-auf-dem-linux-desktop/ 23 | 24 | # If you find this piece of software useful and or want to support it's development think of 25 | # buying me a coffee https://ko-fi.com/geeks_r_us 26 | 27 | # die when an error occurs 28 | set -e 29 | 30 | WORKDIR="$(pwd)/anbox-work" 31 | 32 | # use sudo if installed 33 | if [ ! "$(which sudo)" ]; then 34 | SUDO="" 35 | else 36 | SUDO=$(which sudo) 37 | fi 38 | 39 | # clean downloads 40 | if [ "$1" = "--clean" ]; then 41 | $SUDO rm -rf "$WORKDIR" 42 | exit 0 43 | fi 44 | 45 | # check if script was started with BASH 46 | if [ ! "$(ps -p $$ -oargs= | awk '{print $1}' | grep -E 'bash$')" ]; then 47 | echo "Please use BASH to start the script!" 48 | exit 1 49 | fi 50 | 51 | # check if lzip is installed 52 | if [ ! "$(which lzip)" ]; then 53 | echo -e "lzip is not installed. Please install lzip.\nExample: sudo apt install lzip" 54 | exit 1 55 | fi 56 | 57 | # check if squashfs-tools are installed 58 | if [ ! "$(which mksquashfs)" ] || [ ! "$(which unsquashfs)" ]; then 59 | echo -e "squashfs-tools is not installed. Please install squashfs-tools.\nExample: sudo apt install squashfs-tools" 60 | exit 1 61 | else 62 | MKSQUASHFS=$(which mksquashfs) 63 | UNSQUASHFS=$(which unsquashfs) 64 | fi 65 | 66 | # check if wget is installed 67 | if [ ! "$(which wget)" ]; then 68 | echo -e "wget is not installed. Please install wget.\nExample: sudo apt install wget" 69 | exit 1 70 | else 71 | WGET=$(which wget) 72 | fi 73 | 74 | # check if curl is installed 75 | if [ ! "$(which curl)" ]; then 76 | echo -e "curl is not installed. Please install curl.\nExample: sudo apt install curl" 77 | exit 1 78 | else 79 | CURL=$(which curl) 80 | fi 81 | 82 | # check if unzip is installed 83 | if [ ! "$(which unzip)" ]; then 84 | echo -e "unzip is not installed. Please install unzip.\nExample: sudo apt install unzip" 85 | exit 1 86 | else 87 | UNZIP=$(which unzip) 88 | fi 89 | 90 | # check if tar is installed 91 | if [ ! "$(which tar)" ]; then 92 | echo -e "tar is not installed. Please install tar.\nExample: sudo apt install tar" 93 | exit 1 94 | else 95 | TAR=$(which tar) 96 | fi 97 | 98 | 99 | 100 | # get latest releasedate based on tag_name for latest x86_64 build 101 | OPENGAPPS_RELEASEDATE="$($CURL -s https://api.github.com/repos/opengapps/x86_64/releases/latest | grep tag_name | grep -o "\"[0-9][0-9]*\"" | grep -o "[0-9]*")" 102 | OPENGAPPS_FILE="open_gapps-x86_64-7.1-pico-$OPENGAPPS_RELEASEDATE.zip" 103 | OPENGAPPS_URL="https://sourceforge.net/projects/opengapps/files/x86_64/$OPENGAPPS_RELEASEDATE/$OPENGAPPS_FILE" 104 | 105 | HOUDINI_Y_URL="http://dl.android-x86.org/houdini/7_y/houdini.sfs" 106 | HOUDINI_Z_URL="http://dl.android-x86.org/houdini/7_z/houdini.sfs" 107 | 108 | KEYBOARD_LAYOUTS="da_DK de_CH de_DE en_GB en_UK en_US es_ES es_US fr_BE fr_CH fr_FR it_IT nl_NL pt_BR pt_PT ru_RU" 109 | 110 | contains() { 111 | local list="$1" 112 | local item="$2" 113 | if [[ "$list" =~ (^|[[:space:]])"$item"($|[[:space:]]) ]] ; then 114 | return 0 115 | else 116 | return 1 117 | fi 118 | } 119 | 120 | 121 | if [ "$1" = "--layout" ]; then 122 | if ! contains "$KEYBOARD_LAYOUTS" "$2" ; then 123 | echo "$2 is not a supported keyboard layout. Supported layouts are: $KEYBOARD_LAYOUTS" 124 | exit 1 125 | else 126 | echo "Keyboard layout $2 selected" 127 | fi 128 | fi 129 | 130 | 131 | ANBOX=$(which anbox) 132 | SNAP_TOP="" 133 | if ( [ -d '/var/snap' ] || [ -d '/snap' ] ) && \ 134 | ( [ ${ANBOX} = "/snap/bin/anbox" ] || [ ${ANBOX} == /var/lib/snapd/snap/bin/anbox ] );then 135 | if [ -d '/snap' ];then 136 | SNAP_TOP=/snap 137 | else 138 | SNAP_TOP=/var/lib/snapd/snap 139 | fi 140 | COMBINEDDIR="/var/snap/anbox/common/combined-rootfs" 141 | OVERLAYDIR="/var/snap/anbox/common/rootfs-overlay" 142 | WITH_SNAP=true 143 | else 144 | COMBINEDDIR="/var/lib/anbox/combined-rootfs" 145 | OVERLAYDIR="/var/lib/anbox/rootfs-overlay" 146 | WITH_SNAP=false 147 | fi 148 | 149 | if [ ! -d "$COMBINEDDIR" ]; then 150 | # enable overlay fs 151 | if $WITH_SNAP;then 152 | $SUDO snap set anbox rootfs-overlay.enable=true 153 | $SUDO snap restart anbox.container-manager 154 | else 155 | # As fix for https://github.com/geeks-r-us/anbox-playstore-installer/issues/54 so none need manually create the structure 156 | # Author @NickWilde263 (Just call me Fox) 157 | # "mkdir" won't report error when the path already exist because of "-p" see "man mkdir" about "-p" option 158 | if [ ! -d "/etc/systemd/system/anbox-container-manager.service.d/" ]; then 159 | # Informing the user about creation of the directory 160 | echo "Creating /etc/systemd/system/anbox-container-manager.service.d/ directory" 161 | $SUDO mkdir -p /etc/systemd/system/anbox-container-manager.service.d/ 162 | fi 163 | 164 | $SUDO cat >/etc/systemd/system/anbox-container-manager.service.d/override.conf<\n 301 | \n 302 | \n 303 | \n 304 | \n 305 | \n 306 | \n 307 | \n 308 | \n 309 | \n 310 | \n 311 | " 312 | END 313 | ) 314 | 315 | 316 | C=$(echo $C | sed 's/\//\\\//g') 317 | C=$(echo $C | sed 's/\"/\\\"/g') 318 | 319 | if [ ! -d "$OVERLAYDIR/system/etc/permissions/" ]; then 320 | $SUDO mkdir -p "$OVERLAYDIR/system/etc/permissions/" 321 | $SUDO cp "$WORKDIR/squashfs-root/system/etc/permissions/anbox.xml" "$OVERLAYDIR/system/etc/permissions/anbox.xml" 322 | fi 323 | 324 | $SUDO sed -i "/<\/permissions>/ s/.*/${C}\n&/" "$OVERLAYDIR/system/etc/permissions/anbox.xml" 325 | 326 | # make wifi and bt available 327 | $SUDO sed -i "//d" "$OVERLAYDIR/system/etc/permissions/anbox.xml" 328 | $SUDO sed -i "//d" "$OVERLAYDIR/system/etc/permissions/anbox.xml" 329 | 330 | if [ ! -x "$OVERLAYDIR/system/build.prop" ]; then 331 | $SUDO cp "$WORKDIR/squashfs-root/system/build.prop" "$OVERLAYDIR/system/build.prop" 332 | fi 333 | 334 | if [ ! -x "$OVERLAYDIR/default.prop" ]; then 335 | $SUDO cp "$WORKDIR/squashfs-root/default.prop" "$OVERLAYDIR/default.prop" 336 | fi 337 | 338 | # set processors 339 | $SUDO sed -i "/^ro.product.cpu.abilist=x86_64,x86/ s/$/,armeabi-v7a,armeabi,arm64-v8a/" "$OVERLAYDIR/system/build.prop" 340 | $SUDO sed -i "/^ro.product.cpu.abilist32=x86/ s/$/,armeabi-v7a,armeabi/" "$OVERLAYDIR/system/build.prop" 341 | $SUDO sed -i "/^ro.product.cpu.abilist64=x86_64/ s/$/,arm64-v8a/" "$OVERLAYDIR/system/build.prop" 342 | 343 | echo "persist.sys.nativebridge=1" | $SUDO tee -a "$OVERLAYDIR/system/build.prop" 344 | $SUDO sed -i '/ro.zygote=zygote64_32/a\ro.dalvik.vm.native.bridge=libhoudini.so' "$OVERLAYDIR/default.prop" 345 | 346 | # enable opengles 347 | echo "ro.opengles.version=131072" | $SUDO tee -a "$OVERLAYDIR/system/build.prop" 348 | 349 | echo "Restart anbox" 350 | 351 | if $WITH_SNAP;then 352 | $SUDO snap restart anbox.container-manager 353 | else 354 | $SUDO systemctl restart anbox-container-manager.service 355 | fi 356 | --------------------------------------------------------------------------------