Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gnirehtet disconnected from relay server #42

Closed
ammarhaider5 opened this issue Sep 21, 2017 · 25 comments
Closed

Gnirehtet disconnected from relay server #42

ammarhaider5 opened this issue Sep 21, 2017 · 25 comments
Assignees
Labels

Comments

@ammarhaider5
Copy link

Whenever I connect my phone to pc and type the command gnirehtet rt it starts the server and installs the file on my phone I get the vpn sign as well on my phone but I instantly get the notification from Gnirehtet on my phone that "Disconnected from relay server"

I've tried using multiple cables so its not the cable or the usb port

@rom1v
Copy link
Collaborator

rom1v commented Sep 21, 2017

What version of Gnirehtet do you use? On which platform?

Could you see relevant problems in the logs (in the relay server window and through adb logcat)?

@ammarhaider5
Copy link
Author

ammarhaider5 commented Sep 21, 2017

Version 1.1.1 on windows 7 ultimate 64 bit
I attached logcat below

ATA
09-21 17:19:06.839   718  5233 D QSEECOMAPI: : Loaded image: APP id = 31
09-21 17:19:06.852   718  5233 D DrmWidevineDash: Service_Initialize: ends! retu
rns 0
09-21 17:19:06.852   718  5233 D DrmWidevineDash: Service_Initialize: function t
ime: 56ms (0s 56097136ns)
09-21 17:19:06.853   718  5233 D QSAPPSVER: qsapps_get_capabilities: Capability
from secure side: 0x0
09-21 17:19:06.853   718  5233 D QSAPPSVER: qsapps_get_capabilities: returns 0
09-21 17:19:06.853   718  5233 D DrmWidevineDash: OEMCrypto_Initialize sion_buff
er g_wv_fhandle->ion_sbuffer  0x0xf1a6a000
09-21 17:19:06.853   718  5233 E DrmWidevineDash: sion_buffer g_wv_fhandle->ion_
sbuffer  0x0xf1a6a000
09-21 17:19:06.856   682   696 D DrmLibTime: got the req here! ret=0
09-21 17:19:06.857   682   696 D DrmLibTime: command id, time_cmd_id = 770
09-21 17:19:06.857   682   696 D DrmLibTime: time_getutcsec starts!
09-21 17:19:06.857   682   696 D DrmLibTime: QSEE Time Listener: time_getutcsec
09-21 17:19:06.857   682   696 D DrmLibTime: QSEE Time Listener: get_utc_seconds

09-21 17:19:06.857   682   696 D DrmLibTime: QSEE Time Listener: time_get_modem_
time
09-21 17:19:06.857   682   696 D DrmLibTime: QSEE Time Listener: Checking if ATS
_MODEM is set or not.
09-21 17:19:06.858   682   696 D DrmLibTime: QSEE Time Listener: ATS_MODEM is se
t. Try to retrieve it.
09-21 17:19:06.859   682   696 D DrmLibTime: QSEE Time Listener: Time GenOff - s
econds: 1505996348
09-21 17:19:06.859   682   696 D DrmLibTime: time_getutcsec returns 0, sec = 150
5996348; nsec = 0
09-21 17:19:06.859   682   696 D DrmLibTime: time_getutcsec finished!
09-21 17:19:06.859   682   696 D DrmLibTime: iotcl_continue_command finished! an
d return 0
09-21 17:19:06.859   682   696 D DrmLibTime: before calling ioctl to read the ne
xt time_cmd
09-21 17:19:06.871   718  5233 D DrmWidevineDash: OEMCrypto_ION_Malloc: function
 time: 11ms (0s 11160312ns)
09-21 17:19:06.871   718  5233 D DrmWidevineDash: OEMCrypto_Initialize: ends! re
turns 0
09-21 17:19:06.871   718  5233 D DrmWidevineDash: _oecc01: function time: 75ms (
0s 75474740ns)
09-21 17:19:06.872   718  5233 D DrmWidevineDash: OEMCrypto_APIVersion: starts!
09-21 17:19:06.872   718  5233 D DrmWidevineDash: hlos api version =  10
09-21 17:19:06.872   718  5233 D DrmWidevineDash: tz api version =  10
09-21 17:19:06.872   718  5233 D DrmWidevineDash: OEMCrypto_APIVersion: ends! re
turns version 10
09-21 17:19:06.872   718  5233 D DrmWidevineDash: _oecc22: function time: 0ms (0
s 571459ns)
09-21 17:19:06.872   718  5233 D DrmWidevineDash: OEMCrypto_IsKeyboxValid: start
s!
09-21 17:19:06.894   718  5233 D DrmWidevineDash: OEMCrypto_IsKeyboxValid: ends!
 returns 0
09-21 17:19:06.894   718  5233 D DrmWidevineDash: _oecc05: function time: 21ms (
0s 21714739ns)
09-21 17:19:06.894   718  5233 D WVCdm   : OEMCrypto_Initialize Level 1 success.
 I will use level 1.
09-21 17:19:06.894   718  5233 D DrmWidevineDash: OEMCrypto_OpenSession: starts!
 SID=0xf1de4104
09-21 17:19:06.894   718  5233 D DrmWidevineDash: OEMCrypto_OpenSession Session
ID = 0
09-21 17:19:06.894   718  5233 D DrmWidevineDash: OEMCrypto_OpenSession SID = 1
09-21 17:19:06.894   718  5233 D DrmWidevineDash: OEMCrypto_OpenSession: ends! r
eturns 0
09-21 17:19:06.894   718  5233 D DrmWidevineDash: _oecc09: function time: 0ms (0
s 402239ns)
09-21 17:19:06.894   718  5233 D DrmWidevineDash: OEMCrypto_GetRandom: starts! r
andomData=0xab0fb968, dataLength=8
09-21 17:19:06.895   718  5233 D DrmWidevineDash: OEMCrypto_GetRandom: ends! ret
urns 0
09-21 17:19:06.895   718  5233 D DrmWidevineDash: _oecc06: function time: 0ms (0
s 869167ns)
09-21 17:19:06.896   718  5233 D DrmWidevineDash: OEMCrypto_LoadDeviceRSAKey: st
arts! SID=1, wrapped_rsa_key=0xab0e2ac8, wrapped_rsa_key_length=1280
09-21 17:19:06.900   718  5233 D DrmWidevineDash: OEMCrypto_LoadDeviceRSAKey: en
ds! returns 0
09-21 17:19:06.900   718  5233 D DrmWidevineDash: _oecc19: function time: 4ms (0
s 4143333ns)
09-21 17:19:06.900   718  5233 I WVCdm   : CdmEngine::QueryKeyControlInfo
09-21 17:19:06.902   718   718 W WVCdm   : BufferReader::Read<T> : Failure durin
g parse: Not enough bytes (4)
09-21 17:19:06.902   718   718 W WVCdm   : CdmEngine::ExtractWidevinePssh: Unabl
e to read atom size.
09-21 17:19:06.902   718   718 I WVCdm   : CdmEngine::GenerateKeyRequest
09-21 17:19:06.902   718   718 D DrmWidevineDash: OEMCrypto_GetDeviceID: starts!
 deviceID=0xab0ef018, idLength=0xffb123ac
09-21 17:19:06.924   718   718 D DrmWidevineDash: OEMCrypto_GetDeviceID: ends! r
eturns 0
09-21 17:19:06.924   718   718 D DrmWidevineDash: _oecc07: function time: 22ms (
0s 22331354ns)
09-21 17:19:06.924   718   718 D DrmWidevineDash: OEMCrypto_SupportsUsageTable:
starts!
09-21 17:19:06.925   718   718 D DrmWidevineDash: OEMCrypto_SupportsUsageTable:
is_supported = 1
09-21 17:19:06.925   718   718 D DrmWidevineDash: OEMCrypto_SupportsUsageTable:
wv_app_version =0x22
09-21 17:19:06.925   718   718 D DrmWidevineDash: OEMCrypto_SupportsUsageTable:
ends! returns 0
09-21 17:19:06.925   718   718 D DrmWidevineDash: _oecc29: function time: 0ms (0
s 510885ns)
09-21 17:19:06.925   718   718 D DrmWidevineDash: OEMCrypto_IsAntiRollbackHwPres
ent: starts!
09-21 17:19:06.925   718   718 D DrmWidevineDash: OEMCrypto_IsAntiRollbackHwPres
ent ends! ret=0, is_antirb_enabled = 1
09-21 17:19:06.925   718   718 D DrmWidevineDash: _oecc39: function time: 0ms (0
s 459010ns)
09-21 17:19:06.925   718   718 D DrmWidevineDash: OEMCrypto_APIVersion: starts!
09-21 17:19:06.926   718   718 D DrmWidevineDash: hlos api version =  10
09-21 17:19:06.926   718   718 D DrmWidevineDash: tz api version =  10
09-21 17:19:06.926   718   718 D DrmWidevineDash: OEMCrypto_APIVersion: ends! re
turns version 10
09-21 17:19:06.926   718   718 D DrmWidevineDash: _oecc22: function time: 0ms (0
s 460104ns)
09-21 17:19:06.926   718   718 D DrmWidevineDash: OEMCrypto_GetHDCPCapability st
arts!
09-21 17:19:06.926   718   718 D DrmWidevineDash: OEMCrypto_GetHDCPCapability cu
rrent=255, max=4
09-21 17:19:06.926   718   718 D DrmWidevineDash: OEMCrypto_GetHDCPCapability en
ds! ret = 0
09-21 17:19:06.926   718   718 D DrmWidevineDash: _oecc44: function time: 0ms (0
s 459219ns)
09-21 17:19:06.926   718   718 D DrmWidevineDash: OEMCrypto_GenerateNonce: start
s! SID=1, nonce=0xffb124e0
09-21 17:19:06.927   718   718 D DrmWidevineDash: OEMCrypto_GenerateNonce: ends!
 returns 0
09-21 17:19:06.927   718   718 D DrmWidevineDash: _oecc14: function time: 0ms (0
s 524114ns)
09-21 17:19:06.927   718   718 D WVCdm   : PrepareKeyRequest: nonce=4233757196
09-21 17:19:06.927   718   718 D DrmWidevineDash: OEMCrypto_GenerateRSASignature
 starts! SID=1, message=0xab0e2ac8
09-21 17:19:06.927   718   718 D DrmWidevineDash: message_length=1689, signature
=0xab0ef230, signature_length=0xffb12484
09-21 17:19:06.990   710 30221 D libc    : [NET]Querying server xid =53af (# 1)
address = 8.8.8.8 (try=1,nscount=1,v_circuit=0)
09-21 17:19:06.990   710 30221 D libc    : before statp->options=0x800002C3)
09-21 17:19:07.047   718   718 D DrmWidevineDash: OEMCrypto_GenerateRSASignature
 returns 0
09-21 17:19:07.047   718   718 D DrmWidevineDash: _oecc36: function time: 119ms
(0s 119913125ns)
09-21 17:19:07.048   718  5232 I WVCdm   : CdmEngine::CloseSession
09-21 17:19:07.048   718  5232 D DrmWidevineDash: OEMCrypto_CloseSession: starts
! SID=1
09-21 17:19:07.049   718  5232 D DrmWidevineDash: OEMCrypto_CloseSession: ends!
returns 0
09-21 17:19:07.049   718  5232 D DrmWidevineDash: _oecc10: function time: 0ms (0
s 879583ns)
09-21 17:19:07.049   718  5232 D DrmWidevineDash: OEMCrypto_Terminate: starts!
09-21 17:19:07.050   718  5232 D DrmWidevineDash: Service_Uninitialize: starts!
09-21 17:19:07.050   718  5232 D QSEECOMAPI: : QSEECom_dealloc_memory
09-21 17:19:07.050   718  5232 D QSEECOMAPI: : QSEECom_shutdown_app, app_id = 31

09-21 17:19:07.051   718  5232 D DrmWidevineDash: Service_Uninitialize: ends! re
turns 0x0
09-21 17:19:07.051   718  5232 D DrmWidevineDash: Service_Uninitialize: function
 time: 0ms (0s 736563ns)
09-21 17:19:07.051   718  5232 D DrmWidevineDash: OEMCrypto_ION_Free: function t
ime: 0ms (0s 259323ns)
09-21 17:19:07.051   718  5232 D DrmWidevineDash: OEMCrypto_Terminate: ends! ret
urns 0
09-21 17:19:07.051   718  5232 D DrmWidevineDash: _oecc02: function time: 1ms (0
s 1666511ns)
09-21 17:19:07.074  6204 25634 D libc    : [NET] android_getaddrinfofornetcontex
t+,hn 26(0x616e64726f6964),sn(),hints(known),family 0,flags 1024, proc=com.googl
e.android.gms.persistent
09-21 17:19:07.074  6204 25634 D libc    : [NET] android_getaddrinfo_proxy get n
etid:0
09-21 17:19:07.075   710 30232 D libc    : [NET] android_getaddrinfofornetcontex
t+,hn 26(0x616e64726f6964),sn(),hints(known),family 0,flags 0, proc=/system/bin/
netd
09-21 17:19:07.075   710 30232 D libc    : [NET] android_getaddrinfo_proxy-, fd
error: Success(0)
09-21 17:19:07.075   710 30232 D libc    : [NET] _dns_getaddrinfo+, netid:106, m
ark:917610
09-21 17:19:07.553   710 30225 D libc    : after statp->options=0x800002C1)
09-21 17:19:07.882 29187 29213 D RelayTunnel: Opening a new relay tunnel...
09-21 17:19:07.884 29187 29213 D libc    : [NET] android_getaddrinfofornetcontex
t+,hn 9(0x6c6f63616c686f),sn(),hints(known),family 0,flags 1024, proc=com.genymo
bile.gnirehtet
09-21 17:19:07.885 29187 29213 D libc    : [NET] android_getaddrinfo_proxy get n
etid:0
09-21 17:19:07.887   710 30233 D libc    : [NET] android_getaddrinfofornetcontex
t+,hn 9(0x6c6f63616c686f),sn(),hints(known),family 0,flags 0, proc=/system/bin/n
etd
09-21 17:19:07.887   710 30233 D libc    : [NET] android_getaddrinfo_proxy-, fd
error: Success(0)
09-21 17:19:07.889 29187 29213 D libc    : [NET] android_getaddrinfo_proxy-, suc
cess
09-21 17:19:07.894 29187 29213 D RelayTunnel: Requesting client id
09-21 17:19:08.436  5023  5129 W SensorService: D/Accel(x, y, z, t) = ( -0.3,  -
0.0,   9.8, 4317137ms), calendar = 1505996348, sys_time = 4317146ms
09-21 17:19:09.047 29187 29213 E PersistentRelayTunnel: Cannot send to tunnel
09-21 17:19:09.047 29187 29213 E PersistentRelayTunnel: java.io.IOException: Can
not read from channel
09-21 17:19:09.047 29187 29213 E PersistentRelayTunnel:         at com.genymobil
e.gnirehtet.RelayTunnel.readInt(RelayTunnel.java:81)
09-21 17:19:09.047 29187 29213 E PersistentRelayTunnel:         at com.genymobil
e.gnirehtet.RelayTunnel.readClientId(RelayTunnel.java:72)
09-21 17:19:09.047 29187 29213 E PersistentRelayTunnel:         at com.genymobil
e.gnirehtet.RelayTunnel.connect(RelayTunnel.java:50)
09-21 17:19:09.047 29187 29213 E PersistentRelayTunnel:         at com.genymobil
e.gnirehtet.RelayTunnelProvider.connectTunnel(RelayTunnelProvider.java:77)
09-21 17:19:09.047 29187 29213 E PersistentRelayTunnel:         at com.genymobil
e.gnirehtet.RelayTunnelProvider.getCurrentTunnel(RelayTunnelProvider.java:70)
09-21 17:19:09.047 29187 29213 E PersistentRelayTunnel:         at com.genymobil
e.gnirehtet.PersistentRelayTunnel.send(PersistentRelayTunnel.java:45)
09-21 17:19:09.047 29187 29213 E PersistentRelayTunnel:         at com.genymobil
e.gnirehtet.Forwarder.forwardDeviceToTunnel(Forwarder.java:103)
09-21 17:19:09.047 29187 29213 E PersistentRelayTunnel:         at com.genymobil
e.gnirehtet.Forwarder.access$100(Forwarder.java:34)
09-21 17:19:09.047 29187 29213 E PersistentRelayTunnel:         at com.genymobil
e.gnirehtet.Forwarder$1.run(Forwarder.java:61)
09-21 17:19:09.047 29187 29213 E PersistentRelayTunnel:         at java.util.con
current.Executors$RunnableAdapter.call(Executors.java)
09-21 17:19:09.047 29187 29213 E PersistentRelayTunnel:         at java.util.con
current.FutureTask.run(FutureTask.java)
09-21 17:19:09.047 29187 29213 E PersistentRelayTunnel:         at java.util.con
current.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java)
09-21 17:19:09.047 29187 29213 E PersistentRelayTunnel:         at java.util.con
current.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java)
09-21 17:19:09.047 29187 29213 E PersistentRelayTunnel:         at java.lang.Thr
ead.run(Thread.java)
09-21 17:19:09.055 29187 29214 D PersistentRelayTunnel: Tunnel read EOF
09-21 17:19:09.056 29187 29187 D GnirehtetService: Relay tunnel disconnected
09-21 17:19:09.078 29187 29213 E PersistentRelayTunnel: Cannot send to tunnel
09-21 17:19:09.078 29187 29213 E PersistentRelayTunnel: java.net.SocketException
: sendto failed: EBADF (Bad file descriptor)
09-21 17:19:09.078 29187 29213 E PersistentRelayTunnel:         at libcore.io.Io
Bridge.maybeThrowAfterSendto(IoBridge.java)
09-21 17:19:09.078 29187 29213 E PersistentRelayTunnel:         at libcore.io.Io
Bridge.sendto(IoBridge.java)
09-21 17:19:09.078 29187 29213 E PersistentRelayTunnel:         at java.nio.Sock
etChannelImpl.writeImpl(SocketChannelImpl.java)
09-21 17:19:09.078 29187 29213 E PersistentRelayTunnel:         at java.nio.Sock
etChannelImpl.write(SocketChannelImpl.java)
09-21 17:19:09.078 29187 29213 E PersistentRelayTunnel:         at com.genymobil
e.gnirehtet.RelayTunnel.send(RelayTunnel.java:95)
09-21 17:19:09.078 29187 29213 E PersistentRelayTunnel:         at com.genymobil
e.gnirehtet.PersistentRelayTunnel.send(PersistentRelayTunnel.java:46)
09-21 17:19:09.078 29187 29213 E PersistentRelayTunnel:         at com.genymobil
e.gnirehtet.Forwarder.forwardDeviceToTunnel(Forwarder.java:103)
09-21 17:19:09.078 29187 29213 E PersistentRelayTunnel:         at com.genymobil
e.gnirehtet.Forwarder.access$100(Forwarder.java:34)
09-21 17:19:09.078 29187 29213 E PersistentRelayTunnel:         at com.genymobil
e.gnirehtet.Forwarder$1.run(Forwarder.java:61)
09-21 17:19:09.078 29187 29213 E PersistentRelayTunnel:         at java.util.con
current.Executors$RunnableAdapter.call(Executors.java)
09-21 17:19:09.078 29187 29213 E PersistentRelayTunnel:         at java.util.con
current.FutureTask.run(FutureTask.java)
09-21 17:19:09.078 29187 29213 E PersistentRelayTunnel:         at java.util.con
current.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java)
09-21 17:19:09.078 29187 29213 E PersistentRelayTunnel:         at java.util.con
current.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java)
09-21 17:19:09.078 29187 29213 E PersistentRelayTunnel:         at java.lang.Thr
ead.run(Thread.java)
09-21 17:19:09.078 29187 29213 E PersistentRelayTunnel: Caused by: android.syste
m.ErrnoException: sendto failed: EBADF (Bad file descriptor)
09-21 17:19:09.078 29187 29213 E PersistentRelayTunnel:         at libcore.io.Po
six.sendtoBytes(Native Method)
09-21 17:19:09.078 29187 29213 E PersistentRelayTunnel:         at libcore.io.Po
six.sendto(Posix.java)
09-21 17:19:09.078 29187 29213 E PersistentRelayTunnel:         at libcore.io.Bl
ockGuardOs.sendto(BlockGuardOs.java)
09-21 17:19:09.078 29187 29213 E PersistentRelayTunnel:         ... 13 more
09-21 17:19:09.081  5023  5023 D ValidateNoPeople: setContact(com.genymobile.gni
rehtet,0.0,false)
09-21 17:19:09.100  5402  5402 I RemoteViews: apply(39,9)/com.genymobile.gnireht
et
09-21 17:19:09.112  5402  5402 I RemoteViews: apply(5,3)/com.genymobile.gnirehte
t
09-21 17:19:09.112  5402  5402 I RemoteViews: apply(45,10)/com.genymobile.gnireh
tet
09-21 17:19:09.120  5402  5402 I RemoteViews: apply(5,0)/com.genymobile.gnirehte
t
09-21 17:19:09.120  5402  5402 I RemoteViews: apply(45,8)/com.genymobile.gnireht
et
09-21 17:19:09.127  5402  5402 I PhoneStatusBar: updateEmptyShade(true,false)
09-21 17:19:09.127  5402  5402 I NotificationStackScrollLayout: setBlockTouch:fa
lse
09-21 17:19:10.455  5023  5129 W SensorService: D/Accel(x, y, z, t) = ( -0.3,  -
0.1,   9.8, 4319142ms), calendar = 1505996350, sys_time = 4319165ms
09-21 17:19:10.463   710 30223 D libc    : after statp->options=0x800002C1)
09-21 17:19:11.643   710 30218 D libc    : [NET]Querying server xid =6941 (# 1)
address = 8.8.8.8 (try=1,nscount=1,v_circuit=0)
09-21 17:19:11.643   710 30218 D libc    : before statp->options=0x800002C3)
09-21 17:19:11.993   710 30221 D libc    : after statp->options=0x800002C1)
09-21 17:19:12.081   710 30232 D libc    : [NET]Querying server xid =67cd (# 1)
address = 8.8.8.8 (try=1,nscount=1,v_circuit=0)
09-21 17:19:12.081   710 30232 D libc    : before statp->options=0x800002C3)
09-21 17:19:12.101  5023  5445 I ActivityManager: Killing 29653:com.htc.task/u0a
97 (adj 15): empty #17
09-21 17:19:12.102  5023  5445 D Process : killProcessQuiet, pid=29653
09-21 17:19:12.105  5023  5445 D Process : com.android.server.am.ProcessRecord.k
ill:-1 com.android.server.am.ActivityManagerService.updateOomAdjLocked:-1 com.an
droid.server.am.ActivityManagerService.updateOomAdjLocked:-1
09-21 17:19:12.143  5023  5839 I ActivityManager: Recipient 29653
09-21 17:19:12.465  5023  5129 W SensorService: D/Accel(x, y, z, t) = ( -0.2,  -
0.0,   9.8, 4321169ms), calendar = 1505996352, sys_time = 4321175ms
09-21 17:19:12.560   710 30225 D libc    : [NET]Querying server xid =57b8 (# 1)
address = 8.8.8.8 (try=1,nscount=1,v_circuit=0)
09-21 17:19:12.560   710 30225 D libc    : before statp->options=0x800002C3)

@rom1v
Copy link
Collaborator

rom1v commented Sep 21, 2017

E PersistentRelayTunnel: Cannot send to tunnel
E PersistentRelayTunnel: java.io.IOException: Can not read from channel

Do you have a firewall or something like that (on Android or your computer)?

When enabled, what is the result of:

adb reverse --list

?

The relay server is running in another terminal, right?

./gnirehtet relay

@ammarhaider5
Copy link
Author

It says tcip:31416 tcp:31416 when I try adb reverse --list

And no there is no relay server running in another terminal. When I try ./gnirehtet relay another window opens up but closes

@rom1v
Copy link
Collaborator

rom1v commented Sep 21, 2017

OK, so the problem is that your relay server is not running.

./gnirehtet relay another window opens up but closes

What's your operating system?

On Linux, it should not open another window.
On Windows, execute gnirehtet relay instead (no ./).

@ammarhaider5
Copy link
Author

ammarhaider5 commented Sep 21, 2017

Windows 7. I am running it without "./"

@guiniol
Copy link

guiniol commented Sep 25, 2017

I have the same issue, except:

  • I use Linux
  • My phone is on Android 7.1.2 (LineageOS 14.1)
  • I disabled the firewall
  • I tried ./gnirehtet run
  • I tried ./gnirehtet relay + ./gnirehtet install + ./gnirehtet start

Logcat:
logcat.txt

If there's anything else I can do to help, just ask.
I've looked for such an app several time, so I'd really like it to work ^^

@rom1v
Copy link
Collaborator

rom1v commented Sep 25, 2017

It behaves as if adb reverse tcp:31416 tcp:31416 were not executed.

If you have netcat on your device, you can test:

  • enable the tunnel with adb reverse tcp:31416 tcp:31416;
  • on the computer, listen on port 31416: nc -l -p 31416 (parameters behavior may differ depending on your netcat version);
  • on the Android device, connect to the tunnel: nc localhost 31416.

If it works, then you should be able to send text between the computer and the Android device.

@guiniol
Copy link

guiniol commented Sep 25, 2017

Executing adb reverse tcp:31416 tcp:31416 manually works (I can send/receive info with netcat).

When I do ./gnirehtet run, adb reverse --list shows (reverse) tcp:31416 tcp:31416 so the port seems to be forwarded properly. If I run nc localhost 31416, the connection is established properly (but sending anything crashes the relay (expected I suppose: thread 'main' panicked at 'Not an Ipv4 packet, version=6', src/relay/ipv4_packet_buffer.rs:44:12)

@rom1v
Copy link
Collaborator

rom1v commented Sep 25, 2017

Thank you for your tests, that's very helpful. So this is not an adb reverse nor a relay server problem. Therefore, it must be in the Android application.

Could you figure out the value of Inet4Address.getLocalHost() (called here) on your Android device?

@guiniol
Copy link

guiniol commented Sep 25, 2017

Sure, but I don't know how I would go about it.
Is the results of ip a on the phone good enough ?

EDIT: I never said, but I'm using the latest release (2.0) not HEAD. I don't have the android SDK or gradle installed.

@rom1v
Copy link
Collaborator

rom1v commented Sep 25, 2017

I just created a tool to print its value.

Download localhost.jar
(sha256: dc9aab0ea603db94b877946cdf45fe9daf41a71682e0f63cca5ffd9b63e0377c).

Push it to the device:

adb push localhost.jar /data/local/tmp/

Then run:

adb shell "CLASSPATH=/data/local/tmp/localhost.jar app_process /system/bin Localhost"

@guiniol
Copy link

guiniol commented Sep 25, 2017

this is the output: localhost/::1
hummm, IPv6?

@rom1v
Copy link
Collaborator

rom1v commented Sep 25, 2017

OK, got it 👍

Could you confirm that this APK fixes the problem, please?
(sha256: 6b9c5e4cedee46df0ae655463daef96a64f9e8acb4b9775a9b80e432a49aa44e)

@guiniol
Copy link

guiniol commented Sep 25, 2017

It goes much further. I see a lot of lines like this:

2017-09-25 15:39:36.208 INFO TcpConnection: 10.238.192.180:48854 -> 113.29.141.34:5242 Close
2017-09-25 15:39:36.223 INFO TcpConnection: 10.0.0.2:52193 -> 113.29.141.34:5242 Open
2017-09-25 15:39:40.510 INFO UdpConnection: 10.0.0.2:23825 -> 8.8.8.8:53 Open
2017-09-25 15:39:40.512 INFO TcpConnection: 10.0.0.2:52145 -> 157.240.21.11:443 Open
2017-09-25 15:39:42.422 INFO UdpConnection: 10.0.0.2:20655 -> 8.8.8.8:53 Open

However, when I try to load a web page, it takes a while but then it tells me that the phone is offline. My guess is that there are no routes on my computer to route the data from the gnirehtet to the internet.

@rom1v
Copy link
Collaborator

rom1v commented Sep 25, 2017

Are you in an enterprise network requiring a proxy?

@rom1v rom1v added the bug label Sep 25, 2017
@rom1v rom1v self-assigned this Sep 25, 2017
@guiniol
Copy link

guiniol commented Sep 25, 2017

No. We're NATed but that's transparent to the machines on the network.
However, only the inside DNS are accessible. Using ./gnirehtet run -d <inside-dns> worked!

@rom1v
Copy link
Collaborator

rom1v commented Sep 25, 2017

However, only the inside DNS are accessible. Using ./gnirehtet run -d <inside-dns> worked!

👍

Thank you very much for your help!

Bug fixed by c2b0fc9

@rom1v rom1v closed this as completed Sep 25, 2017
@guiniol
Copy link

guiniol commented Sep 25, 2017

Happy to help.

Just did a speedtest. I can saturate the 24Mbps line when downloading but I'm not even close when uploading. (not a bug, just a remark ^^)

@rom1v
Copy link
Collaborator

rom1v commented Sep 25, 2017

What is the max upload bitrate directly from your computer?
What is the bitrate when you adb pull /sdcard/somefile?
What is the bitrate when uploading through gnirehtet?

EDIT: or even better than a pull, transfer a file using netcat and measure with pv:

# on the computer
adb reverse tcp:1234 tcp:1234
nc -l -p 1234
# on the device
adb shell "cat /sdcard/somefile | nc 127.0.0.1 1234" | pv > /dev/null

@guiniol
Copy link

guiniol commented Sep 25, 2017

From the computer, I can saturate the 24Mbps link.
When doing adb pull, I get 18.6 MB/s (909115392 bytes in 46.626s) which is about 150Mbps.
When using gnirehtet, I get 1.4Mbps for the upload.
When using netcat to the computer, I get 626MiB 0:01:50 [5.68MiB/s]. Same file as before, but there was a connection error at some point:

2017-09-25 16:32:39.626 INFO TcpConnection: 10.0.0.2:49436 -> 10.8.0.245:31312 Open
2017-09-25 16:32:39.626 WARN TcpConnection: 10.0.0.2:49436 -> 10.8.0.245:31312 Unexpected first packet 4068744992; acking 3883021658; flags=16
2017-09-25 16:32:39.626 INFO TcpConnection: 10.0.0.2:49436 -> 10.8.0.245:31312 Close

I also tried using scp, but that didn't work. Lots of:

2017-09-25 16:25:16.323 INFO TcpConnection: 10.0.0.2:58359 -> 84.39.33.42:8080 Open
2017-09-25 16:25:16.323 WARN TcpConnection: 10.0.0.2:58359 -> 84.39.33.42:8080 Unexpected first packet 3509394381; acking 1239190467; flags=17
2017-09-25 16:25:16.323 INFO TcpConnection: 10.0.0.2:58359 -> 84.39.33.42:8080 Close

Overall, I think gnirehtet is capable of saturating the link, but there is a problem with tcp sequence numbers somewhere, which of course resets connection and slows things down.

@rom1v
Copy link
Collaborator

rom1v commented Sep 25, 2017

there is a problem with tcp sequence numbers somewhere, which of course resets connection and slows things down

Could you open a new issue with these data, please?

There is probably an issue with TCP window management.

@guiniol
Copy link

guiniol commented Sep 25, 2017

Done: #43

rom1v added a commit that referenced this issue Sep 26, 2017
Port forwarding created by "adb reverse" only supports IPv4.

Therefore, use 127.0.0.1 instead of the value returned by
InetAddress.getLocalhost(), which is ::1 on some devices.

See <#42>.
@frrg
Copy link

frrg commented Aug 6, 2019

I have the same issue, except:

  • I use Linux
  • My phone is on Android 7.1.2 (LineageOS 14.1)
  • I disabled the firewall
  • I tried ./gnirehtet run
  • I tried ./gnirehtet relay + ./gnirehtet install + ./gnirehtet start

Logcat:
logcat.txt

If there's anything else I can do to help, just ask.
I've looked for such an app several time, so I'd really like it to work ^^

it worked for me, thanks

@marpace1
Copy link

marpace1 commented Jan 7, 2023

hey i have a issue that whenever i open a game it automatically disconnect
help me please urgent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants