Gnirehtet 2: our reverse tethering tool for Android now available in Rust
Gnirehtet becomes native
Several months ago, I introduced gnirehtet, a tool providing reverse tethering for Android without any root access.
Since then, I rewrote the desktop-part of the application in Rust (the original version was in Java). As a consequence, the application is native, and the Java Runtime Environment in not needed anymore.
And it’s also open source:
How to use gnirehtet 2
(Almost) the same way as gnirehtet 1.
To share your computer connection with your Android device, just download the Rust version of gnirehtet for your system, and execute:
(adb must be installed)
More advanced usage, like enabling reverse tethering for several devices simultaneously, is also easy. Check the README.
gnirehtet 2 work?
To get rid of the shell scripts, the command-line parsing is now directly handled by the application (both the Java and the Rust version). This allows a more consistent behavior across different platforms.
What about Rust?
I didn’t know Rust at all before rewriting gnirehtet. It provides many cool features:
- zero-cost abstractions
- move semantics
- guaranteed memory safety
- threads without data races
- trait-based generics
- pattern matching
- type inference
- minimal runtime
- efficient C bindings
I detailed my experience with Rust and the problems I faced during this rewriting on my personal blog:
Learning Rust was a rewarding experience to me, and I’m glad that Gnirehtet is now a native application.
If you encounter any problem with it, please submit an issue.
Happy reverse tethering!