ClashX.Meta/install_dependency.sh

44 lines
1.5 KiB
Bash
Raw 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-02-19 12:37:15 +08:00
lipo -create -output com.metacubex.ClashX.ProxyConfigHelper.meta clash.meta-darwin-amd64* clash.meta-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 ..
2020-03-13 18:04:24 +08:00
echo "Pod install"
2022-07-12 20:53:48 +08:00
pod install
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-03-08 12:17:47 +08:00
curl -LO https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/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-03-08 12:17:47 +08:00
curl -LO https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/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-03-08 12:17:47 +08:00
curl -LO https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.dat
2022-06-12 12:04:29 +08:00
gzip geoip.dat
mv geoip.dat.gz ./ClashX/Resources/geoip.dat.gz
2019-10-02 21:43:18 +08:00
echo "install dashboard"
cd ClashX/Resources
2022-06-12 12:03:54 +08:00
git clone -b gh-pages https://github.com/MetaCubeX/yacd.git dashboard