Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alphabs/termux-gnirehtet
USB Tethering from Android to Android, non-root
https://github.com/alphabs/termux-gnirehtet
adb android gnirehtet non-root reverse-tethering termux tethering usb usb-tethering vpn
Last synced: 27 days ago
JSON representation
USB Tethering from Android to Android, non-root
- Host: GitHub
- URL: https://github.com/alphabs/termux-gnirehtet
- Owner: AlphaBs
- License: mit
- Created: 2023-03-20T10:48:39.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-07T09:57:43.000Z (4 months ago)
- Last Synced: 2024-09-08T09:23:42.516Z (4 months ago)
- Topics: adb, android, gnirehtet, non-root, reverse-tethering, termux, tethering, usb, usb-tethering, vpn
- Language: Shell
- Homepage:
- Size: 381 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tethering from Android to Android via USB cable
- Tethering device: The device sharing its internet connection.
- Tethered deivce: The device want to connect to the Internet via 'tethering device'.## Install for tethering device
- [Termux](https://github.com/termux/termux-app/releases/latest): Install from Github.
- [Termux-API](https://wiki.termux.com/wiki/Termux:API): Install from [Github](https://github.com/termux/termux-api/actions)1. Clone the repository `git clone https://github.com/AlphaBs/termux-gnirehtet`
2. Run `pkg update && ./install.sh`.## Usage
1. Make sure USB debugging is enabled on the tethered device.
2. Connect two Android devices with USB cable.
3. Set USB control mode:
- Tethering device: USB controlled by connected device
- Tethered device: USB controlled by this device
4. Allow file system access and USB debugging authorization.5. Run `adb devices` on the tethering device to check the tethered device is connected. (it may take 1-2 minutes)
6. Run `./gnirehtet run` on the tethering device.
## How it works
`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`.
## Build
### gnirehtet relay server
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:
1. Install [cargo](https://rustup.rs/) to build Rust.
2. Run `build-gnirehtet.sh` script.The compiled binary (named `gnirehtet`) will be located in the same directory where the script is executed.
### gnirehtet android app
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](https://github.com/Genymobile/gnirehtet/releases).
To build the Android app: [gnirehtet/DEVELOP.md](https://github.com/Genymobile/gnirehtet/blob/master/DEVELOP.md)
## Related projects
- [termux-adb](https://github.com/nohajc/termux-adb)
- [gnirehtet](https://github.com/Genymobile/gnirehtet)