Skip to content

Fei-xiangShi/swu_network_custom_login

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SWU Network Custom Login Client

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.

Readme Language

en-US English

zh-CN 简体中文

Features

  • 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.

Table of Contents

Installation

Precompiled Binaries

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)
  • macOS
    • x86_64 (x86_64-apple-darwin)
    • ARM64 (aarch64-apple-darwin)
  • 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)
  • FreeBSD
    • x86_64 (x86_64-unknown-freebsd)
  • Illumos
    • x86_64 (x86_64-unknown-illumos)

Steps:

  1. Download the appropriate .tar.gz file for your platform.
  2. Extract the archive:
    tar -xzvf swu_network_custom_login.tar.gz
  3. Place the executable in a directory included in your PATH, or run it directly.

From Source

Ensure you have Rust installed.

  1. Clone the repository:
    git clone https://github.com/Fei-xiangShi/swu_network_custom_login.git
  2. Navigate to the project directory:
    cd swu_network_custom_login
  3. Build the project:
    cargo build --release
  4. The compiled binary will be located in target/release/.

Configuration

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.

Usage

Simply run the executable. The program will automatically:

  1. Check network connectivity at regular intervals.
  2. If the network is down, it will attempt to retrieve the login page URL.
  3. Encrypt the password if required.
  4. 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
    

Supported Platforms

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

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.

  2. Create a new branch:

    git checkout -b feature/your_feature
    
  3. Commit your changes:

    git commit -am 'Add a new feature'
    
  4. Push to the branch:

    git push origin feature/your_feature
    
  5. Open a Pull Request.

Please ensure your code adheres to the existing style and includes appropriate tests.

License

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.