Skip to content

Commit

Permalink
Merge pull request #3 from whitewhidow/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
whitewhidow authored Oct 27, 2020
2 parents a8a7e27 + 8083ebf commit 5e76328
Show file tree
Hide file tree
Showing 7 changed files with 259 additions and 225 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/gitflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,14 @@ jobs:
- uses: actions/checkout@v2

# Runs a single command using the runners shell
- name: Wait
run: sleep 10
- name: Run install
run: $GITHUB_WORKSPACE/install.sh
run: $GITHUB_WORKSPACE/install.sh local
- name: Run sideload-gui
run: sideload-gui
- name: Run ww-mount
run: whitewhidow-mount /mnt/tmp
- name: Run sideload
run: cd extras && sideload
# Runs a set of commands using the runners shell
Expand Down
42 changes: 33 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,57 @@ Quest Sideloader for Linux and Mac with integrated drive access to app library.


# Install (and/or) Update:
Latest Stable:
```
sudo /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/whitewhidow/quest-sideloader-linux/main/install.sh)"
curl -fsSL https://raw.githubusercontent.com/whitewhidow/quest-sideloader-linux/development/install.sh | /bin/bash -s -- main
```
Latest Dev:
```
curl -fsSL https://raw.githubusercontent.com/whitewhidow/quest-sideloader-linux/development/install.sh | /bin/bash -s -- development
```
<details>
<summary>Example output:</summary>

```
OS: Linux DETECTED
====================================================================
= Quest(1/2) sideloader for Linux & Mac(OSX) =======================
====================================================================
========================================= by Whitewhidow/BranchBit =
===================================== support:[email protected] =
============================== https://t.me/whitewhidow_q2_working =
================ www.github.com/whitewhidow/quest-sideloader-linux =
====================================================================
CHECKING AND INSTALLING DEPENDENCIES:
Downloading and unzipping newest version.
Checking git installation.
Git installed
Checking unzip installation.
Unzip installed
Checking adb.
Attempting to install missing 'adb' package. (requires sudo)
Adb copied from linux_adb_lib/adb to /usr/local/bin.
Adb installed
Checking aapt.
Attempting to install missing 'aapt' package. (requires sudo)
Aapt copied from linux_aapt_lib/aapt to /usr/local/bin.
Aapt installed
Checking zenity.
Zenity installed
Checking rclone.
Rclone installed
Fetching newest version (main).
Cloning into 'quest-sideloader-linux'...
remote: Enumerating objects: 273, done.
remote: Counting objects: 100% (273/273), done.
remote: Compressing objects: 100% (185/185), done.
remote: Total 1210 (delta 164), reused 160 (delta 73), pack-reused 937
Receiving objects: 100% (1210/1210), 8.84 MiB | 10.12 MiB/s, done.
Resolving deltas: 100% (713/713), done.
Already on 'main'
Your branch is up to date with 'origin/main'.
Copying executables to PATH (requires sudo)
Removing downloaded files
-> Install seems to have been successfull, you can now run 'sideload-gui'
-> Install seems to have been successfull, you can now run 'sideload-gui' to open the sideloader.
-> To self-update this package run 'sideload-update'.
```
</details>
Expand Down
Binary file added extras/web.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
207 changes: 136 additions & 71 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,22 @@ echo -e "============================== https://t.me/whitewhidow_q2_working ="
echo -e "================ www.github.com/whitewhidow/quest-sideloader-linux ="
echo -e "===================================================================="
printf "\n"
case "$OSTYPE" in
linux*) OSTYPE="linux" ;;
darwin*) OSTYPE="mac" ;;
*) echo "unknown OS: $OSTYPE DETECTED" && echo "please submit a ticket om github?" && sleep 30 && exit ;;
esac



case "$OSTYPE" in
linux*) echo "OS: Linux DETECTED" && OSTYPE="linux" ;;
darwin*) echo "Mac OS DETECTED" && OSTYPE="mac" ;;
*) echo "unknown OS: $OSTYPE DETECTED" && echo "please submit a ticket om github?" && exit ;;
esac

function failed(){
LINE="\n\nInstall seems to have failed with the following reason:\n\n$1.\n\nPlease paste the terminal output to github,\nI will gladly assist! \n"
[ -z $CI ] && zenity --warning --text="$LINE" --width="600"
echo -e "$LINE"
read -p "Press [ENTER] to continue." < "$(tty 0>&2)"
exit 1
}



Expand All @@ -29,93 +37,159 @@ echo "CHECKING AND INSTALLING DEPENDENCIES:"
if [ $OSTYPE == "mac" ]; then
echo "Checking brew for mac."
if [[ $(which brew) != *"brew"* ]]; then
echo "Attempting to install missing 'brew' package. (requires sudo)"
echo "-> Please wait while we attempt to install missing 'brew' package. (requires sudo)"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" && echo "Brew installed."
fi
fi


#echo "Checking unzip installation."
if [[ $(which unzip) != *"unzip"* ]]; then
echo "Attempting to install missing 'unzip' pakckage. (requires sudo)"
(sudo apt install unzip > /dev/null 2> /dev/null || brew install unzip > /dev/null 2> /dev/null) && echo "Unzip installed."
fi


echo "Checking git installation."
if ! command -v git &> /dev/null; then
echo "-> Please wait while we attempt to install missing 'git' package. (requires sudo)"
(sudo apt install git > /dev/null 2> /dev/null || brew git unzip > /dev/null 2> /dev/null) && echo "Unzip installed."
fi
if ! command -v git &> /dev/null; then
failed "Git could not be installed ?"
else
echo "Git installed"
GITINSTALLED=true
fi

OLDPATH="$PWD"
rm -rf /tmp/sideload-install
mkdir /tmp/sideload-install
cd /tmp/sideload-install


BRANCH="main"
if [ ! -z $CI ]; then
#BRANCH=$(echo "$GITHUB_REF" | awk -F'/' '{print $3}')
BRANCH="development"
fi


echo "Downloading and unzipping newest ($BRANCH) version."
rm -f ./quest-sideloader-linux-$BRANCH.zip 2> /dev/null


curl --silent https://codeload.github.com/whitewhidow/quest-sideloader-linux/zip/$BRANCH -o quest-sideloader-linux-$BRANCH.zip > /dev/null

unzip -oq quest-sideloader-linux-$BRANCH.zip && cd quest-sideloader-linux-$BRANCH > /dev/null
echo "Checking unzip installation."
if ! command -v unzip &> /dev/null; then
echo "-> Please wait while we attempt to install missing 'unzip' pakckage. (requires sudo)"
(sudo apt install unzip > /dev/null || brew install unzip > /dev/null ) && echo "Unzip installed."
fi
if ! command -v unzip &> /dev/null; then
failed "Unzip could not be installed ?"
else
echo "Unzip installed"
UNZIPINSTALLED=true
fi



echo "Checking adb."
if ! command -v adb &> /dev/null; then
if [ $OSTYPE == "mac" ]; then
echo "-> Please wait while we attempt to install missing 'adb' package. (requires sudo)"
mkdir -p ${OSTYPE}_adb_lib
curl --silent https://raw.githubusercontent.com/whitewhidow/quest-sideloader-linux/$BRANCH/${OSTYPE}_adb_lib/adb -o ${OSTYPE}_adb_lib/adb > /dev/null
chmod +x ${OSTYPE}_adb_lib/adb
sudo rm -f /usr/local/bin/adb 2> /dev/null
sudo cp ${OSTYPE}_adb_lib/adb /usr/local/bin && echo "Adb copied from ${OSTYPE}_adb_lib/adb to /usr/local/bin."
rm -rf ${OSTYPE}_adb_lib/
fi

if [ $OSTYPE == "linux" ]; then
echo "-> Please wait while we attempt to install missing 'adb' package. (requires sudo)"
sudo apt install android-tools-adb > /dev/null
fi
fi

if ! command -v adb &> /dev/null; then
failed "Adb could not be installed ?"
else
echo "Adb installed"
ADBINSTALLED=true
fi




echo "Checking adb."
if [[ $(which adb) != *"adb"* ]]; then
echo "Attempting to install missing 'adb' package. (requires sudo)"
mkdir -p ${OSTYPE}_adb_lib
curl --silent https://raw.githubusercontent.com/whitewhidow/quest-sideloader-linux/$BRANCH/${OSTYPE}_adb_lib/adb -o ${OSTYPE}_adb_lib/adb > /dev/null
chmod +x ${OSTYPE}_adb_lib/adb
sudo rm -f /usr/local/bin/adb 2> /dev/null
sudo cp ${OSTYPE}_adb_lib/adb /usr/local/bin && echo "Adb copied from ${OSTYPE}_adb_lib/adb to /usr/local/bin."
rm -rf ${OSTYPE}_adb_lib/
fi
echo "Adb installed"

echo "Checking aapt."
if [[ $(which aapt) != *"aapt"* ]]; then
echo "Attempting to install missing 'aapt' package. (requires sudo)"
mkdir -p ${OSTYPE}_aapt_lib
curl --silent https://raw.githubusercontent.com/whitewhidow/quest-sideloader-linux/$BRANCH/${OSTYPE}_aapt_lib/aapt -o ${OSTYPE}_aapt_lib/aapt > /dev/null
chmod +x ${OSTYPE}_aapt_lib/aapt

sudo rm -f /usr/local/bin/aapt 2> /dev/null
sudo rm -f /usr/bin/aapt 2> /dev/null

sudo cp ${OSTYPE}_aapt_lib/aapt /usr/bin
sudo cp ${OSTYPE}_aapt_lib/aapt /usr/local/bin

echo "Aapt copied from ${OSTYPE}_aapt_lib/aapt to /usr/local/bin."
rm -rf ${OSTYPE}_aapt_lib/
if ! command -v aapt &> /dev/null; then
if [ $OSTYPE == "linux" ]; then
echo "-> Please wait while we attempt to install missing 'aapt' package. (requires sudo)"
sudo apt install android-sdk-build-tools > /dev/null
fi
if [ $OSTYPE == "mac" ]; then
echo "PLEASE INSTALL aapt from androidaapt.com, WE WILL JUST DOWNLOAD LOCALLY FOR NOW, NO WORRIES !"
info "DOWNLOADING https://raw.githubusercontent.com/whitewhidow/quest-sideloader-linux/main/mac_aapt_lib/aapt"
curl -s https://raw.githubusercontent.com/whitewhidow/quest-sideloader-linux/main/mac_aapt_lib/aapt -o aapt
chmod +x ./aapt
AAPT="./aapt"
echo "PLEASE INSTALL aapt from androidaapt.com to avoid this download in the future !!"
fi
fi

if ! command -v aapt &> /dev/null; then
failed "Aapt could not be installed ?"
else
echo "Aapt installed"
AAPTINSTALLED=true
fi
echo "Aapt installed"








echo "Checking zenity."
if [[ $(which zenity) != *"zenity"* ]]; then
echo "Attempting to install missing 'zenity' package. (requires sudo)"
(sudo apt install zenity > /dev/null 2> /dev/null || brew install zenity > /dev/null 2> /dev/null) && echo "Zenity installed."
if ! command -v zenity &> /dev/null; then
echo "-> Please wait while we attempt to install missing 'zenity' package. (requires sudo)"
(sudo apt install zenity > /dev/null 2> /dev/null || brew install zenity > /dev/null 2> /dev/null)
fi
echo "Zenity installed"
if ! command -v zenity &> /dev/null; then
failed "Zenity could not be installed ?"
else
echo "Zenity installed"
ZENITYINSTALLED=true
fi




echo "Checking rclone."
if [[ $(which rclone) != *"rclone"* ]]; then
echo "Attempting to install missing 'rclone' paackage. (requires sudo)"
curl --silent https://rclone.org/install.sh | sudo bash
if ! command -v rclone &> /dev/null; then
echo "-> Please wait while we attempt to install missing 'rclone' paackage. (requires sudo)"
curl --silent https://rclone.org/install.sh | sudo bash > /dev/null
fi
if ! command -v rclone &> /dev/null; then
failed "Rclone could not be installed ?"
else
echo "Rclone installed"
RCLONEINSTALLED=true
fi



BRANCH="main"
if [ ! -z "$1" ]; then
BRANCH="$1"
fi

if [[ "$BRANCH" == "local" ]]; then
echo -ne ""
fi


echo "Fetching newest version ($BRANCH)."


OLDPATH="$PWD"

if [[ "$BRANCH" == "local" ]]; then
cd $OLDPATH
else
cd /tmp
rm -rf ./quest-sideloader-linux
git clone https://github.com/whitewhidow/quest-sideloader-linux.git
cd quest-sideloader-linux
git checkout $BRANCH
fi
echo "Rclone installed"



Expand All @@ -127,31 +201,22 @@ sudo cp ./whitewhidow-mount.sh /usr/local/bin/whitewhidow-mount
sudo cp ./install.sh /usr/local/bin/sideload-update


echo "Removing downloaded files"
cd $OLDPATH
rm -rf /tmp/sideload-install







if [[ $(which adb) == *"adb"* ]] && [[ $(which aapt) == *"aapt"* ]] && [[ $(which rclone) == *"rclone"* ]] && [[ $(which zenity) == *"zenity"* ]] && [[ $(which unzip) == *"unzip"* ]] && [[ $(which sideload) == *"sideload"* ]] && [[ $(which sideload-gui) == *"sideload-gui"* ]] && [[ $(which sideload-update) == *"sideload-update"* ]]; then
echo -e "\n\n -> Install seems to have been successfull, you can now run 'sideload-gui'\n"
if [[ "$ADBINSTALLED" ]] && [[ "$AAPTINSTALLED" ]] && [[ "$RCLONEINSTALLED" ]] && [[ "$ZENITYINSTALLED" ]] && [[ "$UNZIPINSTALLED" ]] && [[ $(which sideload) == *"sideload"* ]] && [[ $(which sideload-gui) == *"sideload-gui"* ]] && [[ $(which sideload-update) == *"sideload-update"* ]]; then
echo -e "\n\n -> Install seems to have been successfull, you can now run 'sideload-gui' to open the sideloader.\n\n -> To self-update this package run 'sideload-update'.\n\n"
[ -z $CI ] && zenity --question --text="whitewhidow/quest-sideloader-linux for Linux and Mac seems to have been successful,\nwould you like to open the sideload-gui now?" --width="600"
if [ $? = 0 ]; then
exec sideload-gui
exit 0
fi
else
[ -z $CI ] && zenity --warning --text="Install seems to have failed, please post the terminal output to\nhttp://www.github.com/whitewhidow/quest-sideloader-linux,\nand i will gladly assist!" --width="600"
echo -e "\n\n -> Install seems to have failed, please post the terminal output to www.github.com/whitewhidow/quest-sideloader-linux,\ni will gladly assist! \n"
read -p "Press [ENTER] to continue." < "$(tty 0>&2)"
exit 1
failed ''
fi






Loading

0 comments on commit 5e76328

Please sign in to comment.