#!/usr/bin/env bash # MacOS and *BSD do not have md5sum: use md5 instead if [[ $(uname) == "Darwin" || $(uname) == *"BSD" ]]; then md5sum() { md5 -q $@ } fi DIR=$(dirname "${BASH_SOURCE[0]}") FILE="UnityPlayer.dll" CEXE="GenshinImpact_Data/upload_crash.exe" sum=($(md5sum $FILE)) if [ "${sum}" != "38746fe5dbdce04311c84b2394f03686" ]; then # The patch might corrupt invalid/outdated files if this check is skippd. echo "Wrong file version or patch is already applied" echo "md5sum: ${sum}" && exit 1 fi # =========== DO NOT REMOVE START =========== if [[ -e "$DIR/$FILE" ]]; then # There is a good reason for this check. Do not pollute the game directory. echo "Please move all patch files outside the game directory prior executing." echo " -> See README.md for proper installation instructions" && exit 1 fi # =========== DO NOT REMOVE END =========== if ! command -v xdelta3 &>/dev/null; then echo "xdelta3 application is required" echo " -> Debian/Ubuntu: apt install xdelta3" echo " -> Fedora: dnf install xdelta" echo " -> Arch/Arch-based: pacman -S xdelta3" echo " -> macOS: \"port install xdelta\" or \"brew install xdelta\"" exit 1 fi # =========================================================== echo echo "--- Setting up blocked servers" # START OF SUDO DANGER ZONE etc_hosts="$(cat /etc/hosts)" # See dev_tools/network.md (up-to-date as of 2.1.0) servers=$(cat < Patch applied! Enjoy the game." echo echo "[NOTICE] Please refrain from sharing this project in public so" echo " that there can be Linux patches in the future. Thank you." exit 0