mirror of
https://github.com/egor-white/zaprett.git
synced 2025-12-10 05:19:42 +05:00
Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c92b3a1b19 | ||
|
|
afed7b1122 | ||
|
|
1fa0e306ac | ||
|
|
fece7149e3 | ||
|
|
751788feb8 | ||
|
|
cc3500635f | ||
|
|
b01c5dc95f | ||
|
|
bf69249e12 | ||
|
|
63c45d8a2a | ||
|
|
26325b79f1 | ||
|
|
2cee0712c3 | ||
|
|
79b63ec5e9 | ||
|
|
c230f4876c | ||
|
|
531c403ce2 | ||
|
|
70d3b3e28d | ||
|
|
cf507f059b | ||
|
|
bf81100acb | ||
|
|
5ac9234ca2 | ||
|
|
156cedb080 | ||
|
|
f59ec45e9f | ||
|
|
45b25dd1ee | ||
|
|
e967dc12d7 | ||
|
|
6e1b3f12d9 | ||
|
|
6f395b1df9 | ||
|
|
638c45b243 | ||
|
|
78af1977fd | ||
|
|
97f495a56a | ||
|
|
63b279114e | ||
|
|
f1d3ec0b5e | ||
|
|
ffb296744b | ||
|
|
7966bbaebf | ||
|
|
f162004b56 | ||
|
|
71a5df5356 | ||
|
|
bcf0aa2b50 | ||
|
|
8248d43f67 |
34
.github/workflows/workflow.yml
vendored
34
.github/workflows/workflow.yml
vendored
@@ -31,7 +31,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Make build dirs
|
||||
run: mkdir -p zaprett/system/bin zaprett-extended/system/bin zaprett-tv/system/bin zaprett/system/etc/zaprett/lists zapret-latest out lists zapret-extended/system/etc/zaprett/lists zapret-tv/system/etc/zaprett/lists
|
||||
run: mkdir -p zaprett/system/bin zaprett-hosts/system/bin zaprett-tv/system/bin zaprett/system/etc/zaprett/lists zapret-latest out lists zapret-hosts/system/etc/zaprett/lists zapret-tv/system/etc/zaprett/lists
|
||||
|
||||
- name: Download latest zapret binaries
|
||||
run: |
|
||||
@@ -60,27 +60,25 @@ jobs:
|
||||
cp zapret-latest/binaries/android-x86_64/nfqws zaprett/system/bin/nfqws_x86_64
|
||||
cp zapret-latest/binaries/linux-mips/nfqws zaprett/system/bin/nfqws_mips
|
||||
cp zapret-latest/binaries/linux-mipsel/nfqws zaprett/system/bin/nfqws_mipsel
|
||||
#cp src/bin/zaprett zaprett/system/bin/
|
||||
|
||||
cp -a src/* zaprett/
|
||||
|
||||
#copy all files to another distributions
|
||||
cp -r zaprett/* zaprett-extended/
|
||||
cp -r zaprett/* zaprett-hosts/
|
||||
cp -r zaprett/* zaprett-tv/
|
||||
- name: Download and copy actual lists
|
||||
run: |
|
||||
wget https://raw.githubusercontent.com/CherretGit/zaprett-hosts-repo/refs/heads/main/lists/list-youtube.txt -O lists/list-youtube.txt
|
||||
wget https://raw.githubusercontent.com/CherretGit/zaprett-hosts-repo/refs/heads/main/lists/list-discord.txt -O lists/list-discord.txt
|
||||
wget https://raw.githubusercontent.com/CherretGit/zaprett-hosts-repo/refs/heads/main/lists/list-extended.txt -O lists/list-extended.txt
|
||||
|
||||
cp lists/list-youtube.txt zaprett/system/etc/zaprett/lists/
|
||||
cp lists/list-youtube.txt zaprett-extended/system/etc/zaprett/lists/
|
||||
cp lists/list-youtube.txt zaprett-hosts/system/etc/zaprett/lists/
|
||||
cp lists/list-youtube.txt zaprett-tv/system/etc/zaprett/lists/
|
||||
|
||||
cp lists/list-discord.txt zaprett/system/etc/zaprett/lists/
|
||||
cp lists/list-discord.txt zaprett-extended/system/etc/zaprett/lists/
|
||||
cp lists/list-discord.txt zaprett-hosts/system/etc/zaprett/lists/
|
||||
|
||||
cp lists/list-extended.txt zaprett-extended/system/etc/zaprett/lists/
|
||||
cp hosts/hosts zaprett-hosts/system/etc
|
||||
|
||||
- name: Create module.prop
|
||||
run: |
|
||||
@@ -94,9 +92,9 @@ jobs:
|
||||
updateJson=https://raw.githubusercontent.com/egor-white/zaprett/refs/heads/main/update.json
|
||||
EOF
|
||||
|
||||
cat > zaprett-extended/module.prop <<EOF
|
||||
cat > zaprett-hosts/module.prop <<EOF
|
||||
id=zaprett
|
||||
name=zaprett-extended
|
||||
name=zaprett-hosts
|
||||
version=${{ inputs.version }}
|
||||
versionCode=${{ inputs.version_code }}
|
||||
author=egor-white, Huananzhi X99, Cherret
|
||||
@@ -116,15 +114,15 @@ jobs:
|
||||
|
||||
- name: Tree files
|
||||
run: |
|
||||
tree zaprett/ zaprett-extended/ zaprett-tv/
|
||||
tree zaprett/ zaprett-hosts/ zaprett-tv/
|
||||
- name: Create archives
|
||||
run: |
|
||||
cd zaprett && zip -r ../zaprett.zip ./* && cd ..
|
||||
cd zaprett-extended && zip -r ../zaprett-extended.zip ./* && cd ..
|
||||
cd zaprett-hosts && zip -r ../zaprett-hosts.zip ./* && cd ..
|
||||
cd zaprett-tv && zip -r ../zaprett-tv.zip ./* && cd ..
|
||||
|
||||
mv zaprett.zip out/
|
||||
mv zaprett-extended.zip out/
|
||||
mv zaprett-hosts.zip out/
|
||||
mv zaprett-tv.zip out/
|
||||
|
||||
- name: Create release
|
||||
@@ -145,15 +143,15 @@ jobs:
|
||||
{
|
||||
"version": "${{ inputs.version }}",
|
||||
"versionCode": ${{ inputs.version_code }},
|
||||
"zipUrl": "https://github.com/${{ github.repository }}/releases/download/${{ inputs.release_tag }}zaprett.zip",
|
||||
"zipUrl": "https://github.com/${{ github.repository }}/releases/download/${{ inputs.tag }}/zaprett.zip",
|
||||
"changelog": "https://raw.githubusercontent.com/${{ github.repository }}/refs/heads/main/changelog.md"
|
||||
}
|
||||
EOF
|
||||
cat > update_extended.json <<EOF
|
||||
cat > update_hosts.json <<EOF
|
||||
{
|
||||
"version": "${{ inputs.version }}",
|
||||
"versionCode": ${{ inputs.version_code }},
|
||||
"zipUrl": "https://github.com/${{ github.repository }}/releases/download/${{ inputs.release_tag }}zaprett-extended.zip",
|
||||
"zipUrl": "https://github.com/${{ github.repository }}/releases/download/${{ inputs.tag }}/zaprett-hosts.zip",
|
||||
"changelog": "https://raw.githubusercontent.com/${{ github.repository }}/refs/heads/main/changelog.md"
|
||||
}
|
||||
EOF
|
||||
@@ -161,7 +159,7 @@ jobs:
|
||||
{
|
||||
"version": "${{ inputs.version }}",
|
||||
"versionCode": ${{ inputs.version_code }},
|
||||
"zipUrl": "https://github.com/${{ github.repository }}/releases/download/${{ inputs.release_tag }}zaprett-tv.zip",
|
||||
"zipUrl": "https://github.com/${{ github.repository }}/releases/download/${{ inputs.tag }}/zaprett-tv.zip",
|
||||
"changelog": "https://raw.githubusercontent.com/${{ github.repository }}/refs/heads/main/changelog.md"
|
||||
}
|
||||
EOF
|
||||
@@ -169,7 +167,7 @@ jobs:
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: "Update update's.json and changelog"
|
||||
file_pattern: 'update.json update_extended.json update_tv.json changelog.md'
|
||||
file_pattern: 'update.json update_hosts.json update_tv.json changelog.md'
|
||||
|
||||
- name: Send bot post
|
||||
env:
|
||||
@@ -180,7 +178,7 @@ jobs:
|
||||
|
||||
⬇️ <a href='https://github.com/egor-white/zaprett/releases/tag/${{ inputs.tag }}'>Скачать</a>
|
||||
|
||||
ℹ️ @zaprett_module
|
||||
ℹ️ @zaprett_module <a href='mailru.pro'>[web]</a>
|
||||
run: |
|
||||
curl -X POST "https://api.telegram.org/bot${{ secrets.BOT_TOKEN }}/sendMessage" \
|
||||
-d chat_id=-1002531270265 \
|
||||
|
||||
33
.github/workflows/workflow_without_post.yml
vendored
33
.github/workflows/workflow_without_post.yml
vendored
@@ -31,7 +31,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Make build dirs
|
||||
run: mkdir -p zaprett/system/bin zaprett-extended/system/bin zaprett-tv/system/bin zaprett/system/etc/zaprett/lists zapret-latest out lists zapret-extended/system/etc/zaprett/lists zapret-tv/system/etc/zaprett/lists
|
||||
run: mkdir -p zaprett/system/bin zaprett-hosts/system/bin zaprett-tv/system/bin zaprett/system/etc/zaprett/lists zapret-latest out lists zapret-hosts/system/etc/zaprett/lists zapret-tv/system/etc/zaprett/lists
|
||||
|
||||
- name: Download latest zapret binaries
|
||||
run: |
|
||||
@@ -60,27 +60,25 @@ jobs:
|
||||
cp zapret-latest/binaries/android-x86_64/nfqws zaprett/system/bin/nfqws_x86_64
|
||||
cp zapret-latest/binaries/linux-mips/nfqws zaprett/system/bin/nfqws_mips
|
||||
cp zapret-latest/binaries/linux-mipsel/nfqws zaprett/system/bin/nfqws_mipsel
|
||||
#cp src/bin/zaprett zaprett/system/bin/
|
||||
|
||||
cp -a src/* zaprett/
|
||||
|
||||
#copy all files to another distributions
|
||||
cp -r zaprett/* zaprett-extended/
|
||||
cp -r zaprett/* zaprett-hosts/
|
||||
cp -r zaprett/* zaprett-tv/
|
||||
- name: Download and copy actual lists
|
||||
run: |
|
||||
wget https://raw.githubusercontent.com/CherretGit/zaprett-hosts-repo/refs/heads/main/lists/list-youtube.txt -O lists/list-youtube.txt
|
||||
wget https://raw.githubusercontent.com/CherretGit/zaprett-hosts-repo/refs/heads/main/lists/list-discord.txt -O lists/list-discord.txt
|
||||
wget https://raw.githubusercontent.com/CherretGit/zaprett-hosts-repo/refs/heads/main/lists/list-extended.txt -O lists/list-extended.txt
|
||||
|
||||
cp lists/list-youtube.txt zaprett/system/etc/zaprett/lists/
|
||||
cp lists/list-youtube.txt zaprett-extended/system/etc/zaprett/lists/
|
||||
cp lists/list-youtube.txt zaprett-hosts/system/etc/zaprett/lists/
|
||||
cp lists/list-youtube.txt zaprett-tv/system/etc/zaprett/lists/
|
||||
|
||||
cp lists/list-discord.txt zaprett/system/etc/zaprett/lists/
|
||||
cp lists/list-discord.txt zaprett-extended/system/etc/zaprett/lists/
|
||||
cp lists/list-discord.txt zaprett-hosts/system/etc/zaprett/lists/
|
||||
|
||||
cp lists/list-extended.txt zaprett-extended/system/etc/zaprett/lists/
|
||||
cp hosts/hosts zaprett-hosts/system/etc
|
||||
|
||||
- name: Create module.prop
|
||||
run: |
|
||||
@@ -94,9 +92,9 @@ jobs:
|
||||
updateJson=https://raw.githubusercontent.com/egor-white/zaprett/refs/heads/main/update.json
|
||||
EOF
|
||||
|
||||
cat > zaprett-extended/module.prop <<EOF
|
||||
cat > zaprett-hosts/module.prop <<EOF
|
||||
id=zaprett
|
||||
name=zaprett-extended
|
||||
name=zaprett-hosts
|
||||
version=${{ inputs.version }}
|
||||
versionCode=${{ inputs.version_code }}
|
||||
author=egor-white, Huananzhi X99, Cherret
|
||||
@@ -116,15 +114,15 @@ jobs:
|
||||
|
||||
- name: Tree files
|
||||
run: |
|
||||
tree zaprett/ zaprett-extended/ zaprett-tv/
|
||||
tree zaprett/ zaprett-hosts/ zaprett-tv/
|
||||
- name: Create archives
|
||||
run: |
|
||||
cd zaprett && zip -r ../zaprett.zip ./* && cd ..
|
||||
cd zaprett-extended && zip -r ../zaprett-extended.zip ./* && cd ..
|
||||
cd zaprett-hosts && zip -r ../zaprett-hosts.zip ./* && cd ..
|
||||
cd zaprett-tv && zip -r ../zaprett-tv.zip ./* && cd ..
|
||||
|
||||
mv zaprett.zip out/
|
||||
mv zaprett-extended.zip out/
|
||||
mv zaprett-hosts.zip out/
|
||||
mv zaprett-tv.zip out/
|
||||
|
||||
- name: Create release
|
||||
@@ -145,15 +143,15 @@ jobs:
|
||||
{
|
||||
"version": "${{ inputs.version }}",
|
||||
"versionCode": ${{ inputs.version_code }},
|
||||
"zipUrl": "https://github.com/${{ github.repository }}/releases/download/${{ inputs.release_tag }}zaprett.zip",
|
||||
"zipUrl": "https://github.com/${{ github.repository }}/releases/download/${{ inputs.tag }}/zaprett.zip",
|
||||
"changelog": "https://raw.githubusercontent.com/${{ github.repository }}/refs/heads/main/changelog.md"
|
||||
}
|
||||
EOF
|
||||
cat > update_extended.json <<EOF
|
||||
cat > update_hosts.json <<EOF
|
||||
{
|
||||
"version": "${{ inputs.version }}",
|
||||
"versionCode": ${{ inputs.version_code }},
|
||||
"zipUrl": "https://github.com/${{ github.repository }}/releases/download/${{ inputs.release_tag }}zaprett-extended.zip",
|
||||
"zipUrl": "https://github.com/${{ github.repository }}/releases/download/${{ inputs.tag }}/zaprett-hosts.zip",
|
||||
"changelog": "https://raw.githubusercontent.com/${{ github.repository }}/refs/heads/main/changelog.md"
|
||||
}
|
||||
EOF
|
||||
@@ -161,7 +159,7 @@ jobs:
|
||||
{
|
||||
"version": "${{ inputs.version }}",
|
||||
"versionCode": ${{ inputs.version_code }},
|
||||
"zipUrl": "https://github.com/${{ github.repository }}/releases/download/${{ inputs.release_tag }}zaprett-tv.zip",
|
||||
"zipUrl": "https://github.com/${{ github.repository }}/releases/download/${{ inputs.tag }}/zaprett-tv.zip",
|
||||
"changelog": "https://raw.githubusercontent.com/${{ github.repository }}/refs/heads/main/changelog.md"
|
||||
}
|
||||
EOF
|
||||
@@ -169,5 +167,4 @@ jobs:
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: "Update update's.json and changelog"
|
||||
file_pattern: 'update.json update_extended.json update_tv.json changelog.md'
|
||||
|
||||
file_pattern: 'update.json update_hosts.json update_tv.json changelog.md'
|
||||
|
||||
@@ -7,11 +7,12 @@
|
||||
Требования:
|
||||
* Magisk 24.1+
|
||||
* Прямые руки
|
||||
* Termux или другой эмулятор терминала **И/ИЛИ** [приложение zaprett](https://github.com/egor-white/zaprett-app) **ИЛИ** [ремейк приложения zaprett от cherret](https://github.com/CherretGit/zaprett-app)
|
||||
* Termux или другой эмулятор терминала **И/ИЛИ** [приложение zaprett](https://github.com/egor-white/zaprett-app) (не обновляется) **ИЛИ** [ремейк приложения zaprett от cherret](https://github.com/CherretGit/zaprett-app)
|
||||
|
||||
На данный момент модуль умеет:
|
||||
+ Включать, выключать и перезапускать nfqws
|
||||
+ Работать с листами и стратегиями
|
||||
+ Предлагать обновления через Magisk/KSU/KSU Next/APatch
|
||||
|
||||
|
||||
|
||||
Создано - [egor-white](https://t.me/cheesedroid), [Cherret](https://t.me/Cherret), [MT6833](https://t.me/MT6833).
|
||||
Создано - [egor-white](https://t.me/cheesedroid), [Cherret](https://t.me/Cherret), [MT6833](https://t.me/MT6833).
|
||||
|
||||
@@ -1 +1 @@
|
||||
Добавлены команды (zaprett) help, module-ver, bin-ver
|
||||
Небольшие изменения в customize.sh
|
||||
|
||||
@@ -32,4 +32,4 @@
|
||||
89.108.98.20 www.googleapis.com
|
||||
89.108.98.20 proactivebackend-pa.googleapis.com
|
||||
89.108.98.20 grok.com
|
||||
89.108.98.20 assets.grok.com
|
||||
89.108.98.20 assets.grok.com
|
||||
@@ -15,10 +15,20 @@ ui_print "Unpacking archive..."
|
||||
unzip -o "$ZIPFILE" -x 'META-INF/*' -d $MODPATH >&2
|
||||
|
||||
ui_print "Creating zaprett directory..."
|
||||
mkdir /sdcard/zaprett; mkdir /sdcard/zaprett/lists; mkdir /sdcard/zaprett/bin; mkdir /sdcard/zaprett/strategies; touch /sdcard/zaprett/config
|
||||
mkdir /sdcard/zaprett; mkdir /sdcard/zaprett/lists; mkdir /sdcard/zaprett/bin; mkdir /sdcard/zaprett/strategies;
|
||||
|
||||
ui_print "Filling configuration file..."
|
||||
echo autorestart=true > /sdcard/zaprett/config; echo activelists=/storage/emulated/0/zaprett/lists/list-youtube.txt >> /sdcard/zaprett/config; echo zaprettdir=/sdcard/zaprett >> /sdcard/zaprett/config; echo strategy="" >> /sdcard/zaprett/config
|
||||
ui_print "Removing old config (config structure changed)..."
|
||||
rm -f /sdcard/zaprett/config
|
||||
|
||||
ui_print "Filling configuration file if not exist..."
|
||||
if [ ! -f "/sdcard/zaprett/config" ]; then
|
||||
echo start_on_boot=true > /sdcard/zaprett/config
|
||||
echo active_lists=/storage/emulated/0/zaprett/lists/list-youtube.txt >> /sdcard/zaprett/config
|
||||
echo active_exclude_lists= >> /sdcard/zaprett/config
|
||||
echo list_type=whitelist
|
||||
echo zaprettdir=/sdcard/zaprett >> /sdcard/zaprett/config
|
||||
echo strategy="" >> /sdcard/zaprett/config
|
||||
fi
|
||||
|
||||
ui_print "Copying lists and binaries to /sdcard/zaprett..."
|
||||
cp -r $MODPATH/system/etc/zaprett/. /sdcard/zaprett/
|
||||
@@ -50,7 +60,7 @@ case "$arch" in
|
||||
;;
|
||||
esac
|
||||
mv $MODPATH/system/bin/$nfqws $MODPATH/system/bin/nfqws
|
||||
rm nfqws_*
|
||||
rm $MODPATH/system/bin/nfqws_*
|
||||
mkdir $MODPATH/tmp
|
||||
|
||||
ui_print "Setting permissions..."
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/system/bin/sh
|
||||
while [ -z "$(getprop sys.boot_completed)" ]; do sleep 2; done
|
||||
sleep 10
|
||||
sleep 15
|
||||
source /storage/emulated/0/zaprett/config
|
||||
if [ "$autorestart" = "true" ]; then
|
||||
su -c "zaprett start"
|
||||
|
||||
@@ -7,99 +7,92 @@ clear_iptables_rules() {
|
||||
iptables -t filter -D FORWARD -j NFQUEUE --queue-num 200 --queue-bypass 2>/dev/null
|
||||
}
|
||||
|
||||
if [ "$1" == "start" ]; then
|
||||
start_service() {
|
||||
rm -f /data/adb/modules/zaprett/tmp/*
|
||||
echo "Starting zaprett...";
|
||||
hostlist=""
|
||||
for itm in $(echo "$activelists" | tr ',' ' ' | sort -u); do
|
||||
if [ -f "$itm" ]; then
|
||||
dst="/data/adb/modules/zaprett/tmp/$(basename "$itm")"
|
||||
cp "$itm" "$dst"
|
||||
case "$hostlist" in
|
||||
*"--hostlist=$dst"*) ;;
|
||||
*) hostlist="$hostlist --hostlist=$dst" ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
|
||||
config=""
|
||||
if [[ -n "$strategy" && -f "$strategy" ]]; then
|
||||
config="$(eval "echo \"$(<"$strategy")\"")"
|
||||
fi
|
||||
|
||||
if [[ -z "$config" ]]; then
|
||||
config="--filter-tcp=80 --dpi-desync=fake,split2 --dpi-desync-autottl=2 --dpi-desync-fooling=md5sig,badsum $hostlist --new"
|
||||
config="$config --filter-tcp=443 $hostlist --dpi-desync=fake,split2 --dpi-desync-repeats=6 --dpi-desync-fooling=md5sig,badsum --dpi-desync-fake-tls=${zaprettdir}/bin/tls_clienthello_www_google_com.bin --new"
|
||||
config="$config --filter-tcp=80,443 --dpi-desync=fake,disorder2 --dpi-desync-repeats=6 --dpi-desync-autottl=2 --dpi-desync-fooling=md5sig,badsum $hostlist --new"
|
||||
config="$config --filter-udp=50000-50100 --dpi-desync=fake --dpi-desync-any-protocol --dpi-desync-fake-quic=0xC30000000108 --new"
|
||||
config="$config --filter-udp=443 $hostlist --dpi-desync=fake --dpi-desync-repeats=6 --dpi-desync-fake-quic=${zaprettdir}/bin/quic_initial_www_google_com.bin --new"
|
||||
config="$config --filter-udp=443 --dpi-desync=fake --dpi-desync-repeats=6 $hostlist"
|
||||
echo "Starting zaprett..."
|
||||
|
||||
hostlist=""
|
||||
case "$list_type" in
|
||||
whitelist)
|
||||
lists="$active_lists"
|
||||
opt="--hostlist"
|
||||
;;
|
||||
blacklist)
|
||||
lists="$active_exclude_lists"
|
||||
opt="--hostlist-exclude"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown list-type: $list_type" >&2
|
||||
lists=""
|
||||
opt=""
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -n "$lists" ] && [ -n "$opt" ]; then
|
||||
for itm in $(echo "$lists" | tr ',' ' ' | sort -u); do
|
||||
if [ -f "$itm" ]; then
|
||||
dst="/data/adb/modules/zaprett/tmp/$(basename "$itm")"
|
||||
cp "$itm" "$dst"
|
||||
case "$hostlist" in
|
||||
*"$opt=$dst"*) ;;
|
||||
*) hostlist="$hostlist $opt=$dst" ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
config=""
|
||||
if [[ -n "$strategy" && -f "$strategy" ]]; then
|
||||
config="$(eval "echo \"$(<"$strategy")\"")"
|
||||
fi
|
||||
|
||||
if [[ -z "$config" ]]; then
|
||||
config="--filter-tcp=80 --dpi-desync=fake,split2 --dpi-desync-autottl=2 --dpi-desync-fooling=md5sig,badsum $hostlist --new"
|
||||
config="$config --filter-tcp=443 $hostlist --dpi-desync=fake,split2 --dpi-desync-repeats=6 --dpi-desync-fooling=md5sig,badsum --dpi-desync-fake-tls=${zaprettdir}/bin/tls_clienthello_www_google_com.bin --new"
|
||||
config="$config --filter-tcp=80,443 --dpi-desync=fake,disorder2 --dpi-desync-repeats=6 --dpi-desync-autottl=2 --dpi-desync-fooling=md5sig,badsum $hostlist --new"
|
||||
config="$config --filter-udp=50000-50100 --dpi-desync=fake --dpi-desync-any-protocol --dpi-desync-fake-quic=0xC30000000108 --new"
|
||||
config="$config --filter-udp=443 $hostlist --dpi-desync=fake --dpi-desync-repeats=6 --dpi-desync-fake-quic=${zaprettdir}/bin/quic_initial_www_google_com.bin --new"
|
||||
config="$config --filter-udp=443 --dpi-desync=fake --dpi-desync-repeats=6 $hostlist"
|
||||
fi
|
||||
|
||||
sysctl net.netfilter.nf_conntrack_tcp_be_liberal=1 > /dev/null
|
||||
|
||||
fi
|
||||
sysctl net.netfilter.nf_conntrack_tcp_be_liberal=1 > /dev/null
|
||||
|
||||
iptables -t mangle -I POSTROUTING -j NFQUEUE --queue-num 200 --queue-bypass
|
||||
iptables -t mangle -I PREROUTING -j NFQUEUE --queue-num 200 --queue-bypass
|
||||
iptables -t filter -A FORWARD -j NFQUEUE --queue-num 200 --queue-bypass
|
||||
|
||||
nfqws --uid=0:0 --qnum=200 $config > /dev/null &
|
||||
echo "zaprett service started!"; return 0;
|
||||
fi
|
||||
nfqws --uid=0:0 --qnum=200 $config > /dev/null &
|
||||
echo "zaprett service started!"
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
echo "Stopping zaprett..."
|
||||
clear_iptables_rules
|
||||
kill "$(pidof nfqws)" 2>/dev/null
|
||||
rm -f /data/adb/modules/zaprett/tmp/*
|
||||
echo "zaprett service stopped!"
|
||||
}
|
||||
|
||||
if [ "$1" == "start" ]; then
|
||||
start_service
|
||||
fi
|
||||
|
||||
if [ "$1" == "stop" ]; then
|
||||
clear_iptables_rules
|
||||
kill $(pidof nfqws);
|
||||
rm -f /data/adb/modules/zaprett/tmp/*
|
||||
echo "zaprett service stopped!"; return 0; fi;
|
||||
stop_service
|
||||
fi
|
||||
|
||||
if [ "$1" == "status" ]; then
|
||||
pidof "nfqws" > /dev/null && echo "zaprett is working" || echo "zaprett is stopped"
|
||||
fi
|
||||
|
||||
if [ "$1" == "restart" ]; then
|
||||
echo "Stopping zaprett..."
|
||||
clear_iptables_rules
|
||||
kill "$(pidof nfqws)" 2>/dev/null
|
||||
rm -f /data/adb/modules/zaprett/tmp/*
|
||||
echo "Starting zaprett..."
|
||||
hostlist=""
|
||||
for itm in $(echo "$activelists" | tr ',' ' ' | sort -u); do
|
||||
if [ -f "$itm" ]; then
|
||||
dst="/data/adb/modules/zaprett/tmp/$(basename "$itm")"
|
||||
cp "$itm" "$dst"
|
||||
case "$hostlist" in
|
||||
*"--hostlist=$dst"*) ;;
|
||||
*) hostlist="$hostlist --hostlist=$dst" ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
|
||||
config=""
|
||||
if [[ -n "$strategy" && -f "$strategy" ]]; then
|
||||
config="$(eval "echo \"$(<"$strategy")\"")"
|
||||
fi
|
||||
|
||||
if [[ -z "$config" ]]; then
|
||||
config="--filter-tcp=80 --dpi-desync=fake,split2 --dpi-desync-autottl=2 --dpi-desync-fooling=md5sig,badsum $hostlist --new"
|
||||
config="$config --filter-tcp=443 $hostlist --dpi-desync=fake,split2 --dpi-desync-repeats=6 --dpi-desync-fooling=md5sig,badsum --dpi-desync-fake-tls=${zaprettdir}/bin/tls_clienthello_www_google_com.bin --new"
|
||||
config="$config --filter-tcp=80,443 --dpi-desync=fake,disorder2 --dpi-desync-repeats=6 --dpi-desync-autottl=2 --dpi-desync-fooling=md5sig,badsum $hostlist --new"
|
||||
config="$config --filter-udp=50000-50100 --dpi-desync=fake --dpi-desync-any-protocol --dpi-desync-fake-quic=0xC30000000108 --new"
|
||||
config="$config --filter-udp=443 $hostlist --dpi-desync=fake --dpi-desync-repeats=6 --dpi-desync-fake-quic=${zaprettdir}/bin/quic_initial_www_google_com.bin --new"
|
||||
config="$config --filter-udp=443 --dpi-desync=fake --dpi-desync-repeats=6 $hostlist"
|
||||
|
||||
fi
|
||||
sysctl net.netfilter.nf_conntrack_tcp_be_liberal=1 > /dev/null
|
||||
|
||||
iptables -t mangle -I POSTROUTING -j NFQUEUE --queue-num 200 --queue-bypass
|
||||
iptables -t mangle -I PREROUTING -j NFQUEUE --queue-num 200 --queue-bypass
|
||||
iptables -t filter -A FORWARD -j NFQUEUE --queue-num 200 --queue-bypass
|
||||
|
||||
nfqws --uid=0:0 --qnum=200 $config > /dev/null &
|
||||
stop_service
|
||||
start_service
|
||||
echo "zaprett service restarted!"
|
||||
fi
|
||||
|
||||
if [ "$1" == "help" ]; then
|
||||
echo -e "Помощь по модулю zaprett:\nzaprett start - запуск сервиса\nzaprett stop - остановка сервиса\nzaprett restart - перезапуск сервиса\nzaprett module-ver - версия модуля\nzaprett bin-ver - версия бинарных файлов"
|
||||
echo -e "Помощь по модулю zaprett:\nzaprett start - запуск сервиса\nzaprett stop - остановка сервиса\nzaprett restart - перезапуск сервиса\nzaprett status - статус сервиса\nzaprett module-ver - версия модуля\nzaprett bin-ver - версия бинарных файлов"
|
||||
fi
|
||||
|
||||
if [ "$1" == "module-ver" ]; then
|
||||
@@ -107,7 +100,7 @@ if [ "$1" == "module-ver" ]; then
|
||||
fi
|
||||
|
||||
if [ "$1" == "bin-ver" ]; then
|
||||
nfqws --version | grep -o 'version v[0-9]\+' | sed 's/version v//'
|
||||
nfqws --version | grep -o 'version v[0-9.]*' | head -n1 | cut -d' ' -f2
|
||||
fi
|
||||
|
||||
if [[ -z $1 ]]; then
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": "4.5",
|
||||
"versionCode": 45,
|
||||
"zipUrl": "https://github.com/egor-white/zaprett/releases/download/zaprett.zip",
|
||||
"version": "4.9",
|
||||
"versionCode": 49,
|
||||
"zipUrl": "https://github.com/egor-white/zaprett/releases/download/4.9.0/zaprett.zip",
|
||||
"changelog": "https://raw.githubusercontent.com/egor-white/zaprett/refs/heads/main/changelog.md"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": "4.5",
|
||||
"versionCode": 45,
|
||||
"zipUrl": "https://github.com/egor-white/zaprett/releases/download/zaprett-extended.zip",
|
||||
"version": "100",
|
||||
"versionCode": 100,
|
||||
"zipUrl": "https://github.com/egor-white/zaprett/releases/download/4.7.0/zaprett-hosts.zip",
|
||||
"changelog": "https://raw.githubusercontent.com/egor-white/zaprett/refs/heads/main/changelog.md"
|
||||
}
|
||||
|
||||
6
update_hosts.json
Normal file
6
update_hosts.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"version": "4.9",
|
||||
"versionCode": 49,
|
||||
"zipUrl": "https://github.com/egor-white/zaprett/releases/download/4.9.0/zaprett-hosts.zip",
|
||||
"changelog": "https://raw.githubusercontent.com/egor-white/zaprett/refs/heads/main/changelog.md"
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": "4.5",
|
||||
"versionCode": 45,
|
||||
"zipUrl": "https://github.com/egor-white/zaprett/releases/download/zaprett-tv.zip",
|
||||
"version": "4.9",
|
||||
"versionCode": 49,
|
||||
"zipUrl": "https://github.com/egor-white/zaprett/releases/download/4.9.0/zaprett-tv.zip",
|
||||
"changelog": "https://raw.githubusercontent.com/egor-white/zaprett/refs/heads/main/changelog.md"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user