Suffix/exact/keyword/regex matcher, normalizeDomain, and a hand-rolled geosite.dat parser (MIT v2fly) with category/domain search. Unit-tested.
15 lines
765 B
Bash
15 lines
765 B
Bash
#!/bin/bash
|
|
# Refresh the bundled geosite database from the MIT-licensed v2fly release.
|
|
# dlc.dat == geosite.dat: a GeoSiteList protobuf (category -> domain rules), parsed
|
|
# on-device by core/route/GeositeIndex. ~2.2 MB raw; APK-compressed to a few hundred KB.
|
|
# License notice is vendored alongside at app/src/main/assets/geosite/LICENSE.
|
|
set -euo pipefail
|
|
DIR="$(cd "$(dirname "$0")/.." && pwd)/app/src/main/assets/geosite"
|
|
mkdir -p "$DIR"
|
|
curl -fsSL --max-time 60 \
|
|
"https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat" \
|
|
-o "$DIR/geosite.dat"
|
|
curl -fsSL --max-time 30 \
|
|
"https://raw.githubusercontent.com/v2fly/domain-list-community/master/LICENSE" \
|
|
-o "$DIR/LICENSE"
|
|
echo "geosite.dat: $(wc -c < "$DIR/geosite.dat") bytes"
|