From 1d59e6ae9a644fccae29f853cb914c9d63f4b97b Mon Sep 17 00:00:00 2001 From: egor-white Date: Sat, 14 Jun 2025 11:07:52 +0300 Subject: [PATCH] inital --- customize.sh | 25 ++++++++++ hosts | 35 ++++++++++++++ module.prop | 7 +++ service.sh | 11 +++++ zaprett | 128 +++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 206 insertions(+) create mode 100644 customize.sh create mode 100644 hosts create mode 100644 module.prop create mode 100644 service.sh create mode 100644 zaprett diff --git a/customize.sh b/customize.sh new file mode 100644 index 0000000..3622230 --- /dev/null +++ b/customize.sh @@ -0,0 +1,25 @@ +ui_print " _ _ " +ui_print " | | | | " +ui_print " ______ _ _ __ _ __ ___| |_| |_ " +ui_print " |_ / _' | '_ \| '__/ _ \ __| __|" +ui_print " / / (_| | |_) | | | __/ |_| |_ " +ui_print " /___\__,_| .__/|_| \\___|\__|\__|" +ui_print " | | " +ui_print " |_| " +ui_print "(!) To download app, use Telegram chat" +ui_print "Module by: egorwhite, Huananzhi X99, not_malware" +ui_print "App by: egorwhite" +ui_print "####################" +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 +ui_print "Filling configuration file..." +echo autorestart=true > /sdcard/zaprett/config; echo activelists=/storage/emulated/0/zaprett/lists/list-youtube.txt,/storage/emulated/0/zaprett/lists/list-discord.txt >> /sdcard/zaprett/config; echo zaprettdir=/sdcard/zaprett >> /sdcard/zaprett/config; echo strategy="" >> /sdcard/zaprett/config +ui_print "Copying lists and binaries to /sdcard/zaprett..." +cp -r $MODPATH/system/etc/zaprett/. /sdcard/zaprett/ +ui_print "Setting permissions..." +chmod 777 /sdcard/zaprett; chmod 777 $MODPATH/service.sh +ui_print "Cleaning temp files..." +rm -rf $MODPATH/system/etc/zaprett +ui_print "Installation done. Telegram chat: https://t.me/zaprett_module" diff --git a/hosts b/hosts new file mode 100644 index 0000000..5f6b7ce --- /dev/null +++ b/hosts @@ -0,0 +1,35 @@ +127.0.0.1 localhost +::1 ip6-localhost +89.108.98.20 chatgpt.com +134.0.118.88 ab.chatgpt.com +89.108.98.20 auth.openai.com +89.108.98.20 auth0.openai.com +89.108.98.20 platform.openai.com +89.108.98.20 cdn.oaistatic.com +89.108.98.20 files.oaiusercontent.com +89.108.98.20 cdn.auth0.com +89.108.98.20 tcr9i.chat.openai.com +89.108.98.20 webrtc.chatgpt.com +89.108.98.20 android.chat.openai.com +89.108.98.20 gemini.google.com +89.108.98.20 aistudio.google.com +89.108.98.20 ai.google +89.108.98.20 assistant-s3-pa.googleapis.com +89.108.98.20 generativelanguage.googleapis.com +89.108.98.20 alkalimakersuite-pa.clients6.google.com +64.233.162.188 mtalk.google.com +89.108.98.20 copilot.microsoft.com +89.108.98.20 sydney.bing.com +89.108.98.20 edgeservices.bing.com +89.108.98.20 claude.ai +89.108.98.20 aitestkitchen.withgoogle.com +89.108.98.20 aisandbox-pa.googleapis.com +89.108.98.20 o.pki.goog +89.108.98.20 labs.google +89.108.98.20 notebooklm.google +89.108.98.20 notebooklm.google.com +89.108.98.20 www.notion.so +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 \ No newline at end of file diff --git a/module.prop b/module.prop new file mode 100644 index 0000000..b54c18d --- /dev/null +++ b/module.prop @@ -0,0 +1,7 @@ +id=zaprett +name=zaprett +version=4.2 +versionCode=42 +author=egor-white, Huananzhi X99, Cherret +description=Ускорение CDN серверов Google. ТГК: https://t.me/zaprett_module +updateJson=https://raw.githubusercontent.com/egor-white/zaprett/refs/heads/main/update.json diff --git a/service.sh b/service.sh new file mode 100644 index 0000000..f06cd5e --- /dev/null +++ b/service.sh @@ -0,0 +1,11 @@ +#!/system/bin/sh +while [ -z "$(getprop sys.boot_completed)" ]; do sleep 2; done +sleep 1 +source /storage/emulated/0/zaprett/config +if [ "$autorestart" = "true" ]; then + su -c "zaprett start" + while true; do + sleep 3600 + su -c "zaprett restart" + done +fi diff --git a/zaprett b/zaprett new file mode 100644 index 0000000..dfb1035 --- /dev/null +++ b/zaprett @@ -0,0 +1,128 @@ +#!/system/bin/sh +source /sdcard/zaprett/config +arch=$(uname -m) + +clear_iptables_rules() { + iptables -t mangle -D POSTROUTING -j NFQUEUE --queue-num 200 --queue-bypass 2>/dev/null + iptables -t mangle -D PREROUTING -j NFQUEUE --queue-num 200 --queue-bypass 2>/dev/null + iptables -t filter -D FORWARD -j NFQUEUE --queue-num 200 --queue-bypass 2>/dev/null +} + +case "$arch" in + "x86_64") + nfqws="nfqws_x86_64" + ;; + "i386"|"i686") + nfqws="nfqws_x86" + ;; + "armv7l"|"arm") + nfqws="nfqws_arm32" + ;; + "aarch64"|"armv8l") + nfqws="nfqws_arm64" + ;; + "mips") + nfqws="nfqws_mips" + ;; + "mipsel") + nfqws="nfqws_mipsel" + ;; + *) + echo "Unknown arch: $arch" + exit 1 + ;; +esac + +if [ "$1" == "start" ]; then + 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 & + echo "zaprett service started!"; return 0; + 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; + +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 & + echo "zaprett service restarted!" +fi +if [[ -z $1 ]]; then + echo "zaprett installed. Telegram: t.me/zaprett_module" +fi \ No newline at end of file