From 464e8c0dc1378be000b7ef89461f54cff210ccbb Mon Sep 17 00:00:00 2001 From: Mario Voigt Date: Sat, 15 Mar 2025 01:02:58 +0100 Subject: [PATCH 1/4] add install script for waydroid android emulator --- waydroid-installer.sh | 113 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100755 waydroid-installer.sh diff --git a/waydroid-installer.sh b/waydroid-installer.sh new file mode 100755 index 0000000..2e79778 --- /dev/null +++ b/waydroid-installer.sh @@ -0,0 +1,113 @@ +#!/bin/bash +# This script installs FabAccess Borepin client to Linux using waydroid Android Emulator. +# This script must run as normal user, not as root. However, several commands require sudo permissions! +# If waydroid is already installed, it will try to update the image if a newer one is available +# +# Tested on +# - Fedora 41 @ 14.03.2025 (vmario891) +# - TuxedoOS 24.04 LTS (Debian based)/noble @ 14.03.2025 (vmario891) + +if [ "$EUID" -eq 0 ] + then echo "Please do not run as root" + exit 1 +fi + +echo -e "Elevating script for sudo permissions (please enter password, if asked) ..." +sudo echo + +if [ "$(grep -Ei 'debian|buntu|mint' /etc/*release)" ]; then +PACKMAN="apt" +PVENV="python3-venv" +curl -s https://repo.waydro.id | sudo bash +fi +# dnf/rpm based +if [ "$(grep -Ei 'fedora|redhat' /etc/*release)" ]; then +PACKMAN="dnf" +PVENV="python3-virtualenv" +fi + +if command -v waydroid 2>&1 >/dev/null; then + echo "waydroid is already installed!" + HASWAYDROID="true" +else + HASWAYDROID="false" +fi + +echo -e "Cloning github.com/casualsnek/waydroid_script for libhoudini ..." +git clone https://github.com/casualsnek/waydroid_script > /dev/null 2>&1 +if [ ! -d waydroid_script ]; then + echo -e "Error cloning ..." + exit 1 +fi + +echo -e "Downloading Borepin APK ..." +BOREPIN="org.fab_infra.fabaccess-Signed.apk" +wget https://gitlab.com/api/v4/projects/20862588/packages/generic/borepin/v0.3.11/$BOREPIN > /dev/null +if [ ! -f $BOREPIN ]; then + echo -e "Error downloading ..." + exit 1 +fi + +echo -e "Updating and installing packages ..." +if [ $PACKMAN == "apt" ]; then + sudo $PACKMAN update > /dev/null && sudo $PACKMAN upgrade -y +fi +#on Fedora installing a package automatically updates ... +sudo $PACKMAN install -y waydroid wl-clipboard python3-pip $PENV + +echo -e "Installing pyclip ..." +sudo pip3 install pyclip --quiet --break-system-packages --root-user-action=ignore + +if [ $HASWAYDROID == "false" ]; then + echo -e "Initializing waydroid. This may take a while ..." + sudo waydroid init --system_channel https://ota.waydro.id/system --vendor_channel https://ota.waydro.id/vendor --rom_type lineage --system_type VANILLA +elselse + sudo waydroid upgrade +fi + +echo -e "Starting waydroid session (if not running yet)..." +waydroid status | grep STOPPED > /dev/null +if [ $? == 0 ]; then + waydroid session start & +fi +sleep 5 #waiting for it a while +waydroid status | grep RUNNING > /dev/null +if [ $? != 0 ]; then + echo -e "Error starting waydroid session..." + exit 1 +fi + +echo -e "Configuring waydroid ..." +waydroid prop set persist.waydroid.multi_windows true +if [ $? != 0 ]; then + echo -e "Error starting waydroid session..." + exit 1 +fi +waydroid session stop + +echo -e "Installing libhoudini ..." +python3 -m venv waydroid_script/venv +waydroid_script/venv/bin/pip3 install --upgrade pip --quiet +waydroid_script/venv/bin/pip3 install -r waydroid_script/requirements.txt --quiet +sudo waydroid_script/venv/bin/python3 waydroid_script/main.py --android-version 11 install libhoudini > /dev/null 2>&1 +sudo rm -rf waydroid_script/ > /dev/null + +sleep 5 + +echo -e "Installing Borepin ..." +sudo systemctl restart waydroid-container.service +waydroid session start & + +sleep 5 + +waydroid app install org.fab_infra.fabaccess-Signed.apk +rm org.fab_infra.fabaccess-Signed.apk > /dev/null + +sleep 5 + +echo -e "Starting Borepin ..." +waydroid app launch org.fab_infra.fabaccess & + +sleep 5 + +echo -e "If Borepin does not appear, you can launch it from start menu (entry 'FabAccess') or by commandline: 'waydroid app launch org.fab_infra.fabaccess &'" From e13432e8c17fc65bf4ea63535f448a439a2c674c Mon Sep 17 00:00:00 2001 From: Mario Voigt Date: Sat, 15 Mar 2025 01:13:45 +0100 Subject: [PATCH 2/4] small adjustments --- waydroid-installer.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/waydroid-installer.sh b/waydroid-installer.sh index 2e79778..8ba2b26 100755 --- a/waydroid-installer.sh +++ b/waydroid-installer.sh @@ -7,6 +7,8 @@ # - Fedora 41 @ 14.03.2025 (vmario891) # - TuxedoOS 24.04 LTS (Debian based)/noble @ 14.03.2025 (vmario891) +VERSION="0.3.11" + if [ "$EUID" -eq 0 ] then echo "Please do not run as root" exit 1 @@ -16,9 +18,9 @@ echo -e "Elevating script for sudo permissions (please enter password, if asked) sudo echo if [ "$(grep -Ei 'debian|buntu|mint' /etc/*release)" ]; then -PACKMAN="apt" +PACKMAN="apt-get" PVENV="python3-venv" -curl -s https://repo.waydro.id | sudo bash +curl -s https://repo.waydro.id | sudo bash > /dev/null fi # dnf/rpm based if [ "$(grep -Ei 'fedora|redhat' /etc/*release)" ]; then @@ -41,9 +43,9 @@ if [ ! -d waydroid_script ]; then fi echo -e "Downloading Borepin APK ..." -BOREPIN="org.fab_infra.fabaccess-Signed.apk" -wget https://gitlab.com/api/v4/projects/20862588/packages/generic/borepin/v0.3.11/$BOREPIN > /dev/null -if [ ! -f $BOREPIN ]; then +BOREPIN_APK="org.fab_infra.fabaccess-Signed.apk" +wget --quiet https://gitlab.com/api/v4/projects/20862588/packages/generic/borepin/v$VERSION/$BOREPIN_APK +if [ ! -f $BOREPIN_APK ]; then echo -e "Error downloading ..." exit 1 fi @@ -100,8 +102,8 @@ waydroid session start & sleep 5 -waydroid app install org.fab_infra.fabaccess-Signed.apk -rm org.fab_infra.fabaccess-Signed.apk > /dev/null +waydroid app install $BOREPIN_APK +rm $BOREPIN_APK > /dev/null sleep 5 From 90ef10c90f2862f356d7d2521a610fb01b4fae40 Mon Sep 17 00:00:00 2001 From: Mario Voigt Date: Tue, 18 Mar 2025 23:48:33 +0100 Subject: [PATCH 3/4] adjust version to be non-static --- waydroid-installer.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/waydroid-installer.sh b/waydroid-installer.sh index 8ba2b26..04333b5 100755 --- a/waydroid-installer.sh +++ b/waydroid-installer.sh @@ -7,8 +7,6 @@ # - Fedora 41 @ 14.03.2025 (vmario891) # - TuxedoOS 24.04 LTS (Debian based)/noble @ 14.03.2025 (vmario891) -VERSION="0.3.11" - if [ "$EUID" -eq 0 ] then echo "Please do not run as root" exit 1 @@ -17,6 +15,15 @@ fi echo -e "Elevating script for sudo permissions (please enter password, if asked) ..." sudo echo +BOREPIN_RELEASES="https://gitlab.com/api/v4/projects/20862588/releases/" + +echo -e "Getting releases ..." +curl --silent ${BOREPIN_RELEASES} | jq -r '.[]|.tag_name' | sed -e 's/v//' + +LATEST_RELEASE=$(curl --silent ${BOREPIN_RELEASES} | jq -r '.[0]|.tag_name' | sed -e 's/release\/v//') +echo -e "\nLatest release: ${LATEST_RELEASE}" + + if [ "$(grep -Ei 'debian|buntu|mint' /etc/*release)" ]; then PACKMAN="apt-get" PVENV="python3-venv" @@ -44,7 +51,7 @@ fi echo -e "Downloading Borepin APK ..." BOREPIN_APK="org.fab_infra.fabaccess-Signed.apk" -wget --quiet https://gitlab.com/api/v4/projects/20862588/packages/generic/borepin/v$VERSION/$BOREPIN_APK +wget --quiet https://gitlab.com/api/v4/projects/20862588/packages/generic/borepin/v$LATEST_RELEASE/$BOREPIN_APK if [ ! -f $BOREPIN_APK ]; then echo -e "Error downloading ..." exit 1 From b2bcaf9ac233ced18a0f4ed27c5e77a017139f41 Mon Sep 17 00:00:00 2001 From: Mario Voigt Date: Tue, 18 Mar 2025 23:49:54 +0100 Subject: [PATCH 4/4] remove empty line, add comment --- waydroid-installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/waydroid-installer.sh b/waydroid-installer.sh index 04333b5..34e4ea2 100755 --- a/waydroid-installer.sh +++ b/waydroid-installer.sh @@ -6,6 +6,7 @@ # Tested on # - Fedora 41 @ 14.03.2025 (vmario891) # - TuxedoOS 24.04 LTS (Debian based)/noble @ 14.03.2025 (vmario891) +# - Ubuntu 24.04 LTS noble @ 18.03.2025 (vmario891) if [ "$EUID" -eq 0 ] then echo "Please do not run as root" @@ -23,7 +24,6 @@ curl --silent ${BOREPIN_RELEASES} | jq -r '.[]|.tag_name' | sed -e 's/v//' LATEST_RELEASE=$(curl --silent ${BOREPIN_RELEASES} | jq -r '.[0]|.tag_name' | sed -e 's/release\/v//') echo -e "\nLatest release: ${LATEST_RELEASE}" - if [ "$(grep -Ei 'debian|buntu|mint' /etc/*release)" ]; then PACKMAN="apt-get" PVENV="python3-venv"