Skip to content
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

Disallow bypass when vpn is lockdown #420

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions Android/app/src/main/java/app/intra/sys/IntraVpnService.java
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,12 @@ public void onRevoke() {
public VpnService.Builder newBuilder() {
VpnService.Builder builder = new VpnService.Builder();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// Some WebRTC apps rely on the ability to bind to specific interfaces, which is only
// possible if we allow bypass.
builder = builder.allowBypass();
// unprivileged apps cannot bind to interfaces outside of the vpn when in lockdown mode
if (!isVpnLockdown()) {
// Some WebRTC apps rely on the ability to bind to specific interfaces, which is only
// possible if we allow bypass.
builder = builder.allowBypass();
}

try {
// Workaround for any app incompatibility bugs.
Expand Down Expand Up @@ -472,4 +475,12 @@ public String getResolvers() {
}
return TextUtils.join(",", ips);
}

private boolean isVpnLockdown() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
return this.isLockdownEnabled();
} else {
return false;
}
}
}