Genymobile / gnirehtet

Gnirehtet provides reverse tethering for Android
Apache License 2.0
6.31k stars 578 forks source link

Does this work on Windows ? #94

Open AndroidDeveloperLB opened 6 years ago

AndroidDeveloperLB commented 6 years ago

I have Windows 10, and Android P on Pixel 2.

I've installed the APK file, and I've launched the gnirehtet-run.cmd file.

All I get is this:

2018-03-18 13:00:08.957 INFO Main: Checking gnirehtet client...
2018-03-18 13:00:08.957 INFO Main: Starting relay server...
2018-03-18 13:00:08.960 ERROR Main: Cannot start client: Command adb ["shell", "dumpsys", "package", "com.genymobile.gnirehtet"] failed: The system cannot find the file specified. (os error 2)
2018-03-18 13:00:08.960 INFO Relay: Relay server started

I don't see any key-icon on the status bar, and I don't see any dialog as shown on the main page of the repository.

AndroidDeveloperLB commented 6 years ago

It seems 'adb' can't be found, even though I've installed all Android-related stuff for developing (I'm an Android developer). How come?

rom1v commented 6 years ago

adb must be accessible from your PATH, so add C:\path\to\your\android\sdk\platform-tools to your Windows PATH.

EDIT: random video explaining how to do: https://www.youtube.com/watch?v=EmimicZd6tI

AndroidDeveloperLB commented 6 years ago

I was sure it already does this. Was a very long time since I've added a path on Windows. is it this way:

image

?

Seems to work, but only the Windows version. and only for a few moments. If I run an app called "speed test", it will eventually put this text on the command line, and effectively disconnect (the key icon disappears) :

thread 'main' panicked at 'Not an Ipv4 packet, version=0', src/relay/ipv4_packet_buffer.rs:38:13
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Press any key to continue . . .

The Java version shows me this when running gnirehtet-run.cmd, and not work at all :

2018-03-18 13:15:51.614 I Gnirehtet: Checking gnirehtet client...
2018-03-18 13:15:51.614 I Gnirehtet: Starting relay server...
2018-03-18 13:15:51.719 I Relay: Relay server started

How come?

AndroidDeveloperLB commented 6 years ago

BTW, why not publish this as an app on the Play Store?

rom1v commented 6 years ago
thread 'main' panicked at 'Not an Ipv4 packet, version=0', src/relay/ipv4_packet_buffer.rs:38:13

See https://github.com/Genymobile/gnirehtet/issues/69. Several users reported it, but I never reproduced it myself, so it's hard to debug. Does it work with another device?

why not publish this as an app on the Play Store?

This has no technical benefit, since the app is still necessary on the computer (so the computer may install the app itself).

AndroidDeveloperLB commented 6 years ago

Try what I wrote then. Have you also tried the Java version? Maybe it's from Android 8.0, because it seems ipv6 is on the minimal requirements:

https://source.android.com/compatibility/8.0/android-8.0-cdd#7_4_data_connectivity

I've tried on OnePlus 2, with Android 6.0.1, and it worked fine there. Even the Java version.

About the Play Store app, this can be more convenient, and it might help with keeping up with new versions. Also can make this more popular, because there are similar apps (I think they require rooted device though).

jostry commented 6 years ago

I had the same issue "ERROR Main: Cannot start client: Command adb...", Win 10 (the same behaviour for Win7) The following solution works for me (huawei p9 lite):

  1. On your PC, copy all needed files into one folder, then no path settings for adb are needed.
  2. Connect the cable.
  3. Enable data transfer mode on the phone, charge only doesn't work.
  4. Run the gnirehtet-run.cmd.
  5. If you see the error, check your phone. It should ask for Allowing USB debugging. Click OK.
  6. Close the gnirehtet-run.cmd window and run the gnirehtet-run.cmd again. It should work now.
NA0341 commented 3 weeks ago

@AndroidDeveloperLB wrote:

BTW, why not publish this as an app on the Play Store?

This wouldn't help. Gnirehtet is a CLI - Application and pushing it to inexperienced users without UI would mostly cause problems rather than provide value. Additionally, the PlayStore is getting ever more repetitive. Publishing applications becomes more and more tedious with Google enforcing more and more policies…

Some UX improvements in form of i.e. a auto-setup script and good articles that can easily be found are pretty sufficient. And the latter is already plenty: https://duckduckgo.com/?t=palemoon&q=android+reverse+tethering&ia=web (or search for gnirehtet directly).

Maybe it's from Android 8.0, because it seems ipv6 is on the minimal requirements

I'm on a Samsung Galaxy S8 (SM-G950F) with Android 9 (EU-ROM) which is highly debloated (including Google Services Framework). Desktop OS is currently Manjaro (Arch Linux) with GNOME Desktop.

Setting up gnirehtet worked like a charm. Only thing that doesn't work is the install function from gnirehtet. I used the ADB - Command. I start gnirehtet at login with the autorun argument and all devices connect instantly.

You could also try these options until gnirehtet is working correctly: https://www.howtogeek.com/117118/how-to-connect-your-android-to-your-pcs-internet-connection-over-usb/

AndroidDeveloperLB commented 3 weeks ago

@NA0341 Too bad. Having something on the Play Store makes it more official and alive... Instead here I can see the repository says "This project is not actively maintained anymore, only major blockers ". I'm sure that if it was more popular, things would be different.

NA0341 commented 2 weeks ago

The IzzyOnDroid and F-Droid Repo would be one easy step to make Gnirehtet more known. Some Tech - oriented YouTube Channels could promote Gnirehtet.

But yeah I get why many think PlayStore would be great. But that again would require a product that's tailored towards "inexpierenced users" ~ and that means it must have at least a GUI.