Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Nes2525 authored Dec 19, 2023
1 parent 14b820f commit f0959b2
Show file tree
Hide file tree
Showing 11 changed files with 733 additions and 0 deletions.
36 changes: 36 additions & 0 deletions scripts/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
clear
echo "Select the needed Box64Droid version to install:"
echo "1) Non-root version (Adreno 610-740, Android 12+)."
echo "2) Root version (Adreno 610-740, Android 10+)."
echo "3) VirGL version (For other GPUs, non-root phones, Android 12+)."
echo "4) Native version (Adreno 610-740, testing version, thanks JeezDisReez for his hard works)."
echo "5) Cancel the Box64Droid installation."
echo ""
read version
if [ -z $version ]
then
echo "Empty version! Re-run installation script and choose correct version"
rm install
exit
elif [ $version = 1 ]
then
curl -o non-root https://raw.githubusercontent.com/Nes2525/Box64Droid-bug-fix/main/scripts/non-root/install && chmod +x non-root && ./non-root
elif [ $version = 2 ]
then
curl -o root https://raw.githubusercontent.com/Nes2525/Box64Droid-bug-fix/main/scripts/root/install && chmod +x root && ./root
elif [ $version = 3 ]
then
curl -o virgl https://raw.githubusercontent.com/Nes2525/Box64Droid-bug-fix/main/scripts/virgl/install && chmod +x virgl && ./virgl
elif [ $version = 4 ]
then
curl -o native https://raw.githubusercontent.com/Nes2525/Box64Droid-bug-fix/main/scripts/native/install && chmod +x native && ./native
elif [ $version = 5 ]
then
rm install
exit
else
echo "Wrong version! Re-run installation script and choose correct version"
rm install
exit
fi
220 changes: 220 additions & 0 deletions scripts/native/box64droid
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
#!/bin/bash
if [ $# -eq 0 ]
then
echo "Empty argument, use --help to see available arguments"
elif [ $1 = "--start" ]
then
clear
export folder="/sdcard/Box64Droid"
echo "Checking configuration..."
if [ -d $folder ]
then
&>/dev/null
else
mkdir $folder
fi
if [ -f $folder/DXVK_D8VK_HUD.conf ]
then
&>/dev/null
else
cp $PREFIX/glibc/opt/DXVK_D8VK_HUD.conf $folder/
fi
if [ -f $folder/DXVK_D8VK.conf ]
then
&>/dev/null
else
cp $PREFIX/glibc/opt/DXVK_D8VK.conf $folder/
fi
if [ -f $folder/Box64Droid.conf ]
then
&>/dev/null
else
cp $PREFIX/glibc/opt/Box64Droid.conf $folder/
fi
echo "Configuration check completed"
echo "Starting Termux-x11..."
termux-x11 :0 -legacy-drawing &>/dev/null &
echo "Starting PulseAudio..."
pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1 &>/dev/null
echo ""
echo -e "Termux-x11 started"
. $folder/Box64Droid.conf
. $folder/DXVK_D8VK_HUD.conf
if [ ! -d $HOME/.wine ]
then
echo ""
echo "Wine prefix not found! It will be created..."
echo "Creating Wine prefix..."
. /sdcard/Box64Droid/Box64Droid.conf
WINEDLLOVERRIDES="mscoree=" box64 wine64 wineboot &>/dev/null
cp -r $PREFIX/glibc/opt/Shortcuts/* "$HOME/.wine/drive_c/ProgramData/Microsoft/Windows/Start Menu"
ln -s /sdcard $HOME/.wine/dosdevices/d:
echo "Installing DXVK, D8VK and vkd3d-proton..."
box64 wine "$PREFIX/glibc/opt/Resources64/Run if you will install on top of WineD3D.bat" &>/dev/null
box64 wine "$PREFIX/glibc/opt/Resources64/DXVK2.3/DXVK2.3.bat" &>/dev/null
box64 wine reg add "HKEY_CURRENT_USER\Software\Wine\DllOverrides" /v d3d12 /d native /f &>/dev/null
box64 wine reg add "HKEY_CURRENT_USER\Software\Wine\DllOverrides" /v d3d12core /d native /f &>/dev/null
cp $PREFIX/glibc/opt/Resources/vkd3d-proton2.11/* $HOME/.wine/drive_c/windows/syswow64
cp $PREFIX/glibc/opt/Resources64/vkd3d-proton2.11/* $HOME/.wine/drive_c/windows/system32
echo "Done!"
else
&>/dev/null
fi
clear
echo "Box64Droid by Ilya114, Glory to Ukraine!"
echo "Select to start:"
echo "1) Box64"
echo "2) Box64 (debug version)"
echo "3) Change Wine version"
echo "4) Recreate Wine prefix"
echo "5) Exit"
echo ""
read choice
if [ -z $choice ]
then
echo "Empty option"
sleep 1
. box64droid
elif [ $choice = 1 ]
then
. start-box64
elif [ $choice = 2 ]
then
clear
echo "Wine will be started with debug info, log will be saved in /sdcard/Box64Droid.log. Send /sdcard/Box64Droid.log in Telegram group if you have black screen or crashed apps/games"
echo "To exit from Box64Droid press type '1' then press Enter"
BOX86_LOG=1 BOX86_SHOWSEGV=1 BOX86_DYNAREC_LOG=1 BOX86_DYNAREC_MISSING=1 BOX86_DLSYM_ERROR=1 BOX64_LOG=1 BOX64_SHOWSEGV=1 BOX64_DYNAREC_LOG=1 BOX64_DYNAREC_MISSING=1 BOX64_DLSYM_ERROR=1 taskset -c 4-7 box64 wine explorer /desktop=shell,800x600 /opt/7-Zip/7zFM >/sdcard/Box64Droid.log 2>&1 &
am start -n com.termux.x11/com.termux.x11.MainActivity &>/dev/null
box64 wine64 taskkill /f /im services.exe &>/dev/null &
read -p "" yn
case $yn in
[1]* ) echo " Stopping Wine...";box64 wineserver -k &>/dev/null;echo "";echo " Stopping Termux-X11...";pkill -f pulseaudio;pkill -f "app_process / com.termux.x11";echo ""
esac
elif [ $choice = 3 ]
then
clear
echo "Select Wine version to install:"
echo "1) Wine GE 8-13"
echo "2) Wine Stable 8.0"
echo "3) Wine Staging-TKG 8.13"
echo "4) Back to previous menu"
echo ""
read choice
if [ -z $choice ]
then
echo "Empty option, back to previous menu..."
sleep 1
. box64droid
elif [ $choice = 4 ]
then
. box64droid
elif [ $choice = 1 ] || [ $choice = 2 ] || [ $choice = 3 ]
then
clear
echo "Removing previous Wine..."
rm -r $PREFIX/glibc/opt/wine
echo "Removing previous Wine prefix..."
rm -r $HOME/.wine
if [ $choice = 1 ]
then
echo "Downloading Wine GE 8-13..."
echo ""
wget -q --show-progress https://github.com/Pipetto-crypto/androBox/releases/download/wine-ge-8.13/wine-lutris-GE-Proton8-13-x86_64.tar.xz
echo ""
echo "Unpacking Wine GE 8-13..."
tar -xf wine-lutris-GE-Proton8-13-x86_64.tar.xz -C $PREFIX/glibc/opt
mv $PREFIX/glibc/opt/lutris-GE-Proton8-13-x86_64 $PREFIX/glibc/opt/wine
elif [ $choice = 2 ]
then
echo "Downloading Wine Stable 8.0..."
echo ""
wget -q --show-progress https://github.com/Pipetto-crypto/androBox/releases/download/wine-8.0/wine-8.0-amd64.tar.xz
echo ""
echo "Unpacking Wine Stable 8.0..."
tar -xf wine-8.0-amd64.tar.xz -C $PREFIX/glibc/opt
mv $PREFIX/glibc/opt/wine-8.0-amd64 $PREFIX/glibc/opt/wine
elif [ $choice = 3 ]
then
echo "Downloading Wine Staging-TKG 8.13..."
echo ""
wget -q --show-progress https://github.com/Ilya114/Box64Droid/releases/download/alpha/wine-8.13-staging-tkg-amd64.tar.xz
echo ""
echo "Unpacking Wine Staging-TKG 8.13..."
tar -xf wine-8.13-staging-tkg-amd64.tar.xz -C $PREFIX/glibc/opt
mv $PREFIX/glibc/opt/wine-8.13-staging-tkg-amd64 $PREFIX/glibc/opt/wine
fi
echo "Creating Wine prefix, going to Termux-X11..."
am start -n com.termux.x11/com.termux.x11.MainActivity &>/dev/null
. /sdcard/Box64Droid/Box64Droid.conf
box64 wine64 wineboot &>/dev/null
cp -r $PREFIX/glibc/opt/Shortcuts/* "$HOME/.wine/drive_c/ProgramData/Microsoft/Windows/Start Menu"
ln -s /sdcard $HOME/.wine/dosdevices/d:
echo "Installing DXVK, D8VK and vkd3d-proton..."
box64 wine "$PREFIX/glibc/opt/Resources64/Run if you will install on top of WineD3D.bat" &>/dev/null
box64 wine "$PREFIX/glibc/opt/Resources64/DXVK2.3/DXVK2.3.bat" &>/dev/null
box64 wine reg add "HKEY_CURRENT_USER\Software\Wine\DllOverrides" /v d3d12 /d native /f &>/dev/null
box64 wine reg add "HKEY_CURRENT_USER\Software\Wine\DllOverrides" /v d3d12core /d native /f &>/dev/null
cp $PREFIX/glibc/opt/Resources/vkd3d-proton2.11/* $HOME/.wine/drive_c/windows/syswow64
cp $PREFIX/glibc/opt/Resources64/vkd3d-proton2.11/* $HOME/.wine/drive_c/windows/system32
echo "Removing archives..."
rm wine-*.tar.xz
echo "Done!"
. box64droid
else
echo "Wrong option, back to previous menu..."
sleep 1
. box64droid
fi
elif [ $choice = 4 ]
then
clear
echo "Removing previous Wine prefix..."
rm -r $HOME/.wine
echo "Creating Wine prefix, going to Termux-X11..."
am start -n com.termux.x11/com.termux.x11.MainActivity &>/dev/null
. /sdcard/Box64Droid/Box64Droid.conf
box64 wine64 wineboot &>/dev/null
cp -r $PREFIX/glibc/opt/Shortcuts/* "$HOME/.wine/drive_c/ProgramData/Microsoft/Windows/Start Menu"
ln -s /sdcard $HOME/.wine/dosdevices/d:
echo "Installing DXVK, D8VK and vkd3d-proton..."
box64 wine "$PREFIX/glibc/opt/Resources64/Run if you will install on top of WineD3D.bat" &>/dev/null
box64 wine "$PREFIX/glibc/opt/Resources64/DXVK2.3/DXVK2.3.bat" &>/dev/null
box64 wine reg add "HKEY_CURRENT_USER\Software\Wine\DllOverrides" /v d3d12 /d native /f &>/dev/null
box64 wine reg add "HKEY_CURRENT_USER\Software\Wine\DllOverrides" /v d3d12core /d native /f &>/dev/null
cp $PREFIX/glibc/opt/Resources/vkd3d-proton2.11/* $HOME/.wine/drive_c/windows/syswow64
cp $PREFIX/glibc/opt/Resources64/vkd3d-proton2.11/* $HOME/.wine/drive_c/windows/system32
echo "Done!"
. box64droid
elif [ $choice = 5 ]
then
pkill -f "app_process / com.termux.x11"
pkill -f pulseaudio
exit
else
echo "Wrong option"
sleep 1
. box64droid
fi
elif [ $1 = "--uninstall" ]
then
echo "Uninstalling Box64Droid..."
rm $PREFIX/bin/box64droid
rm $PREFIX/bin/start-box64
rm -r $PREFIX/glibc
rm -r $HOME/.wine
echo "Done!"
elif [ $1 = "--version" ]
then
echo "25.11.23 (alpha)"
elif [ $1 = "--help" ]
then
echo "Box64Droid (native version) - configured tools to launch Box64, Box86, Wine 8.14, DXVK with Adreno GPU drivers in Termux"
echo "Usage: box64droid {argument}"
echo "Available arguments:"
echo "--start - start Box64Droid"
echo "--uninstall - uninstall Box64Droid (all data in rootfs will be clear)"
echo "--version - show current version of Box64Droid"
echo "--help - see available arguments"
else
echo "Invalid argument, use --help to see available arguments"
fi
56 changes: 56 additions & 0 deletions scripts/native/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash
clear
echo " Starting Box64Droid (native version) installation..." & sleep 3
echo ""
echo " Box64Droid creates /sdcard/Box64Droid folder to store configuration files. To create this folder, it is necessary to have storage permissions, click on allow to proceed." & sleep 5 &>/dev/null
termux-setup-storage & sleep 3 &>/dev/null
echo ""
echo " Updating packages..."
apt-get update &>/dev/null
apt-get -y --with-new-pkgs -o Dpkg::Options::="--force-confdef" upgrade &>/dev/null
echo ""
echo " Installing x11-repo..."
echo ""
pkg install x11-repo -y &>/dev/null
echo " x11-repo installed"
echo ""
echo " Installing required packages..."
pkg install pulseaudio wget xkeyboard-config freetype fontconfig libpng xorg-xrandr termux-x11-nightly -y &>/dev/null
echo ""
echo " Checking for older Box64Droid versions and removing them if any..."
echo ""
if [ -d ~/.wine ]
then
rm -r ~/.wine &>/dev/null
rm -r $PREFIX/glibc &>/dev/null
fi
echo " Downloading glibc prefix..."
echo ""
wget -q --show-progress https://github.com/Ilya114/Box64Droid/releases/download/alpha/glibc-prefix.tar.xz
echo ""
echo " Unpacking glibc-prefix, please wait..."
tar -xJf glibc-prefix.tar.xz -C $PREFIX/
echo ""
echo " Downloading Box64Droid starting scripts..."
wget https://raw.githubusercontent.com/Nes2525/Box64Droid-bug-fix/main/scripts/native/box64droid &>/dev/null
wget https://raw.githubusercontent.com/Nes2525/Box64Droid-bug-fix/main/scripts/native/start-box64 &>/dev/null
chmod +x box64droid start-box64
mv box64droid start-box64 $PREFIX/bin/
echo ""
echo " Scripts downloaded"
echo ""
echo " Checking for Android 14 and apply fix for Termux-X11 if so"
ANDROID_VERSION=$(termux-info | grep "13")
if [ $ANDROID_VERSION = 14 ]
then
find $PREFIX -type f -iname "*.apk" -exec chmod 400 "{}" \;
fi
echo ""
echo " Removing the installation waste..."
rm glibc-prefix.tar.xz install native
clear
echo ""
echo " Install finished. To start Box64Droid run './start-box64' "
echo ""
echo " And if everything goes as planned, Wine and 7-Zip file manager will start."
echo ""
63 changes: 63 additions & 0 deletions scripts/native/start-box64
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/bin/bash
clear
echo "Select need resoultion:"
echo "1) 800x600 (4:3)"
echo "2) 1024x768 (4:3)"
echo "3) 1280x720 (16:9)"
echo "4) 1920x1080 (16:9)"
echo "5) Termux-X11 resolution"
echo "6) Back to previous menu"
echo ""
read res
clear
if [ -z $res ]
then
echo "Empty option"
sleep 1
. start-box64
elif [ $res = 1 ]
then
echo -e "\033[0;33mTermux-X11 and Wine will start now. If you want exit from Box64Droid, type \033[0;36m'1'\033[0;33m in the terminal."
sleep 1
taskset -c 4-7 box64 wine explorer /desktop=shell,800x600 $PREFIX/glibc/opt/7-Zip/7zFM &>/dev/null &
box64 wine64 taskkill /f /im services.exe &>/dev/null &
elif [ $res = 2 ]
then
echo -e "\033[0;33mTermux-X11 and Wine will start now. If you want exit from Box64Droid, type \033[0;36m'1'\033[0;33m in the terminal and press Enter."
sleep 1
taskset -c 4-7 box64 wine explorer /desktop=shell,1024x768 $PREFIX/glibc/opt/7-Zip/7zFM &>/dev/null &
box64 wine64 taskkill /f /im services.exe &>/dev/null &
elif [ $res = 3 ]
then
echo -e "\033[0;33mTermux-X11 and Wine will start now. If you want exit from Box64Droid, type \033[0;36m'1'\033[0;33m in the terminal and press Enter."
sleep 1
taskset -c 4-7 box64 wine explorer /desktop=shell,1280x720 $PREFIX/glibc/opt/7-Zip/7zFM &>/dev/null &
box64 wine64 taskkill /f /im services.exe &>/dev/null &
elif [ $res = 4 ]
then
echo -e "\033[0;33mTermux-X11 and Wine will start now. If you want exit from Box64Droid, type \033[0;36m'1'\033[0;33m in the terminal and press Enter."
sleep 1
taskset -c 4-7 box64 wine explorer /desktop=shell,1920x1080 $PREFIX/glibc/opt/7-Zip/7zFM &>/dev/null &
box64 wine64 taskkill /f /im services.exe &>/dev/null &
elif [ $res = 5 ]
then
export res="$(xrandr | grep current | awk '{print $8$9$10}' | tr -d ,)"
echo -e "\033[0;33mTermux-X11 and Wine will start now. If you want exit from Box64Droid, type \033[0;36m'1'\033[0;33m in the terminal then press Enter."
sleep 1
taskset -c 4-7 box64 wine explorer /desktop=shell,$res $PREFIX/glibc/opt/7-Zip/7zFM &>/dev/null &
box64 wine64 taskkill /f /im services.exe &>/dev/null &
elif [ $res = 6 ]
then
. $PREFIX/bin/box64droid
else
echo "Incorrect resolution"
sleep 0.5
clear
. $PREFIX/bin/start-box64
fi
echo ""
am start -n com.termux.x11/com.termux.x11.MainActivity &>/dev/null
read -p "" yn
case $yn in
[1]* ) echo " Stopping Wine...";box64 wineserver -k &>/dev/null;echo "";echo " Stopping Termux-X11...";pkill -f pulseaudio;pkill -f "app_process / com.termux.x11";echo ""
esac
Loading

0 comments on commit f0959b2

Please sign in to comment.