├── bale.zip ├── README.md └── termux.sh /bale.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ptechgithub/Bale/HEAD/bale.zip -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Bale 2 | فایل های یک سوم بها کردن اینترنت بر روی پیامرسان بله 3 | 4 | آموزش از طریق لینک زیر 5 | 6 | 7 | https://telegra.ph/A-method-for-reducing-internet-traffic-by-a-third-and-connecting-to-free-internet-by-iSegaro-11-17 8 | 9 | 10 | ## اجرا روی Termux 11 | ``` 12 | bash <(curl -fsSL https://raw.githubusercontent.com/Ptechgithub/Bale/main/termux.sh) 13 | ``` 14 | ![9](https://raw.githubusercontent.com/Ptechgithub/configs/main/media/8.jpg) 15 | - با گزینه 1 نصب و اجرا کنید. 16 | - برای اجرای مجدد گزینه ی 2 رو انتخاب کنید. -------------------------------------------------------------------------------- /termux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #check_dependencies 4 | check_dependencies() { 5 | local dependencies=("wget" "curl" "golang" "openssl") 6 | 7 | for dep in "${dependencies[@]}"; do 8 | if ! command -v "${dep}" &> /dev/null; then 9 | echo "${dep} is not installed. Installing..." 10 | pkg install "${dep}" -y 11 | fi 12 | done 13 | } 14 | 15 | # install 16 | install() { 17 | 18 | pkg update -y 19 | check_dependencies 20 | mkdir bale 21 | cd bale 22 | wget https://github.com/iSegaro/Bale/raw/main/bale.zip 23 | unzip bale.zip 24 | 25 | # Step 2: Move syscall and net folders to the Go source directory 26 | cd go_patches/src 27 | mv ./syscall/* /data/data/com.termux/files/usr/lib/go/src/syscall/ 28 | mv ./net/* /data/data/com.termux/files/usr/lib/go/src/net/ 29 | cd - 30 | 31 | # Step 3: Get user input for IP and port 32 | clear 33 | read -p "Please Enter Your IP or Domain : " new_ip 34 | read -p "Please Enter Your Config Port: " new_port 35 | 36 | # Step 4: Check if the inputs are not empty 37 | if [ -z "$new_ip" ] || [ -z "$new_port" ]; then 38 | echo "IP and port are required." 39 | exit 1 40 | fi 41 | 42 | # Step 5: Replace : in main.go with user inputs 43 | sed -i "s/:/$new_ip:$new_port/g" main.go 44 | 45 | echo "main.go has been updated with the new IP and port." 46 | echo "Set your config with: 127.0.0.1:8185" 47 | go run main.go 48 | } 49 | 50 | # run again 51 | run() { 52 | 53 | if [ "$(basename "$(pwd)")" != "bale" ]; then 54 | cd bale || exit 1 55 | fi 56 | # Run the main.go file 57 | go run main.go 58 | } 59 | 60 | #Main menu 61 | main_menu() { 62 | clear 63 | echo "By --> Peyman * Github.com/Ptechgithub * " 64 | echo "& https://github.com/iSegaro " 65 | echo "--------‐----------------------------" 66 | echo "1) Install" 67 | echo "2) Run again" 68 | echo "0) Exit" 69 | read -p "Please choose: " choice 70 | 71 | case $choice in 72 | 1) 73 | install 74 | ;; 75 | 2) 76 | run 77 | ;; 78 | 0) 79 | echo "Exiting..." 80 | exit 0 81 | ;; 82 | *) 83 | echo "Invalid choice. try again.." 84 | ;; 85 | esac 86 | } 87 | 88 | main_menu --------------------------------------------------------------------------------