Comments (17)
VPNs which can be considered explicitly desired by the user and the // user's desire trumps whether the network validates.
The question is then HOW can a user explicitly desire a VPN, probably there is an option somewhere, but I suppose the underlying network needs to be set anyway also for this user-based validation.
Probably we could also ask in the google ticket why it doesn't work.. https://issuetracker.google.com/issues/37109422
from simplert.
yes, there is kind issue, i described it in readme:
Issues: Some apps do not recognize the reverse tethered internet connection due to ConnectivityManager policy. Just leave WiFi or 3g connection active, connection will go through SimpleRT anyway.
from simplert.
Please reopen...
It seems Android just shows no activeNetwork because it wants a VPN to have an UnderlyingNetwork for that, and you can set the own Network as underlyingNetwork...
https://issuetracker.google.com/issues/37109422:
"can you use VpnService#setUnderlyingNetworks to solve this issue? Once the VPN is established, find the Network object of the VPN and then pass it to setUnderlyingNetworks."
"you can try setting your own network as the underlying network. getAllNetworks will return an array of networks, and you can inspect those to find out which one is your own (e.g., by calling getLinkProperties)"
Please fix that. Thanks.
from simplert.
can you use VpnService#setUnderlyingNetworks to solve this issue
yes, its possible, but this stuff supported only in API>=22, when i want to have one apk build for all api's >=14. i need to research how to do that (i am more linux coder than android).
from simplert.
i am more linux coder than android
I Know what you mean, me too. :D
But you could at least look if android.os.Build.VERSION.SDK_INT >= 22 and then set the Underlying Network and otherwise skip it. ^^"
from simplert.
sure, i'll fix it asap
from simplert.
I tried the method suggested by Sur3 (Waiting for network to be connected, then calling setUnderlyingNetworks on the VPN builder object with the now connected network object. I also tried calling reportNetworkConnectivity for the network object, and still doesn't work. Browser and Google play still report no network. Here's some debug. Note the last line with "isDefaultNetwork-false". I'm wondering if a network of VPN can never be the default network...
06-22 16:56:45.977 2449-3230/system_process D/Vpn: setting state=CONNECTING, reason=establish 06-22 16:56:45.978 2449-3230/system_process D/VpnJni: Address added on tun0: 10.1.1.37/24 06-22 16:56:45.979 2097-2428/? E/Netd: Failed to destroy IPv4 sockets on 10.1.1.37: Invalid argument 06-22 16:56:45.980 2097-2428/? E/Netd: Error destroying sockets: Unknown error -22 06-22 16:56:46.000 2449-3230/system_process D/ConnectivityService: registerNetworkAgent NetworkAgentInfo{ ni{[type: VPN[], state: CONNECTING/CONNECTING, reason: (unspecified), extra: (none), failover: false, available: false, roaming: false, metered: false]} network{110} nethandle{472462838494} lp{{InterfaceName: tun0 LinkAddresses: [10.1.1.37/24,] Routes: [0.0.0.0/0 -> 0.0.0.0 tun0,::/0 unreachable,] DnsAddresses: [8.8.8.8,] Domains: MTU: 0}} nc{[ Transports: VPN Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED]} Score{0} everValidated{false} lastValidated{false} created{false} lingering{false} explicitlySelected{false} acceptUnvalidated{false} everCaptivePortalDetected{false} lastCaptivePortalDetected{false} } 06-22 16:56:46.000 2449-2549/system_process D/ConnectivityService: NetworkAgentInfo [VPN () - 110] EVENT_NETWORK_INFO_CHANGED, going from null to CONNECTING 06-22 16:56:46.001 2449-3230/system_process D/Vpn: setting state=CONNECTED, reason=agentConnect 06-22 16:56:46.001 2449-3230/system_process I/Vpn: Established by com.viper.simplert on tun0 06-22 16:56:46.002 28088-28088/? D/TetherService: 2 - Print network 06-22 16:56:46.002 28088-28088/? D/TetherService: 2 - Network: 110 06-22 16:56:46.004 28088-28088/? D/TetherService: 2 - LP: {InterfaceName: tun0 LinkAddresses: [10.1.1.37/24,] Routes: [0.0.0.0/0 -> 0.0.0.0 tun0,::/0 unreachable,] DnsAddresses: [8.8.8.8,] Domains: MTU: 0} 06-22 16:56:46.004 2449-13602/system_process D/ConnectivityService: reportNetworkConnectivity(110, true) by 10081 06-22 16:56:46.005 2097-2438/? E/Netd: Failed to dump IPv4 sockets for UID: Invalid argument 06-22 16:56:46.005 2097-2438/? E/Netd: Failed to close sockets while adding UidRanges{ 0-99999 } to network 110: Invalid argument 06-22 16:56:46.006 2449-2549/system_process D/ConnectivityService: NetworkAgentInfo [VPN () - 110] EVENT_NETWORK_INFO_CHANGED, going from CONNECTING to CONNECTED 06-22 16:56:46.006 2449-2549/system_process D/ConnectivityService: Adding iface tun0 to network 110 06-22 16:56:46.008 28088-28088/? D/TetherService: 2 - Done print network 06-22 16:56:46.008 28088-28088/? D/TetherService: SimpleRT Connected! 06-22 16:56:46.028 28088-28088/? V/SIMPLE_RT_JNI: Java_com_viper_simplert_Native_start: tun_fd = 36, acc_fd = 35 06-22 16:56:46.146 28088-28107/? D/libEGL: loaded /system/lib/egl/libGLESv2_mali.so 06-22 16:56:46.168 2449-2549/system_process D/ConnectivityService: Setting DNS servers for network 110 to [/8.8.8.8] 06-22 16:56:46.177 2449-2549/system_process W/ConnectivityExtension: ConnectivityExt jar file not present 06-22 16:56:46.182 2449-2549/system_process W/ConnectivityExtension: ConnectivityExt jar file not present 06-22 16:56:46.187 2449-28114/system_process D/NetworkMonitor/NetworkAgentInfo [VPN () - 110]: Network would not satisfy default request, not validating 06-22 16:56:46.208 2449-2549/system_process D/ConnectivityService: Sending CONNECTED broadcast for type 17 NetworkAgentInfo [VPN () - 110] isDefaultNetwork=false
from simplert.
2449-28114/system_process D/NetworkMonitor/NetworkAgentInfo [VPN () - 110]: Network would not satisfy default request, not validating 06-22 16:56:46.208 2449-2549/system_process
At least it tries to set it as default network, some properties just seem not to be satisfied, probably because of the missing extension..
2449-2549/system_process W/ConnectivityExtension: ConnectivityExt jar file not present 06-22 16:56:46.182 2449-2549/system_process W/ConnectivityExtension: ConnectivityExt jar file not present 06-22 16:56:46.187
from simplert.
Any ideas what the missing extensions are? I'd love to get this fixed...
from simplert.
Looks like that ConnectivityExt is a red herring, and you can find a lot of other people mentioning it and seems unrelated.
What I did find doesn't bode well. That "would not satisfy default request" messages comes from this code:
// Don't bother validating networks that don't satisify the default request. // This includes: // - VPNs which can be considered explicitly desired by the user and the // user's desire trumps whether the network validates. // - Networks that don't provide internet access. It's unclear how to // validate such networks. // - Untrusted networks. It's unsafe to prompt the user to sign-in to // such networks and the user didn't express interest in connecting to // such networks (an app did) so the user may be unhappily surprised when // asked to sign-in to a network they didn't want to connect to in the // first place. Validation could be done to adjust the network scores // however these networks are app-requested and may not be intended for // general usage, in which case general validation may not be an accurate // measure of the network's quality. Only the app knows how to evaluate // the network so don't bother validating here. Furthermore sending HTTP // packets over the network may be undesirable, for example an extremely // expensive metered network, or unwanted leaking of the User Agent string. if (!mDefaultRequest.networkCapabilities.satisfiedByNetworkCapabilities( mNetworkAgentInfo.networkCapabilities)) { validationLog("Network would not satisfy default request, not validating"); transitionTo(mValidatedState); return HANDLED; }
The comment explicitly says VPN networks are excluded, and I've seen this capability flag that's on by default called "NOT_VPN". I think the system is hard coded not to ever consider a VPN as a default network.
from simplert.
That's fine if you control your internet connection, but in my example, I put a google map up, and it uses the system's location services, which uses the system's default connection. Changing the App's connection still doesn't let the map load.
I'm to the point where for my specific application, I'm going to modify the base OS, so I can change the default network requirements.
Is there another way we could do this? IE, not use VPN for the connection, but instead RNDIS?
from simplert.
Hi thardie.
I don't know what you mean by 'control my internet connection', you mean it is possible to set a specific connection for an app, how is that done?
And could you provide your apk and/or patch to set the underlying network, I'd like to try it myself.
Greetz
Sur3
from simplert.
By "control my connection", I meant in my app, I can make a call to set what type of network I want to be connected to. Then any sockets or communication I initiate from my app will use that connection. However, if I ask a system service for something, and it in turn needs to talk to the internet, it will use the system's connection, and not my app. Location services is one such example.
In terms of modifying the underlying network, I would have to modify the OS itself. I'd have to do this with cyanogenmod for example. I really would like to find another way.
I still don't have this working, so I don't have anything to give you yet. :(
from simplert.
@vvviperrr any update on including that pr from eugene?
from simplert.
@Sur3 @eugene-sevostianov-sc . Given that PR is a couple of years old now and apparently can't be merged, is either of you interested in fixing it up so it will work?
Thanks
from simplert.
@robinpaulson you can close it, #40 is merged with change from @Sur3 9b63526
from simplert.
Thanks
from simplert.
Related Issues (20)
- SimpleRT icon was not added to my andoid desktop HOT 3
- Why did you stop developing this? HOT 3
- Have u resolved the MULTIQUEUE issue on the TUN/TAP ? HOT 1
- SimpleRT over VPN interface HOT 1
- Allow a way to select IP addresses/ranges HOT 4
- Tunneling unsuccessful HOT 5
- Future of this project : forks HOT 13
- Hi! An introduction
- Create simple GUI for desktop component HOT 2
- Implement fastlane metadata file structure HOT 2
- Implement continuous integration HOT 5
- Add SPDX-compatible licence info to each file
- Screenshots for F-Droid
- Ability to restart Android app
- Setup steps images are missing HOT 3
- feature request:android to android
- Can I use this project with Android Studio
- "No installed apps work with this USB accessory"
- [Help] Openwrt usb reverse tethering with Android phone
- "no apps work with this usb accessory" error when starting desktop side binary
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simplert.