Skip to content

Fix no connection with gnirehtet reverse tethering#462

Open
Linus789 wants to merge 1 commit into
WangDaYeeeeee:masterfrom
Linus789:fix-rt-connection
Open

Fix no connection with gnirehtet reverse tethering#462
Linus789 wants to merge 1 commit into
WangDaYeeeeee:masterfrom
Linus789:fix-rt-connection

Conversation

@Linus789
Copy link
Copy Markdown

@Linus789 Linus789 commented Feb 19, 2023

Sadly, I haven’t been able to test if it works because of a build error.

> Task :app:kaptGenerateStubsFdroidDebugKotlin FAILED
e: java.lang.IllegalAccessError: class org.jetbrains.kotlin.kapt3.base.KaptContext (in unnamed module @0x40b17ca7) cannot access class com.sun.tools.javac.util.Context (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.util to unnamed module @0x40b17ca7

But I think this should do the trick.

Edit: Okay, I have been able to build this with Android Studio now, but it seems like it only works partially. I can search for cities, but getting the weather data fails.

Edit 2: I have installed the wrong .apk. Tested it with the correct one right now and everything seems to work as expected.

@papjul
Copy link
Copy Markdown
Contributor

papjul commented Feb 19, 2023

Can you be a bit more specific? I use a VPN connection to analyze the traffic with no issue.

@Linus789
Copy link
Copy Markdown
Author

Linus789 commented Feb 19, 2023

Gnirehtet uses a VPN, but does not need WiFi or something else. When you use a VPN, I’m sure you have something else enabled at the same time like WiFi. First case doesn’t work, your case does.

Edit: Using Gnirehtet might work on older Android versions, but with my Android 13 phone not anymore.

@Linus789 Linus789 marked this pull request as draft February 20, 2023 00:51
@Linus789 Linus789 marked this pull request as ready for review February 20, 2023 01:14
@Linus789
Copy link
Copy Markdown
Author

Okay, tested it on my phone right now and seems to work.

@papjul
Copy link
Copy Markdown
Contributor

papjul commented Feb 20, 2023

I tried a different implementation here:
https://github.com/WangDaYeeeeee/GeometricWeather/pull/440/commits/fba3a3ff0fbe218930acf55bc056ff3cb9a44487
(sorry, GitHub messes with the link if I don't put it like this)

Can you try the debug APK from the "Check" tab?
Edit: I just installed gnirehtet for the test, it works (but only with Android Nougat or later (API 24+), which should be like 99% of Android devices today). If that's fine for you, you can close your pull request?

I think this implementation is better because the current one is deprecated with SDK >= 29 + the callback can be useful in the future for other things (such as refreshing outdated weather data, once network is available).

@Linus789
Copy link
Copy Markdown
Author

Linus789 commented Feb 20, 2023

There should be a fallback for lower Android versions. Otherwise your implementation seems correct.

Edit: Seems like changing the applicationId does not work.

@papjul
Copy link
Copy Markdown
Contributor

papjul commented Feb 20, 2023

The debug APK from GitHub contains a different signature. Your use case is very specific, especially for a project that is no longer actively maintained. I don't think we need a fix for users of Gnirehtet and Android 6.0 and before.

@Linus789
Copy link
Copy Markdown
Author

Your use case is very specific, especially for a project that is no longer actively maintained.

True.

I don't think we need a fix for users of Gnirehtet and Android 6.0 and before.

I’d still like to have it fixed for every supported Android version nonetheless. I mean, it’s not even like it’s really hard to support older Android versions like Android 6.

@papjul
Copy link
Copy Markdown
Contributor

papjul commented Feb 20, 2023

Yes, I can understand, it's just that I'm not very fan of your proposition, it looks like a dirty trick to me. You query the VPN connection manager for every user for a specific use case I have yet to understand (using a weather app from a computer connection, why?). But I know I'm being picky, so I will let the developer of this app share his thoughts on the matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants