Genymobile / gnirehtet

Gnirehtet provides reverse tethering for Android
Apache License 2.0
6.13k stars 565 forks source link

Issue with Digimon Links (Android Game) #48

Closed cpytron closed 6 years ago

cpytron commented 6 years ago

Hi, gnirehtet is an amazing program and is a complete savior to me.

I am having an issue with the game Digimon Links, and I have never had a problem with any other game or app before while using this program. This may not even be a problem with gnirehtet, it may be with the app.

The game boots and loads fine, but after a battle the game is stuck on the loading screen and my android is showing that no data is being downloaded or uploaded at all during this time. Gnirehtet is still running during this. I have tried both the Java and Rust versions and nothing has changed.

I have been thinking this might be a problem with Digimon Links not registering (or being built to use) a VPN or tethering, if that is what gnirehtet actually does. I am not sure what the problem is really. The program works with all the other online mobile games I have tried, such as Summoners War.

I'm not sure what I could do about this problem or if it is even a gnirehtet problem. Any insight would be helpful.

Edit: The game loads after the battle if I stop the program and restart it with ./gnirehtet run. It's annoying to have to keep restarting the program.

rom1v commented 6 years ago

Are there any relevant logs in the relay server console when it is stuck on the loading screen?

Or in adb logcat?

cpytron commented 6 years ago
[cpytron@unknown gnirehtet-java]$ ./gnirehtet run
2017-10-10 15:43:33.640 I Gnirehtet: Checking gnirehtet client...
2017-10-10 15:43:33.845 I Gnirehtet: Starting client...
2017-10-10 15:43:33.848 I Gnirehtet: Starting relay server...
2017-10-10 15:43:33.895 I Relay: Relay server started
Broadcasting: Intent { act=com.genymobile.gnirehtet.START cmp=com.genymobile.gnirehtet/.GnirehtetControlReceiver }
Broadcast completed: result=0
2017-10-10 15:43:34.456 I TunnelServer: Client #0 connected
2017-10-10 15:43:34.486 I UDPConnection: UDP 10.0.0.2:63507 -> 8.8.8.8:53 Open
2017-10-10 15:43:34.549 I UDPConnection: UDP 10.0.0.2:46994 -> 8.8.8.8:53 Open
2017-10-10 15:43:34.702 I TCPConnection: TCP 10.0.0.2:37042 -> 172.217.0.138:443 Open
2017-10-10 15:43:35.119 I TCPConnection: TCP 10.0.0.2:32855 -> 216.58.218.5:443 Open
2017-10-10 15:43:35.427 I TCPConnection: TCP 100.68.229.245:57365 -> 31.13.65.3:443 Open
2017-10-10 15:43:35.696 I UDPConnection: UDP 10.0.0.2:60088 -> 8.8.8.8:53 Open
2017-10-10 15:43:35.780 I TCPConnection: TCP 10.0.0.2:33857 -> 74.125.138.102:80 Open
2017-10-10 15:43:36.466 I UDPConnection: UDP 10.0.0.2:54418 -> 8.8.8.8:53 Open
2017-10-10 15:43:36.586 I TCPConnection: TCP 10.0.0.2:33304 -> 199.168.30.200:443 Open
2017-10-10 15:43:37.314 I UDPConnection: UDP 10.0.0.2:54871 -> 8.8.8.8:53 Open
2017-10-10 15:43:37.381 I TCPConnection: TCP 10.0.0.2:52980 -> 54.80.155.203:80 Open
2017-10-10 15:43:38.350 W TCPConnection: TCP 10.0.0.2:33304 -> 199.168.30.200:443 Ignoring packet 1228013485; expecting 1228013517; flags=4
2017-10-10 15:43:38.351 W TCPConnection: TCP 10.0.0.2:33304 -> 199.168.30.200:443 Ignoring packet 1228013516; expecting 1228013517; flags=4
2017-10-10 15:43:38.354 I TCPConnection: TCP 10.0.0.2:33304 -> 199.168.30.200:443 Close
2017-10-10 15:43:38.357 I TCPConnection: TCP 10.0.0.2:33304 -> 199.168.30.200:443 Open
2017-10-10 15:43:38.358 W TCPConnection: TCP 10.0.0.2:33304 -> 199.168.30.200:443 Unexpected first packet 1228013517; acking 0; flags=4
2017-10-10 15:43:38.358 I TCPConnection: TCP 10.0.0.2:33304 -> 199.168.30.200:443 Close
2017-10-10 15:43:38.363 I TCPConnection: TCP 10.0.0.2:33304 -> 199.168.30.200:443 Open
2017-10-10 15:43:38.364 W TCPConnection: TCP 10.0.0.2:33304 -> 199.168.30.200:443 Unexpected first packet 1228013517; acking 0; flags=4
2017-10-10 15:43:38.364 I TCPConnection: TCP 10.0.0.2:33304 -> 199.168.30.200:443 Close
2017-10-10 15:43:39.006 I UDPConnection: UDP 10.0.0.2:39816 -> 8.8.8.8:53 Open
2017-10-10 15:43:39.054 I UDPConnection: UDP 10.0.0.2:43173 -> 8.8.8.8:53 Open
2017-10-10 15:43:39.564 I UDPConnection: UDP 10.0.0.2:65268 -> 8.8.8.8:53 Open
2017-10-10 15:43:39.626 I UDPConnection: UDP 10.0.0.2:51480 -> 8.8.8.8:53 Open
2017-10-10 15:43:39.637 W TCPConnection: TCP 100.68.229.245:57365 -> 31.13.65.3:443 Ignoring packet 783852730; expecting 783852784; flags=24
2017-10-10 15:43:39.704 I TCPConnection: TCP 10.0.0.2:38340 -> 74.125.138.138:443 Open
2017-10-10 15:43:40.379 I TCPConnection: TCP 10.0.0.2:37048 -> 172.217.0.138:443 Open
2017-10-10 15:43:44.816 W TCPConnection: TCP 100.68.229.245:57365 -> 31.13.65.3:443 Ignoring packet 783852143; expecting 783852784; flags=24
2017-10-10 15:43:45.641 I UDPConnection: UDP 10.0.0.2:46937 -> 8.8.8.8:53 Open
2017-10-10 15:43:45.687 I TCPConnection: TCP 10.0.0.2:53528 -> 157.240.18.15:443 Open
2017-10-10 15:43:55.158 W TCPConnection: TCP 100.68.229.245:57365 -> 31.13.65.3:443 Ignoring packet 783852143; expecting 783852784; flags=24
2017-10-10 15:43:56.443 I UDPConnection: UDP 10.0.0.2:40793 -> 8.8.8.8:53 Open
2017-10-10 15:43:56.502 I UDPConnection: UDP 10.0.0.2:40694 -> 8.8.8.8:53 Open
2017-10-10 15:43:56.566 I TCPConnection: TCP 10.0.0.2:34385 -> 172.217.3.238:443 Open
2017-10-10 15:44:15.877 W TCPConnection: TCP 100.68.229.245:57365 -> 31.13.65.3:443 Ignoring packet 783852143; expecting 783852784; flags=24
2017-10-10 15:44:34.424 I TCPConnection: TCP 100.68.229.245:57365 -> 31.13.65.3:443 Close
^C2017-10-10 15:45:08.721 I Gnirehtet: Stopping client...
Broadcasting: Intent { act=com.genymobile.gnirehtet.STOP cmp=com.genymobile.gnirehtet/.GnirehtetControlReceiver }
Broadcast completed: result=0
2017-10-10 15:45:09.624 I UDPConnection: UDP 10.0.0.2:63507 -> 8.8.8.8:53 Close
2017-10-10 15:45:09.624 I UDPConnection: UDP 10.0.0.2:46994 -> 8.8.8.8:53 Close
2017-10-10 15:45:09.625 I TCPConnection: TCP 10.0.0.2:37042 -> 172.217.0.138:443 Close
2017-10-10 15:45:09.625 I TCPConnection: TCP 10.0.0.2:32855 -> 216.58.218.5:443 Close
2017-10-10 15:45:09.625 I UDPConnection: UDP 10.0.0.2:60088 -> 8.8.8.8:53 Close
2017-10-10 15:45:09.625 I TCPConnection: TCP 10.0.0.2:33857 -> 74.125.138.102:80 Close
2017-10-10 15:45:09.626 I UDPConnection: UDP 10.0.0.2:54418 -> 8.8.8.8:53 Close
2017-10-10 15:45:09.626 I UDPConnection: UDP 10.0.0.2:54871 -> 8.8.8.8:53 Close
2017-10-10 15:45:09.626 I TCPConnection: TCP 10.0.0.2:52980 -> 54.80.155.203:80 Close
2017-10-10 15:45:09.626 I UDPConnection: UDP 10.0.0.2:39816 -> 8.8.8.8:53 Close
2017-10-10 15:45:09.627 I UDPConnection: UDP 10.0.0.2:43173 -> 8.8.8.8:53 Close
2017-10-10 15:45:09.627 I UDPConnection: UDP 10.0.0.2:65268 -> 8.8.8.8:53 Close
2017-10-10 15:45:09.627 I UDPConnection: UDP 10.0.0.2:51480 -> 8.8.8.8:53 Close
2017-10-10 15:45:09.628 I TCPConnection: TCP 10.0.0.2:38340 -> 74.125.138.138:443 Close
2017-10-10 15:45:09.628 I TCPConnection: TCP 10.0.0.2:37048 -> 172.217.0.138:443 Close
2017-10-10 15:45:09.628 I UDPConnection: UDP 10.0.0.2:46937 -> 8.8.8.8:53 Close
2017-10-10 15:45:09.628 I TCPConnection: TCP 10.0.0.2:53528 -> 157.240.18.15:443 Close
2017-10-10 15:45:09.629 I UDPConnection: UDP 10.0.0.2:40793 -> 8.8.8.8:53 Close
2017-10-10 15:45:09.629 I UDPConnection: UDP 10.0.0.2:40694 -> 8.8.8.8:53 Close
2017-10-10 15:45:09.629 I TCPConnection: TCP 10.0.0.2:34385 -> 172.217.3.238:443 Close
2017-10-10 15:45:09.630 I TunnelServer: Client #0 disconnected
cpytron commented 6 years ago

I don't know how to read most of this and I apologize for the formating of it. I just copy and pasted it.

cpytron commented 6 years ago

At the Control C command is where I stopped the program and where the game was stuck at the loading screen.

rom1v commented 6 years ago
2017-10-10 15:43:39.637 W TCPConnection: TCP 100.68.229.245:57365 -> 31.13.65.3:443 Ignoring packet 783852730; expecting 783852784; flags=24
2017-10-10 15:43:44.816 W TCPConnection: TCP 100.68.229.245:57365 -> 31.13.65.3:443 Ignoring packet 783852143; expecting 783852784; flags=24
2017-10-10 15:43:55.158 W TCPConnection: TCP 100.68.229.245:57365 -> 31.13.65.3:443 Ignoring packet 783852143; expecting 783852784; flags=24
2017-10-10 15:44:15.877 W TCPConnection: TCP 100.68.229.245:57365 -> 31.13.65.3:443 Ignoring packet 783852143; expecting 783852784; flags=24

Indeed, these logs suggest a bug. It seems the Android TCP peer missed an ACK packet from gnirehtet.

Finding the cause is more complicated (it can be a problem with TCP window management, in checksuming – but unlikely, it would fail in many other places –, or with the retry when client buffers are full…).

Could you produce a new log file in the same conditions (to see if the problem is consistent), please? (do not include the content after Ctrl+C).

PS: what is your device? which Android version?

cpytron commented 6 years ago

This is the Rust one

[cpytron@unknown gnirehtet-rust-linux64]$ ./gnirehtet run
2017-10-10 16:01:18.191 INFO Main: Checking gnirehtet client...
2017-10-10 16:01:18.330 INFO Main: Starting relay server...
2017-10-10 16:01:18.330 INFO Relay: Relay server started
2017-10-10 16:01:18.330 INFO Main: Starting client...
Broadcasting: Intent { act=com.genymobile.gnirehtet.START cmp=com.genymobile.gnirehtet/.GnirehtetControlReceiver }
Broadcast completed: result=0
2017-10-10 16:01:19.904 INFO TunnelServer: Client #0 connected
2017-10-10 16:01:19.958 INFO TcpConnection: 10.0.0.2:53307 -> 31.13.65.3:443 Open
2017-10-10 16:01:20.776 INFO UdpConnection: 10.0.0.2:14091 -> 8.8.8.8:53 Open
2017-10-10 16:01:20.834 INFO TcpConnection: 10.0.0.2:53570 -> 157.240.18.15:443 Open
2017-10-10 16:01:21.205 INFO UdpConnection: 10.0.0.2:28190 -> 8.8.8.8:53 Open
2017-10-10 16:01:21.267 INFO TcpConnection: 10.0.0.2:53216 -> 74.125.138.139:80 Open
2017-10-10 16:01:21.597 INFO UdpConnection: 10.0.0.2:15313 -> 8.8.8.8:53 Open
2017-10-10 16:01:21.648 INFO TcpConnection: 10.0.0.2:53572 -> 157.240.18.15:443 Open
2017-10-10 16:01:21.659 INFO TcpConnection: 10.0.0.2:43220 -> 23.36.33.99:80 Open
2017-10-10 16:01:24.204 INFO UdpConnection: 10.0.0.2:9540 -> 8.8.8.8:53 Open
2017-10-10 16:01:24.269 INFO TcpConnection: 10.0.0.2:53029 -> 54.80.155.203:80 Open
2017-10-10 16:01:26.329 INFO UdpConnection: 10.0.0.2:22820 -> 8.8.8.8:53 Open
2017-10-10 16:01:26.389 INFO UdpConnection: 10.0.0.2:2131 -> 8.8.8.8:53 Open
2017-10-10 16:02:03.999 INFO UdpConnection: 10.0.0.2:32735 -> 8.8.8.8:53 Open
2017-10-10 16:02:04.056 INFO TcpConnection: 10.0.0.2:55282 -> 172.217.11.130:443 Open
2017-10-10 16:02:41.669 INFO TcpConnection: 10.0.0.2:53029 -> 54.80.155.203:80 Close

This is the Java one

[cpytron@unknown gnirehtet-java]$ ./gnirehtet run
2017-10-10 16:04:55.847 I Gnirehtet: Checking gnirehtet client...
2017-10-10 16:04:56.053 I Gnirehtet: Starting client...
2017-10-10 16:04:56.056 I Gnirehtet: Starting relay server...
2017-10-10 16:04:56.091 I Relay: Relay server started
Broadcasting: Intent { act=com.genymobile.gnirehtet.START cmp=com.genymobile.gnirehtet/.GnirehtetControlReceiver }
Broadcast completed: result=0
2017-10-10 16:04:56.715 I TunnelServer: Client #0 connected
2017-10-10 16:04:56.747 I UDPConnection: UDP 10.0.0.2:56373 -> 8.8.8.8:53 Open
2017-10-10 16:04:56.753 I TCPConnection: TCP 10.0.0.2:53320 -> 31.13.65.3:443 Open
2017-10-10 16:04:57.689 I UDPConnection: UDP 10.0.0.2:55020 -> 8.8.8.8:53 Open
2017-10-10 16:04:57.751 I UDPConnection: UDP 10.0.0.2:44766 -> 8.8.8.8:53 Open
2017-10-10 16:04:57.983 I UDPConnection: UDP 10.0.0.2:1834 -> 8.8.8.8:53 Open
2017-10-10 16:04:58.054 I TCPConnection: TCP 10.0.0.2:48097 -> 74.125.138.113:80 Open
2017-10-10 16:05:01.591 I UDPConnection: UDP 10.0.0.2:34275 -> 8.8.8.8:53 Open
2017-10-10 16:05:01.650 I TCPConnection: TCP 10.0.0.2:53039 -> 54.80.155.203:80 Open

Both were done under the same conditions but neither are showing the missed packets now. And the same problem is still there where I am stuck at the loading screen.

cpytron commented 6 years ago

I have noticed the missed ACK packet in the relay for awhile now. I didn't really recognize what it meant so I never bothered to post anything about it. I don't know why I couldn't replicate it this time.

rom1v commented 6 years ago

All "ignoring packet" are not a problem (they are in fact very common). This is a problem when it is correlated to a stuck connection and it keeps sending and old-numbered packet, and here it kept sending an even older. However, in fact it did it only 3~4 times, and nothing until the connection closed 20 seconds later, so this is maybe not a problem.

Anyway, after reading your new logs, it seems this is not the cause of your issue.

Is the loading stuck even without gnirehtet (using a normal connection)?

It seems the connection to their server timeouts...

cpytron commented 6 years ago

No, when I disconnect gnirehtet and run it on 4G the game runs fine. I'm only having the issue when running gnirehtet. The problem only happens upon finishing a battle... Everything else runs fine in game until I do that.

If I stop gnirehtet during the loading screen and restart gnirehtet the game loads again.

rom1v commented 6 years ago

Do you have a firewall or something on your host, that could block the connection?

cpytron commented 6 years ago

I just have the built in firewall for Manjaro. I can try it again with it disabled.

cpytron commented 6 years ago
[cpytron@unknown gnirehtet-java]$ ./gnirehtet run
2017-10-10 16:26:34.638 I Gnirehtet: Checking gnirehtet client...
2017-10-10 16:26:34.883 I Gnirehtet: Starting client...
2017-10-10 16:26:34.887 I Gnirehtet: Starting relay server...
2017-10-10 16:26:34.946 I Relay: Relay server started
Broadcasting: Intent { act=com.genymobile.gnirehtet.START cmp=com.genymobile.gnirehtet/.GnirehtetControlReceiver }
Broadcast completed: result=0
2017-10-10 16:26:36.112 I TunnelServer: Client #0 connected
2017-10-10 16:26:36.188 I TCPConnection: TCP 10.0.0.2:53443 -> 31.13.65.3:443 Open
2017-10-10 16:26:36.984 I UDPConnection: UDP 10.0.0.2:45630 -> 8.8.8.8:53 Open
2017-10-10 16:26:37.033 I TCPConnection: TCP 10.0.0.2:40052 -> 31.13.65.1:443 Open
2017-10-10 16:26:37.392 I UDPConnection: UDP 10.0.0.2:55398 -> 8.8.8.8:53 Open
2017-10-10 16:26:37.492 I TCPConnection: TCP 10.0.0.2:43899 -> 74.125.138.138:80 Open
2017-10-10 16:26:37.532 I UDPConnection: UDP 10.0.0.2:62353 -> 8.8.8.8:53 Open
2017-10-10 16:26:37.624 I TCPConnection: TCP 10.0.0.2:52508 -> 23.23.96.14:443 Open
2017-10-10 16:26:38.032 I UDPConnection: UDP 10.0.0.2:55087 -> 8.8.8.8:53 Open
2017-10-10 16:26:38.107 I TCPConnection: TCP 10.0.0.2:40055 -> 31.13.65.1:443 Open
2017-10-10 16:26:38.153 I UDPConnection: UDP 10.0.0.2:1228 -> 8.8.8.8:53 Open
2017-10-10 16:26:38.159 I TCPConnection: TCP 10.0.0.2:43357 -> 23.36.33.99:80 Open
2017-10-10 16:26:38.204 I TCPConnection: TCP 10.0.0.2:53166 -> 54.80.155.203:80 Open
2017-10-10 16:26:41.630 I UDPConnection: UDP 10.0.0.2:59673 -> 8.8.8.8:53 Open
2017-10-10 16:26:41.727 I UDPConnection: UDP 10.0.0.2:51441 -> 8.8.8.8:53 Open
2017-10-10 16:27:51.750 I UDPConnection: UDP 10.0.0.2:46531 -> 8.8.8.8:53 Open
2017-10-10 16:27:52.200 I UDPConnection: UDP 10.0.0.2:34807 -> 8.8.8.8:53 Open
2017-10-10 16:27:52.320 I UDPConnection: UDP 10.0.0.2:36468 -> 8.8.8.8:53 Open
2017-10-10 16:27:52.718 I UDPConnection: UDP 10.0.0.2:43629 -> 8.8.8.8:53 Open
2017-10-10 16:29:20.204 I TCPConnection: TCP 100.68.229.245:45409 -> 34.234.126.73:80 Open
2017-10-10 16:29:20.205 W TCPConnection: TCP 100.68.229.245:45409 -> 34.234.126.73:80 Unexpected first packet 398522471; acking -1998036960; flags=17
2017-10-10 16:29:20.205 I TCPConnection: TCP 100.68.229.245:45409 -> 34.234.126.73:80 Close
2017-10-10 16:29:34.961 I UDPConnection: UDP 10.0.0.2:51441 -> 8.8.8.8:53 Close
2017-10-10 16:29:34.961 I UDPConnection: UDP 10.0.0.2:59673 -> 8.8.8.8:53 Close
2017-10-10 16:29:34.962 I UDPConnection: UDP 10.0.0.2:1228 -> 8.8.8.8:53 Close
2017-10-10 16:29:34.962 I UDPConnection: UDP 10.0.0.2:55087 -> 8.8.8.8:53 Close
2017-10-10 16:29:34.962 I UDPConnection: UDP 10.0.0.2:62353 -> 8.8.8.8:53 Close
2017-10-10 16:29:34.963 I UDPConnection: UDP 10.0.0.2:55398 -> 8.8.8.8:53 Close
2017-10-10 16:29:34.963 I UDPConnection: UDP 10.0.0.2:45630 -> 8.8.8.8:53 Close

Turned my firewall off and the same problem still..

rom1v commented 6 years ago

Always the connection to 54.80.155.203:80...

Could you try using wifi (so you will have the same public IPv4 as your computer, without using gnirehtet)?

cpytron commented 6 years ago

I'm not sure what you mean or what you want me to do?

I'm using WiFi on my laptop, it's not a cabled connection.

I'm using gnirehtet because my phone's (LG G5) wireless chip can't reach far enough for a stable WiFi connection.

rom1v commented 6 years ago

I'm not sure what you mean or what you want me to do?

Contrary to what I first thought after your first log, I think the problem is not caused by gnirehtet: there is a problem only when you try to connect to 54.80.155.203:80, so something must be blocking it.

Maybe your public IP is banned or greylisted on their server, or something else.

That's why it would be interesting if you could test from another computer or with another ip, or conversely use the same public IP but without gnirehtet.

rom1v commented 6 years ago

I'm closing. If you have more information, feel free to reopen.