-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from omid-the-great/main
Update to v1.8.7
- Loading branch information
Showing
4 changed files
with
183 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Build | ||
|
||
on: | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Golang | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21.4' | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
distribution: 'temurin' | ||
|
||
- name: Setup Android SDK Tools | ||
uses: android-actions/setup-android@v3.2.0 | ||
with: | ||
cmdline-tools-version: 10406996 | ||
|
||
- name: Setup Android NDK | ||
uses: nttld/setup-ndk@v1.4.2 | ||
with: | ||
ndk-version: 'r26b' | ||
link-to-sdk: true | ||
- name: Setup Go Mobile | ||
run: | | ||
go install golang.org/x/mobile/cmd/gomobile@latest | ||
export PATH=$PATH:~/go/bin | ||
- name: Build | ||
run: | | ||
mkdir -p assets data | ||
bash gen_assets.sh download | ||
cp -v data/*.dat assets/ | ||
gomobile init | ||
go mod tidy | ||
gomobile bind -v -androidapi 19 -ldflags='-s -w' ./ | ||
- name: Upload AndroidLibXrayLite to release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
file: ./libv2ray*r | ||
tag: ${{ github.ref }} | ||
file_glob: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
set -o pipefail | ||
set -o nounset | ||
|
||
# Set magic variables for current file & dir | ||
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
__file="${__dir}/$(basename "${BASH_SOURCE[0]}")" | ||
__base="$(basename ${__file} .sh)" | ||
|
||
|
||
DATADIR=${__dir}/data | ||
|
||
compile_dat () { | ||
local TMPDIR=$(mktemp -d) | ||
|
||
trap 'echo -e "Aborted, error $? in command: $BASH_COMMAND"; rm -rf $TMPDIR; trap ERR; exit 1' ERR | ||
|
||
local GEOSITE=${GOPATH}/src/github.com/v2ray/domain-list-community | ||
if [[ -d ${GEOSITE} ]]; then | ||
cd ${GEOSITE} && git pull | ||
else | ||
mkdir -p ${GEOSITE} | ||
cd ${GEOSITE} && git clone https://github.com/v2ray/domain-list-community.git . | ||
fi | ||
go run main.go | ||
|
||
if [[ -e dlc.dat ]]; then | ||
rm -f $DATADIR/geosite.dat | ||
mv dlc.dat $DATADIR/geosite.dat | ||
echo "----------> geosite.dat updated." | ||
else | ||
echo "----------> geosite.dat failed to update." | ||
fi | ||
|
||
|
||
if [[ ! -x $GOPATH/bin/geoip ]]; then | ||
go get -v -u github.com/v2ray/geoip | ||
fi | ||
|
||
cd $TMPDIR | ||
curl -L -O http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip | ||
unzip -q GeoLite2-Country-CSV.zip | ||
mkdir geoip && find . -name '*.csv' -exec mv -t ./geoip {} + | ||
$GOPATH/bin/geoip \ | ||
--country=./geoip/GeoLite2-Country-Locations-en.csv \ | ||
--ipv4=./geoip/GeoLite2-Country-Blocks-IPv4.csv \ | ||
--ipv6=./geoip/GeoLite2-Country-Blocks-IPv6.csv | ||
|
||
if [[ -e geoip.dat ]]; then | ||
rm -f $DATADIR/geoip.dat | ||
mv ./geoip.dat $DATADIR/geoip.dat | ||
echo "----------> geoip.dat updated." | ||
else | ||
echo "----------> geoip.dat failed to update." | ||
fi | ||
trap ERR | ||
return 0 | ||
} | ||
|
||
|
||
download_dat () { | ||
wget -qO - https://api.github.com/repos/v2ray/geoip/releases/latest \ | ||
| grep browser_download_url | cut -d '"' -f 4 \ | ||
| wget -i - -O $DATADIR/geoip.dat | ||
|
||
wget -qO - https://api.github.com/repos/v2ray/domain-list-community/releases/latest \ | ||
| grep browser_download_url | cut -d '"' -f 4 \ | ||
| wget -i - -O $DATADIR/geosite.dat | ||
} | ||
|
||
ACTION="${1:-}" | ||
if [[ -z $ACTION ]]; then | ||
ACTION=download | ||
fi | ||
|
||
case $ACTION in | ||
"download") download_dat;; | ||
"compile") compile_dat;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.