ClashX.Meta/install_dependency.sh

51 lines
1.6 KiB
Bash
Raw Permalink Normal View History

2019-10-02 21:43:18 +08:00
#!/bin/bash
2020-12-03 22:01:40 +08:00
set -e
echo "Unzip core files"
cd clash.meta
2022-10-21 13:09:53 +08:00
ls
gzip -d *.gz
echo "Create Universal core"
2023-12-02 21:47:19 +08:00
lipo -create -output com.metacubex.ClashX.ProxyConfigHelper.meta mihomo-darwin-amd64* mihomo-darwin-arm64*
chmod +x com.metacubex.ClashX.ProxyConfigHelper.meta
2022-07-31 10:12:38 +08:00
echo "Update meta core md5 to code"
2022-07-31 12:03:44 +08:00
sed -i '' "s/WOSHIZIDONGSHENGCHENGDEA/$(md5 -q com.metacubex.ClashX.ProxyConfigHelper.meta)/g" ../ClashX/AppDelegate.swift
2022-07-31 12:07:34 +08:00
sed -n '20p' ../ClashX/AppDelegate.swift
2022-07-31 10:12:38 +08:00
2022-07-31 12:03:44 +08:00
echo "Gzip Universal core"
gzip com.metacubex.ClashX.ProxyConfigHelper.meta
cp com.metacubex.ClashX.ProxyConfigHelper.meta.gz ../ClashX/Resources/
cd ..
2019-10-02 21:43:18 +08:00
echo "delete old files"
2023-03-08 16:45:42 +08:00
rm -f ./ClashX/Resources/country.mmdb
2022-06-12 12:04:29 +08:00
rm -f ./ClashX/Resources/geosite.dat
rm -f ./ClashX/Resources/geoip.dat
2019-10-02 21:43:18 +08:00
rm -rf ./ClashX/Resources/dashboard
rm -f GeoLite2-Country.*
echo "install mmdb"
2023-06-07 00:48:18 +08:00
curl -LO https://github.com/MetaCubeX/meta-rules-dat/raw/release/country.mmdb
2023-03-08 16:45:42 +08:00
gzip country.mmdb
mv country.mmdb.gz ./ClashX/Resources/country.mmdb.gz
2022-06-12 12:04:29 +08:00
echo "install geosite"
2023-06-07 00:48:18 +08:00
curl -LO https://github.com/MetaCubeX/meta-rules-dat/raw/release/geosite.dat
2022-06-12 12:04:29 +08:00
gzip geosite.dat
mv geosite.dat.gz ./ClashX/Resources/geosite.dat.gz
echo "install geoip"
2023-06-07 00:48:18 +08:00
curl -LO https://github.com/MetaCubeX/meta-rules-dat/raw/release/geoip.dat
2022-06-12 12:04:29 +08:00
gzip geoip.dat
mv geoip.dat.gz ./ClashX/Resources/geoip.dat.gz
2023-10-08 15:36:07 +08:00
echo "install yacd dashboard"
2019-10-02 21:43:18 +08:00
cd ClashX/Resources
2023-12-02 21:47:19 +08:00
git clone -b gh-pages https://github.com/MetaCubeX/Yacd-meta.git dashboard/yacd
2023-10-08 15:36:07 +08:00
cd dashboard/yacd
rm -rf *.webmanifest *.js CNAME .git
2023-10-08 15:36:07 +08:00
cd ../../
echo "install XD dashboard"
git clone -b gh-pages https://github.com/metacubex/metacubexd.git dashboard/xd
cd dashboard/xd
rm -rf *.webmanifest CNAME .git