Skip to content

Instantly share code, notes, and snippets.

@EkkoG
Last active July 10, 2022 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EkkoG/c2bb61656f6beec090bbcdc937585e67 to your computer and use it in GitHub Desktop.
Save EkkoG/c2bb61656f6beec090bbcdc937585e67 to your computer and use it in GitHub Desktop.
A script used to replace Clash core with Clash.Meta core for Clash For Windows.
#!/bin/bash
DEST="/Applications/Clash for Windows.app/Contents/Resources/static/files/darwin/x64/clash-darwin"
VERSION=v1.12.0
ARCH=
if [[ $(uname -m) == 'arm64' ]]; then
ARCH=arm64
else
ARCH=amd64
fi
if [ -z "$1" ]; then
echo "Use default version: $VERSION"
else
VERSION=$1
fi
curl -L "https://github.com/MetaCubeX/Clash.Meta/releases/download/$VERSION/Clash.Meta-darwin-$ARCH-$VERSION.gz" -o /tmp/clash.meta.gz
if [ -f /tmp/clash.meta ]; then
rm /tmp/clash.meta
fi
gunzip /tmp/clash.meta.gz
chmod +x /tmp/clash.meta
cp /tmp/clash.meta "$DEST"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment