adbd-auth-gateway is designed to simulate password-protected ADB environments, add gateway-level password protection to existing ADB services, centrally manage ADB routes, and provide a standalone android-login authentication simulator.
The project is primarily intended for:
- New energy vehicles
- Android-based in-vehicle systems
- Intelligent cockpits
- Voice recorders
- Industrial tablets
- Portable terminals
- Other embedded Android devices
This project contains two completely independent Rust binaries:
src/
├── main.rs
│ └── adbd-auth-gateway
│
└── android_login.rs
└── android-login
The two programs do not call or depend on each other.
main.rs: ADB protocol gatewayandroid_login.rs: Standalone interactive login simulator
adbd-auth-gateway operates between an ADB client and the target Android device's adbd service:
ADB Client
|
v
adbd-auth-gateway
|
v
Android adbd
Main features:
- ADB TCP routing
- Shell service authentication
- ADB
OPENstream control - Multi-device and multi-port management
- Transparent ADB protocol forwarding
- Authentication state management
Standard ADB connection:
ADB Client -> adbd
Connection through the gateway:
ADB Client
|
v
adbd-auth-gateway
|
| Password authentication
v
adbd
This can be used to simulate:
- Password-protected ADB on new energy vehicles
- Vendor-customized ADB authentication
- Authentication workflows on embedded Android devices
The gateway password is verified only by the gateway.
It is independent of:
- Android ADB RSA/TLS authorization
- Android lock screen passwords
- Android account passwords
- Root passwords
supasswords
Example:
vehicle-a 0.0.0.0:5510 -> 192.168.5.20:5555
vehicle-b 0.0.0.0:5511 -> 192.168.5.21:5555
recorder 0.0.0.0:5512 -> 192.168.5.30:5555
The gateway supports three configuration methods.
Configuration priority:
1. CLI arguments
2. Environment variables
3. TOML configuration file
Example:
adbd-auth-gateway \
-n vehicle \
-b 0.0.0.0:5510 \
-d 192.168.5.20:5555 \
-p passwdSupported arguments:
-n, --name Route name
-b, --bind Gateway listening address
-d, --device Target ADB socket
-p, --password Password for the current route
-h, --help Display help information
Example:
ADB_DEVICE_SERIAL="vehicle/192.168.5.20:5555/0.0.0.0:5510" \
adbd-auth-gatewayCommon environment variables:
ADB_DEVICE_SERIAL
ADB_GATEWAY_BIND
ADB_LOG_OPEN
ADB_STRICT_CHECKSUM
ADB_GATEWAY_CONFIG
Example:
[[listeners]]
name = "vehicle"
bind_addr = "0.0.0.0:5510"
device = "192.168.5.20:5555"Start the gateway with a configuration file:
adbd-auth-gateway -c ./sshd_auth.tomlcargo build --bin adbd-auth-gateway --release --target aarch64-linux-androidThe following ADB commands are forwarded transparently:
CNXN
AUTH
STLS
The following operations remain supported:
adb push
adb pull
sync
Shell services require gateway authentication.
1. Test one device with one port
2. Run adb connect
3. Run adb devices
4. Test adb push and adb pull
5. Test shell access without a password
6. Test an incorrect password
7. Test the correct password
8. Test a long-running shell connection
9. Test multi-device routing
android-login is a standalone binary.
It simulates:
/bin/login
It is intended for:
- Interactive password testing
- Login simulation in Android environments
- ADB authentication workflow experiments
It:
- Is not part of the gateway
- Does not call the gateway
- Does not read gateway configuration
- Runs independently from
adbd-auth-gateway
rustup target add aarch64-linux-android
export ANDROID_NDK_HOME="$HOME/Library/Android/sdk/ndk/<ndk-version>"
export NDK_TOOLCHAIN="$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/darwin-x86_64/bin"
export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="$NDK_TOOLCHAIN/aarch64-linux-android24-clang"
cargo build --bin android-login --release --target aarch64-linux-androidOn an Apple Silicon Mac, the NDK prebuilt directory may still be named
darwin-x86_64, depending on the installed NDK version.
Push the binary to the Android device:
adb push target/aarch64-linux-android/release/android-login /data/local/tmp/android-loginRun it:
/data/local/tmp/android-loginInteractive prompt:
login: shell
Password:
Default credentials:
Username:
shell
Password:
passwd
Use the following argument:
--no-userExample:
/data/local/tmp/android-login --no-userInteractive prompt:
Password:
Password:
passwd
This mode is suitable for:
- ADB environments
- Single-password authentication
- Automated testing
The default command is:
/system/bin/sh
To execute a specific command:
/data/local/tmp/android-login --no-user -- /system/bin/getprop ro.serialnoBuild for the current platform:
cargo build --releaseBuild for Android ARM64:
cargo build --release --target aarch64-linux-androidThe current android-login implementation uses the following hard-coded password:
password = passwd
This implementation is intended for:
- Testing
- Protocol compatibility experiments
- Embedded development and debugging
It must not be used as a production security boundary.
For production environments, replace the current password verification mechanism with:
- Password hashing
- Secure credential storage
- Proper key and secret management
MIT