-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: Implement split-tunneling for Android #2528
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
base: master
Are you sure you want to change the base?
Conversation
This feature allows you to select specific applications to use the VPN tunnel, while other applications bypass it.
Changes include:
- Modified Android native code (`OutlineVpnService.java`, `VpnTunnel.java`, `IVpnTunnelService.aidl`) to use Android's `VpnService.Builder.addAllowedApplication()` method based on a list of package names.
- Updated the Cordova plugin (`OutlinePlugin.java`):
- Added a `GET_INSTALLED_APPS` action to retrieve a list of installed applications (name and package name).
- Modified the `START` action to accept an optional list of allowed application package names.
- Added UI elements for app selection:
- Created a new Polymer component (`app-selection-dialog`) to display installed applications with checkboxes.
- Integrated this dialog into the server settings view.
- Implemented persistence for split-tunneling settings:
- The list of allowed applications is saved per server configuration using `OutlineServerRepository`.
- Settings are loaded when the app starts and applied when connecting to a VPN server.
- Added comprehensive tests:
- Unit tests for the Cordova plugin's JavaScript interface.
- Unit tests for the new `app-selection-dialog` UI component.
- Integration tests for settings storage, loading, and application.
If no applications are selected for split-tunneling (the default), all applications will use the VPN tunnel.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
This commit addresses build failures encountered after the initial implementation of the Android split-tunneling feature.
The following files were modified:
- `client/src/www/app/outline_server_repository/server.ts`:
- Fixed an extra closing brace in the `OutlineServer` constructor.
- Ensured `OutlineServer` correctly implements the `Server` interface, including adding a getter for `tunnelConfigLocation`.
- `client/src/www/ui_components/app_selection_dialog.ts`:
- Refactored localization to use `AppLocalizeBehavior` instead of a missing `LocalizeMixin`.
- Imported `PaperDialogElement` type correctly.
- Replaced Polymer 1.x/2.x `this.set()` calls with direct property assignments suitable for modern Polymer with TypeScript, ensuring reactivity.
These changes should resolve the TypeScript compilation errors and allow the build process to proceed further.
|
Hi @ubozhestvo, this is a very large contribution. Thanks for the initiative, but we need to better understand it first. Could you share screenshots that clarify what the new user experience is? |
|
I'm also seeing a number of broken tests that will need to pass. |
| } | ||
|
|
||
| @customElement('app-selection-dialog') | ||
| export class AppSelectionDialog extends AppLocalizeBehavior(PolymerElement) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Polymer is deprecated and should not be used for new components. We prefer Lit instead.
| class OutlineServer implements Server { | ||
| errorMessageId?: string; | ||
| private tunnelConfig?: FirstHopAndTunnelConfigJson; | ||
| public allowedApps?: string[]; // Added property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a product question that needs to be resolved: should the list of allowed apps be for the entire app or for the server?
/cc @maddyhof
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've discussed this internally and consulted with our user researcher's insights, and the product recommendation is to do this setting at the app-level, for all servers.
@ubozhestvo can you please share either UI screenshots or at least a step by step description of the user journey that you have in mind. We may need to loop in our UX designer since this has front-end implications. Thanks!
This feature allows you to select specific applications to use the VPN tunnel, while other applications bypass it.
Changes include:
OutlineVpnService.java,VpnTunnel.java,IVpnTunnelService.aidl) to use Android'sVpnService.Builder.addAllowedApplication()method based on a list of package names.OutlinePlugin.java):GET_INSTALLED_APPSaction to retrieve a list of installed applications (name and package name).STARTaction to accept an optional list of allowed application package names.app-selection-dialog) to display installed applications with checkboxes.OutlineServerRepository.app-selection-dialogUI component.If no applications are selected for split-tunneling (the default), all applications will use the VPN tunnel.