12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #!/usr/bin/env bash
- DIR=$(dirname "${BASH_SOURCE[0]}")
- FILE="GenshinImpact_Data/Plugins/xlua.dll"
- sum=($(md5sum $FILE))
- if [ "${sum}" != "f91c11ec6ac002d3f11c469f5b003976" ]; 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
- if [[ -e "$DIR/$FILE" ]]; then
- # Script may not be placed into the main directory
- echo "Please move all patch files outside the game directory prior executing."
- echo " -> See README.md for proper installation instructions" && exit 1
- fi
- if ! command -v xdelta3 &>/dev/null; then
- echo "xdelta3 application is required"
- exit 1
- fi
- echo "[WARNING] (Temporary) patch for 1.2.0 to fix a login and runtime crash"
- echo ""
- # ===========================================================
- echo "[WARNING] Hereby you are violating the game's Terms of Service!"
- echo " Do you accept the risk and possible consequences?"
- read -p "Accept? [y/n] " choice
- if [[ ! "$choice" == [JjSsYy]* ]]; then
- exit 1
- fi
- echo "--- Setting up script"
- cp -f "$DIR/patch_files/xlua_script.lua" "no message"
- echo "--- Applying xLua patch"
- # Backup file
- mv "$FILE" "$FILE.bak"
- xdelta3 -d -s "$FILE.bak" "$DIR/patch_files/xlua_patch.vcdiff" "$FILE"
- # Done!
- echo "==> Patch applied! Enjoy the game."
- exit 0
|