Skip to content

Instantly share code, notes, and snippets.

@slice
Last active November 11, 2015 21:03
Show Gist options
  • Save slice/e217a12f3a992b6c1141 to your computer and use it in GitHub Desktop.
Save slice/e217a12f3a992b6c1141 to your computer and use it in GitHub Desktop.
# installs mcpelauncher-linux and its dependencies
PWD=`pwd`
if [[ ! $PWD == *"mcpelauncher-linux"* ]]; then
echo ">> NOTICE: Not running in the correct repository."
if [[ -d mcpelauncher-linux ]]; then
cd mcpelauncher-linux
echo ">> CDed into the repository."
else
if [[ -x /usr/bin/git ]]; then
echo ">> Cloning repository..."
git clone https://github.com/MCMrARM/mcpelauncher-linux.git
cd mcpelauncher-linux
else
echo ">> ERROR: Git not found. Cannot clone repository!"
exit
fi
fi
fi
if [[ ! -x /usr/bin/lsb_release ]]; then
echo ">> Make sure you are running on an *buntu system."
exit
fi
if [[ -x /usr/bin/java ]]; then
echo ">> Java was found."
else
echo ">> Installing openjdk-7-jre..."
sudo apt-get -y install openjdk-7-jre >/dev/null
echo ">> Finished."
fi
if [[ -f playdl.jar ]]; then
echo ">> Using existing playdl.jar."
else
echo ">> Fetching playdl.jar..."
wget --quiet --no-check-certificate https://mcmrarm.github.io/google_play_downloader/playdl.jar -O playdl.jar
fi
ls --color=none *.apk >/dev/null 2>&1
if [[ $? == 2 ]]; then
echo ">> Finished."
echo ">> Running playdl.jar..."
echo ">> NOTE: You must provide your Google email and password."
echo ">> This information is not stored, and is only used to download"
echo ">> the x86 version of MCPE."
echo ">>"
echo ">> IMPORTANT NOTICE: You must already have Minecraft: Pocket Edition purchased on your account."
echo ">> I am not responsible for anything that happens to your Google account."
echo ">>"
echo ">> (Please type 'y' when prompted to download the x86 version.)"
echo ">> (Your password will be displayed in plain text.)"
echo ">> (Please type in com.mojang.minecraftpe for the package.)"
java -jar playdl.jar
if [[ $? != 0 ]]; then
echo ">> ERROR: Script failed... Did you put in the correct password/email?"
exit
fi
echo ">> Done!"
fi
echo ">> Installing some tools we need..."
sudo apt-get -y install unzip >/dev/null
if [[ -f libs/libminecraftpe.so ]]; then
echo ">> Files have already been extracted."
echo ">> Using those."
else
MCPE=`ls --color=none *.apk`
echo ">> Using APK: $MCPE"
echo ">> Extracting files..."
bash extract.sh $MCPE >/dev/null
echo ">> Finished."
fi
echo ">> Adding i386 architecture..."
sudo dpkg --add-architecture i386
sudo apt-get update >/dev/null
echo ">> NOTE: Depending on your internet connection, this might take a long time."
echo ">> Please be patient!"
echo ">> Installing 32-bit libraries..."
sudo apt-get -y install lib32z1 lib32ncurses5 >/dev/null
echo ">> Installing needed tools..."
sudo apt-get -y install cmake build-essential >/dev/null
echo ">> Installing launcher libraries..."
sudo apt-get -y install libgles2-mesa-dev gcc-4.9 g++-4.9 gcc-4.9-multilib g++-4.9-multilib zlib1g-dev:i386 libx11-dev:i386 linux-libc-dev:i386 uuid-dev:i386 libpng-dev:i386 libx11-dev:i386 libgles2-mesa-dev libegl1-mesa-dev libmirclient-dev libwayland-dev libmircommon-dev libxkbcommon-dev >/dev/null
echo ">> Installing mesa dev libraries..."
sudo apt-get -y install libgles2-mesa-dev:i386 libegl1-mesa-dev:i386 >/dev/null
echo ">> Running CMake..."
cmake . >/dev/null
echo ">> Running make..."
make >/dev/null
if [[ $? != 0 ]]; then
echo ">> ERROR: Failed"
else
echo ">> Finished!"
./mcpelauncher >/dev/null
fi
echo ">> Want to run it again?"
echo ">> $ ./mcpelauncher"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment