# Gnirehtet (v2.5)
This project provides **reverse tethering** over `adb` for Android: it
allows devices to use the internet connection of the computer they are plugged
on. It does not require any _root_ access (neither on the device nor on the
computer). It works on _GNU/Linux_, _Windows_ and _Mac OS_.
Currently, it relays [TCP] and [UDP] over [IPv4] traffic, but it does not
support [IPv6] (yet?).
[TCP]: https://en.wikipedia.org/wiki/Transmission_Control_Protocol
[UDP]: https://fr.wikipedia.org/wiki/User_Datagram_Protocol
[IPv4]: https://en.wikipedia.org/wiki/IPv4
[IPv6]: https://en.wikipedia.org/wiki/IPv6
## Flavors
Two implementations of _Gnirehtet_ are available:
- one in **Java**;
- one in **Rust**.
### Which one to choose?
Use the **Rust** implementation. The native binary consumes less CPU and memory,
and does not require a _Java_ runtime environment.
The relay server of _Gnirehtet_ was initially only implemented in Java. As a
benefit, the same "binary" runs on every platform having _Java 8_ runtime
installed. It is still maintained to provide a working alternative in case of
problems with the Rust version.
## Requirements
The Android application requires at least API 21 (Android 5.0).
For the _Java_ version only, _Java 8_ (JRE) is required on your computer. On
Debian-based distros, install the package `openjdk-8-jre`.
### adb
You need a recent version of [adb] (where `adb reverse` is implemented, it
works with 1.0.36).
It is available in the [Android SDK platform tools][platform-tools].
On Debian-based distros, you can alternatively install the package
`android-tools-adb`.
On Windows, if you need `adb` only for this application, just download the
[platform-tools][platform-tools-windows] and extract the following files to the
_gnirehtet_ directory:
- `adb.exe`
- `AdbWinApi.dll`
- `AdbWinUsbApi.dll`
Make sure you [enabled adb debugging][enable-adb] on your device(s).
[adb]: https://developer.android.com/studio/command-line/adb.html
[enable-adb]: https://developer.android.com/studio/command-line/adb.html#Enabling
[platform-tools]: https://developer.android.com/studio/releases/platform-tools.html
[platform-tools-windows]: https://dl.google.com/android/repository/platform-tools-latest-windows.zip
## Get the app
### Homebrew
If you use [Homebrew](https://brew.sh/), getting up and running is very quick.
To install the Rust version:
```
brew install gnirehtet
```
### Download
Download the [latest release][latest] in the flavor you want.
[latest]: https://github.com/Genymobile/gnirehtet/releases/latest
#### Rust
- **Linux:** [`gnirehtet-rust-linux64-v2.5.zip`][direct-rust-linux64]
(SHA-256: _2b1ce04540e8de5df5ddbebb64bb01e27c13d556b3a04a8563dcce3786765705_)
- **Windows:** [`gnirehtet-rust-win64-v2.5.zip`][direct-rust-win64]
(SHA-256: _9f6d7700368f45d2fa43923324660eca9f879e837e10fc45d8d975273eae4755_)
- **MacOS:** [`gnirehtet-rust-macos64-v2.2.1.zip`][direct-rust-macos64]
_(old release)_
(SHA-256: _902103e6497f995e1e9b92421be212559950cca4a8b557e1f0403769aee06fc8_)
[direct-rust-linux64]: https://github.com/Genymobile/gnirehtet/releases/download/v2.5/gnirehtet-rust-linux64-v2.5.zip
[direct-rust-win64]: https://github.com/Genymobile/gnirehtet/releases/download/v2.5/gnirehtet-rust-win64-v2.5.zip
[direct-rust-macos64]: https://github.com/Genymobile/gnirehtet/releases/download/v2.2.1/gnirehtet-rust-macos64-v2.2.1.zip
Then extract it.
The Linux and MacOS archives contain:
- `gnirehtet.apk`
- `gnirehtet`
The Windows archive contains:
- `gnirehtet.apk`
- `gnirehtet.exe`
- `gnirehtet-run.cmd`
#### Java
- **All platforms:** [`gnirehtet-java-v2.5.zip`][direct-java]
(SHA-256: _c65fc1a35e6b169ab6aa45e695c043e933f6fd650363aea7c2add0ecb0db27ca_)
[direct-java]: https://github.com/Genymobile/gnirehtet/releases/download/v2.5/gnirehtet-java-v2.5.zip
Then extract it. The archive contains:
- `gnirehtet.apk`
- `gnirehtet.jar`
- `gnirehtet`
- `gnirehtet.cmd`
- `gnirehtet-run.cmd`
## Run (simple)
_Note: On Windows, replace `./gnirehtet` by `gnirehtet` in the following
commands._
The application has no UI, and is intended to be controlled from the computer
only.
If you want to activate reverse tethering for exactly one device, just execute:
./gnirehtet run
Reverse tethering remains active until you press _Ctrl+C_.
On Windows, for convenience, you can double-click on `gnirehtet-run.cmd`
instead (it just executes `gnirehtet run`, without requiring to open a
terminal).
The very first start should open a popup to request permission:
![request](assets/request.jpg)
A "key" logo appears in the status bar whenever _Gnirehtet_ is active:
![key](assets/key.png)
Alternatively, you can enable reverse tethering for all connected devices
(present and future) by calling:
./gnirehtet autorun
## Run
You can execute the actions separately (it may be useful if you want to reverse
tether several devices simultaneously).
Start the relay server and keep it open:
./gnirehtet relay
Install the `apk` on your Android device:
./gnirehtet install [serial]
In another terminal, for each client, execute:
./gnirehtet start [serial]
To stop a client:
./gnirehtet stop [serial]
To reset the tunnel (useful to get the connection back when a device is
unplugged and plugged back while gnirehtet is active):
./gnirehtet tunnel [serial]
The _serial_ parameter is required only if `adb devices` outputs more than one
device.
For advanced options, call `./gnirehtet` without arguments to get more details.
## Run manually
The `gnirehtet` program exposes a simple command-line interface that executes
lower-level commands. You can call them manually instead.
To start the relay server:
./gnirehtet relay
To install the apk:
adb install -r gnirehtet.apk
To start a client:
adb reverse localabstract:gnirehtet tcp:31416
adb shell am start -a com.genymobile.gnirehtet.START \
-n com.genymobile.gnirehtet/.GnirehtetActivity
To stop a client:
adb shell am start -a com.genymobile.gnirehtet.STOP \
-n com.genymobile.gnirehtet/.GnirehtetActivity
## Environment variables
`ADB` defines a custom path to the `adb` executable:
```bash
ADB=/path/to/my/adb ./gnirehtet run
```
`GNIREHTET_APK` defines a custom path to `gnirehtet.apk`:
```bash
GNIREHTET_APK=/usr/share/gnirehtet/gnirehtet.apk ./gnirehtet run
```
## Why _gnirehtet_?
rev <<< tethering
(in _Bash_)
## Developers
Read the [developers page].
[developers page]: DEVELOP.md
## Licence
Copyright (C) 2017 Genymobile
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
## Articles
- [Introducing “gnirehtet”, a reverse tethering tool for Android][medium-1] ([French version][blog-1])
- [Gnirehtet 2: our reverse tethering tool for Android now available in Rust][medium-2]
- [Gnirehtet rewritten in Rust][blog-2-en] ([French version][blog-2-fr])
[medium-1]: https://medium.com/@rom1v/gnirehtet-reverse-tethering-android-2afacdbdaec7
[blog-1]: https://blog.rom1v.com/2017/03/gnirehtet/
[medium-2]: https://medium.com/genymobile/gnirehtet-2-our-reverse-tethering-tool-for-android-now-available-in-rust-999960483d5a
[blog-2-en]: https://blog.rom1v.com/2017/09/gnirehtet-rewritten-in-rust/
[blog-2-fr]: https://blog.rom1v.com/2017/09/gnirehtet-reecrit-en-rust/
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
Gnirehtet(v2.5) 该项目通过Android上的adb提供反向绑定:它允许设备使用其所连接计算机的Internet连接。 它不需要任何root访问(无论在设备上还是在计算机上)。 它可以在GNU / Linux , Windows和Mac OS上运行。 当前,它通过流量中继和 ,但不支持 (还可以吗?)。 香精 Gnirehtet的两种实现可用: Java中的一种; 一在Rust中。 选择哪一个? 使用Rust实现。 本机二进制文件消耗的CPU和内存更少,并且不需要Java运行时环境。 Gnirehtet的中继服务器最初仅用Java实现。 有益的是,相同的“二进制文件”在安装了Java 8运行时的每个平台上运行。 如果Rust版本出现问题,它仍然可以提供替代方法。 要求 Android应用程序至少需要API 21(Android 5.0)。 仅对于Java版本,您的计算机上需要Java 8 (JRE)。 在基于Debian的发行版上,安装软件包openjdk-8-jre 。 亚行 您需要最新版本的 (在其中实现了adb reverse ,它与1.0.36兼容)
资源详情
资源评论
资源推荐
收起资源包目录
gnirehtet:Gnirehtet为Android提供反向绑定 (123个子文件)
gradlew.bat 2KB
gnirehtet-run.cmd 38B
gnirehtet.cmd 29B
gnirehtet-run.cmd 28B
.gitignore 47B
.gitignore 19B
gnirehtet 41B
build.gradle 1KB
build.gradle 1KB
build.gradle 949B
android-checkstyle.gradle 642B
build.gradle 569B
android-signing.gradle 423B
java-checkstyle.gradle 138B
settings.gradle 45B
gradlew 5KB
gradle-wrapper.jar 52KB
Main.java 18KB
TCPConnection.java 16KB
TCPHeaderTest.java 9KB
AdbMonitor.java 8KB
GnirehtetService.java 8KB
Client.java 7KB
TCPHeader.java 7KB
Forwarder.java 6KB
IPv4Header.java 5KB
IPv4HeaderTest.java 5KB
UDPConnection.java 5KB
IPv4PacketBufferTest.java 5KB
RelayTunnelProvider.java 5KB
IPPacketOutputStream.java 4KB
PacketizerTest.java 4KB
StreamBufferTest.java 4KB
AdbMonitorTest.java 4KB
DatagramBufferTest.java 4KB
RelayTunnel.java 4KB
DatagramBuffer.java 4KB
Router.java 4KB
TestIPPacketOutputSteam.java 4KB
Log.java 4KB
Notifier.java 4KB
CommandLineArguments.java 4KB
IPv4PacketTest.java 3KB
GnirehtetActivity.java 3KB
StreamBuffer.java 3KB
IPv4Packet.java 3KB
UDPHeaderTest.java 3KB
ConnectionId.java 3KB
CommandLineArgumentsTest.java 3KB
AbstractConnection.java 3KB
Packetizer.java 3KB
CIDR.java 3KB
PersistentRelayTunnel.java 3KB
VpnConfiguration.java 2KB
UDPHeader.java 2KB
Binary.java 2KB
Net.java 2KB
Net.java 2KB
Relay.java 2KB
IPv4PacketBuffer.java 2KB
TunnelServer.java 2KB
Binary.java 2KB
CommandExecutionException.java 1KB
TransportHeader.java 1KB
InetAddressTest.java 1KB
PacketSource.java 1KB
InvalidCIDRException.java 1KB
Tunnel.java 869B
Connection.java 790B
SelectionHandler.java 764B
CloseListener.java 707B
RelayTunnelListener.java 652B
request.jpg 24KB
LICENSE 11KB
Cargo.lock 15KB
DEVELOP.md 18KB
README.md 8KB
archi.png 27KB
key.png 3KB
proguard-rules.pro 652B
gradle.properties 730B
gradle-wrapper.properties 233B
release 1KB
tcp_connection.rs 29KB
tcp_header.rs 23KB
main.rs 20KB
adb_monitor.rs 12KB
client.rs 12KB
ipv4_packet.rs 11KB
udp_connection.rs 9KB
ipv4_header.rs 9KB
packetizer.rs 8KB
transport_header.rs 8KB
ipv4_packet_buffer.rs 7KB
router.rs 7KB
datagram_buffer.rs 6KB
udp_header.rs 6KB
stream_buffer.rs 6KB
cli_args.rs 6KB
datagram.rs 5KB
共 123 条
- 1
- 2
MachineryLy
- 粉丝: 29
- 资源: 4611
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0