A custom network login client for Southwest University (SWU) that automatically detects network connectivity and performs login operations when necessary. This client is written in Rust and supports multiple platforms, including Windows, macOS, Linux, and various architectures suitable for OpenWRT devices.
en-US English
zh-CN 简体中文
- Automatic Network Detection: Continuously monitors network status and initiates login when connectivity is lost.
- Multi-Platform Support: Precompiled binaries available for a wide range of platforms and architectures.
- Password Encryption: Supports encrypted password transmission for enhanced security.
- Customizable: Easy configuration through the
accounts.txt
file. - Lightweight: Minimal resource usage, suitable for devices with limited capabilities.
Download the precompiled binary for your platform from the Releases page.
Available Platforms:
- Windows
- x86_64 (
x86_64-pc-windows-msvc
) - x86 (
i686-pc-windows-msvc
) - ARM64 (
aarch64-pc-windows-msvc
)
- x86_64 (
- macOS
- x86_64 (
x86_64-apple-darwin
) - ARM64 (
aarch64-apple-darwin
)
- x86_64 (
- Linux
- x86_64 (
x86_64-unknown-linux-gnu
) - x86 (
i686-unknown-linux-gnu
) - ARM64 (
aarch64-unknown-linux-gnu
) - ARMV7 (
armv7-unknown-linux-gnueabihf
) - PowerPC64 (
powerpc64le-unknown-linux-gnu
) - RISC-V64 (
riscv64gc-unknown-linux-gnu
) - S390x (
s390x-unknown-linux-gnu
)
- x86_64 (
- FreeBSD
- x86_64 (
x86_64-unknown-freebsd
)
- x86_64 (
- Illumos
- x86_64 (
x86_64-unknown-illumos
)
- x86_64 (
Steps:
- Download the appropriate
.tar.gz
file for your platform. - Extract the archive:
tar -xzvf swu_network_custom_login.tar.gz
- Place the executable in a directory included in your
PATH
, or run it directly.
Ensure you have Rust installed.
- Clone the repository:
git clone https://github.com/Fei-xiangShi/swu_network_custom_login.git
- Navigate to the project directory:
cd swu_network_custom_login
- Build the project:
cargo build --release
- The compiled binary will be located in
target/release/
.
Create an accounts.txt
file in the same directory as the executable. This file should contain your login credentials.
Format:
- Each line represents a separate account.
- Username and password are separated by a space.
Example:
student123 mypassword
user456 anotherpassword
Note: If the accounts.txt
file is not found, the program will create one with an example account and prompt you to edit it.
Simply run the executable. The program will automatically:
- Check network connectivity at regular intervals.
- If the network is down, it will attempt to retrieve the login page URL.
- Encrypt the password if required.
- Perform the login operation using the credentials from
accounts.txt
.
Running the Program:
./swu_network_custom_login
Logging Output:
The program uses the env_logger
crate for logging. You can set the RUST_LOG
environment variable to control the log level.
Examples:
-
Set log level to
info
:export RUST_LOG=info
-
Run the program:
RUST_LOG=info./swu_network_custom_login
The client supports a wide range of platforms and architectures, making it versatile for various devices, including routers running OpenWRT.
Platforms and Architectures:
- Windows: x86, x86_64, ARM64
- macOS: x86_64, ARM64 (Apple Silicon)
- Linux: x86, x86_64, ARM64, LoongArch64, MIPS64, PowerPC64, RISC-V64, S390x
Contributions are welcome! Please follow these steps:
-
Fork the repository.
-
Create a new branch:
git checkout -b feature/your_feature
-
Commit your changes:
git commit -am 'Add a new feature'
-
Push to the branch:
git push origin feature/your_feature
-
Open a Pull Request.
Please ensure your code adheres to the existing style and includes appropriate tests.
This project is licensed under the GPL v2.0 License.
Disclaimer: This project is intended for educational purposes. Please ensure you have the necessary permissions to use it within your network environment. Use at your own risk.