-
-
Notifications
You must be signed in to change notification settings - Fork 906
[android] allow selection/deselection of network resources on android peers #4607
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
Open
doromaraujo
wants to merge
22
commits into
netbirdio:main
Choose a base branch
from
doromaraujo:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+526
−30
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To return information regarding if the network route is selected for a given peer or not
Android has the same limitation as iOS in regard to file creation, so it can't create the state file at the default location returned by ServiceManager's GetStatePath (/var/lib/netbird/state.json)
When setting engine's state manager
Added to iface_create.go and iface_create_darwin.go Since this is only used in android's context, it throws an error when those implementations are called
pappz
requested changes
Oct 8, 2025
…paths This was done to lower the amount of parameters passed to android/client's NewClient function
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe your changes
Allows user to toggle network resources on android client via exported functions.
Since we can't update the routes table on android's tun interface after creating a VPN when a network route change is detected, this also exports a function to renew the tun.Device's file descriptor used in android devices with a new implementation of WireGuard's tun.Device interface.
RenewableTUN is used in place of the created unmonitored tun on client/iface/device/device_android's Create function when passing a tun.Device to WGTunDevice's filteredDevice field. The unmonitored tun is added as a device to RenewableTUN, which manages a queue of tun.Devices internally.
Every call to a tun.Device method implemented by RenewableTUN uses the latest queued tun.Device's implementation.
When renewing a file descriptor in device_android, a new unmonitored tun is created with it, then it is added to RenewableTUN, deferring closure of the oldest tun.Device managed by it.
This also fixes a bug that didn't allow android clients to properly save its current profile's state with the same approach
used in iOS.
Issue ticket number and link
Stack
Checklist
Documentation
Select exactly one:
Docs PR URL (required if "docs added" is checked)
Paste the PR link from https://github.com/netbirdio/docs here:
https://github.com/netbirdio/docs/pull/__