| Crates.io | rsbinder |
| lib.rs | rsbinder |
| version | 0.4.2 |
| created_at | 2024-01-27 08:25:56.452937+00 |
| updated_at | 2025-09-13 10:45:40.675155+00 |
| description | rsbinder provides crates implemented in pure Rust that make Binder IPC available on both Android and Linux. |
| homepage | https://hiking90.github.io/rsbinder-book/ |
| repository | https://github.com/hiking90/rsbinder |
| max_upload_size | |
| id | 1116584 |
| size | 552,553 |
rsbinder provides crates implemented in pure Rust that make Binder IPC available on both Android and Linux.
While Android's Binder IPC mechanism was merged into the Linux kernel back in 2015, its adoption within the broader Linux ecosystem remains limited. This project aims to address that by providing libraries and tools specifically designed for using Binder IPC in Linux environments.
One key reason for limited adoption is the lack of readily available tools and libraries optimized for the Linux world. This project tackles that challenge by leveraging Rust's strengths for efficient thread utilization, a crucial aspect for maximizing Binder IPC performance on Linux.
However, this project focuses on pure Rust implementations. If you're interested in C++-based Binder IPC for Linux, consider checking out the binder-linux project.
Although this project focuses on supporting Binder IPC in the Linux environment, it also provides compatibility with Android's Binder IPC. Compatibility Goal with Android Binder
The rsbinder library unlocks a significant opportunity for Android developers who prefer to use Rust for system-level programming. While Android provides an environment that supports Rust development, it lacks a dedicated API in its SDK or NDK for direct low-level interaction with Binder IPC using Rust. This gap is where rsbinder comes into play.
By integrating rsbinder into your project, you gain the ability to harness Binder IPC directly within the Android NDK environment using pure Rust.
rsbinder is still in its early development stages and is not yet ready for production use.
rsbinder offers the following features:
CONFIG_ANDROID=y
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ANDROID_BINDERFS=y
$ pacman -S linux-zen
Build all rsbinder crates.
$ cargo build
$ sudo target/debug/rsb_device binder
$ cargo run --bin rsb_hub
$ cargo run --bin hello_service
$ cargo run --bin hello_client
Both rsbinder and Android Binder utilize the same core protocol, enabling seamless communication between Android services and rsbinder clients, and vice versa. However, continued development is currently underway to further refine this interoperability.
rsbinder implements the same low-level Binder protocol as Android, ensuring binary compatibility at the kernel interface level. This means:
binder_transaction_data structuresrsbinder supports Android versions 11 through 16.
The rsbinder-aidl compiler generates Rust code that maintains compatibility with Android's AIDL:
.aidl syntax and semanticsComplete API parity between rsbinder and Android Binder isn't available due to fundamental differences in their underlying architectures:
rsbinder is licensed under the Apache License version 2.0.
Many of the source codes in rsbinder have been developed by quoting or referencing Android's binder implementation.