- Tethering device: The device sharing its internet connection.
- Tethered deivce: The device want to connect to the Internet via 'tethering device'.
- Termux: Install from Github.
- Termux-API: Install from Github
- Clone the repository
git clone https://github.com/AlphaBs/termux-gnirehtet
- Run
pkg update && ./install.sh
.
- Make sure USB debugging is enabled on the tethered device.
- Connect two Android devices with USB cable.
- Set USB control mode:
- Tethering device: USB controlled by connected device
- Tethered device: USB controlled by this device
- Allow file system access and USB debugging authorization.
- Run
adb devices
on the tethering device to check the tethered device is connected. (it may take 1-2 minutes)
- Run
./gnirehtet run
on the tethering device.
gnirehtet
was originally for reverse-tethering, sharing PC's internet connection to Android device, using adb
. I recompiled gnirehtet
to make it executable on aarch64 Termux.
To run adb
and connect to another device on Android, I used termux-adb
.
The binary of relay server (gnirehtet
) in this repository was built for Termux, aarch64
. However, you may want to build relay server yourself to run on difference environment.
To build relay server:
- Install cargo to build Rust.
- Run
build-gnirehtet.sh
script.
The compiled binary (named gnirehtet
) will be located in the same directory where the script is executed.
gnirehtet app would work on most devices so you don't need to build it yourself. The apk file in this repository is from official gnirehtet release.
To build the Android app: gnirehtet/DEVELOP.md