Andbox on WSL related stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt install dkms linux-headers-generic | |
git clone https://github.com/anbox/anbox-modules | |
cd ./anbox-modules | |
sudo cp anbox.conf /etc/modules-load.d/ | |
sudo cp 99-anbox.rules /lib/udev/rules.d/ | |
sudo cp -rT ashmem /usr/src/anbox-ashmem-1 | |
sudo cp -rT binder /usr/src/anbox-binder-1 | |
sudo dkms install anbox-ashmem/1 | |
sudo dkms install anbox-binder/1 | |
sudo modprobe ashmem_linux | |
sudo modprobe binder_linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/anbox/anbox.git | |
cd anbox | |
mkdir build | |
cd build | |
cmake .. | |
make | |
sudo make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# based on PKGBUILD of https://aur.archlinux.org/packages/anbox-image-gapps/ | |
_gapps_rel="$(curl -s -L https://api.github.com/repos/opengapps/x86_64/releases/latest | head -n 10 | grep tag_name | sed -r 's/.*\"([0-9]+)\".*/\1/')" | |
_gapps_src="https://downloads.sourceforge.net/project/opengapps/x86_64/$_gapps_rel/open_gapps-x86_64-7.1-pico-$_gapps_rel.zip" | |
_gapps_md5="$(curl -s -L $_gapps_src.md5 | sed -r 's/^([0-9a-z]+).*/\1/')" | |
_gapps_list=( | |
'gsfcore-all' | |
'gsflogin-all' | |
'gmscore-x86_64' | |
'vending-x86_64' | |
) | |
wget http://build.anbox.io/android-images/2018.07.19/android_amd64.img | |
wget http://dl.android-x86.org/houdini/7_y/houdini.sfs -O houdini_y.sfs | |
wget http://dl.android-x86.org/houdini/7_z/houdini.sfs -O houdini_z.sfs | |
# unpack anbox image | |
mkdir -p squashfs-root | |
rm -rf ./squashfs-root/* | |
unsquashfs -f -d ./squashfs-root ./android_amd64.img | |
# load houdini_y | |
mkdir -p houdini_y | |
rm -rf ./houdini_y/* | |
unsquashfs -f -d ./houdini_y ./houdini_y.sfs | |
mkdir -p ./squashfs-root/system/lib/arm | |
cp -r ./houdini_y/* ./squashfs-root/system/lib/arm | |
mv ./squashfs-root/system/lib/arm/libhoudini.so ./squashfs-root/system/lib/libhoudini.so | |
# load houdini_z | |
mkdir -p houdini_z | |
rm -rf ./houdini_z/* | |
unsquashfs -f -d ./houdini_z ./houdini_z.sfs | |
mkdir -p ./squashfs-root/system/lib64/arm64 | |
cp -r ./houdini_z/* ./squashfs-root/system/lib64/arm64 | |
mv ./squashfs-root/system/lib64/arm64/libhoudini.so ./squashfs-root/system/lib64/libhoudini.so | |
# add houdini parser | |
mkdir -p ./squashfs-root/system/etc/binfmt_misc | |
echo ':arm_exe:M::\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28::/system/lib/arm/houdini:P' >> ./squashfs-root/system/etc/binfmt_misc/arm_exe | |
echo ':arm_dyn:M::\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x28::/system/lib/arm/houdini:P' >> ./squashfs-root/system/etc/binfmt_misc/arm_dyn | |
echo ':arm64_exe:M::\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7::/system/lib64/arm64/houdini64:P' >> ./squashfs-root/system/etc/binfmt_misc/arm64_exe | |
echo ':arm64_dyn:M::\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\xb7::/system/lib64/arm64/houdini64:P' >> ./squashfs-root/system/etc/binfmt_misc/arm64_dyn | |
# add features | |
sed -i '/<\/permissions>/d' ./squashfs-root/system/etc/permissions/anbox.xml | |
sed -i '/<unavailable-feature name=\"android.hardware.wifi\" \/>/d' ./squashfs-root/system/etc/permissions/anbox.xml | |
sed -i '/<unavailable-feature name=\"android.hardware.bluetooth\" \/>/d' ./squashfs-root/system/etc/permissions/anbox.xml | |
echo ' <feature name="android.hardware.touchscreen" /> | |
<feature name="android.hardware.audio.output" /> | |
<feature name="android.hardware.camera" /> | |
<feature name="android.hardware.camera.any" /> | |
<feature name="android.hardware.location" /> | |
<feature name="android.hardware.location.gps" /> | |
<feature name="android.hardware.location.network" /> | |
<feature name="android.hardware.microphone" /> | |
<feature name="android.hardware.screen.portrait" /> | |
<feature name="android.hardware.screen.landscape" /> | |
<feature name="android.hardware.wifi" /> | |
<feature name="android.hardware.bluetooth" />' >> ./squashfs-root/system/etc/permissions/anbox.xml | |
echo '</permissions>' >> ./squashfs-root/system/etc/permissions/anbox.xml | |
# set processors | |
sed -i '/^ro.product.cpu.abilist=x86_64,x86/ s/$/,arm64-v8a,armeabi-v7a,armeabi/' ./squashfs-root/system/build.prop | |
sed -i '/^ro.product.cpu.abilist32=x86/ s/$/,armeabi-v7a,armeabi/' ./squashfs-root/system/build.prop | |
sed -i '/^ro.product.cpu.abilist64=x86_64/ s/$/,arm64-v8a/' ./squashfs-root/system/build.prop | |
# enable nativebridge | |
echo 'persist.sys.nativebridge=1' >> ./squashfs-root/system/build.prop | |
sed -i 's/ro.dalvik.vm.native.bridge=0/ro.dalvik.vm.native.bridge=libhoudini.so/' ./squashfs-root/default.prop | |
# enable opengles | |
echo 'ro.opengles.version=131072' >> ./squashfs-root/system/build.prop | |
# install gapps | |
for i in ${_gapps_list[*]}; do | |
mkdir -p $i | |
rm -rf ./$i/* | |
tar --lzip -xvf ./Core/$i.tar.lz | |
cp -r ./$i/nodpi/priv-app/* ./squashfs-root/system/priv-app/ | |
done | |
# repack image | |
mksquashfs ./squashfs-root ./android.img -noappend -b 131072 -comp xz -Xbcj x86 | |
install -Dm 644 ./android.img "/var/lib/anbox/android.img" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# based on PKGBUILD of https://aur.archlinux.org/packages/anbox-image/ | |
wget http://build.anbox.io/android-images/2018.07.19/android_amd64.img | |
install -Dm 644 $srcdir/android_amd64.img /var/lib/anbox/android.img |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment