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