Android app whitelist/blacklist feature

Eric Kuck eric at
Tue Jul 3 02:22:41 CEST 2018

Excellent. I unfortunately haven’t done any C programming for almost a
decade and have never done any kind of kernel development, so I’m not going
to be any help adding this functionality to the wg-quick implementation. If
I were to do the work I initially proposed (new fragment + GoBackend
implementation), would this be enough to get merged? If so, would it be
better if I simply disabled the new fragment for custom kernel users or if
I left a placeholder assuming someone else can add the missing

On July 2, 2018 at 4:43:53 PM, Samuel Holland (samuel at wrote:

Hello Eric,

On 07/02/18 15:35, Eric Kuck wrote:
> I’d like to make a contribution to the Android app, but would like to
know if
> this is something that would actually get merged before I go through all
> effort. What I’d like to do is add an exceptions list (apps that will not
> routed through the Wireguard interface). The rationale for this being
> some apps simply don’t work with Wireguard. For example, the use of a
> Wireguard VPN with custom DNS breaks WearOS watches due to Google
> the use of the DNS server. Another example is that Netflix
> work when routed through my VPN server since they know it’s a
> instance, but works fine without the VPN enabled. Another example is that
> there’s often no reason to route data-heavy video apps through your VPN
> server. Rather than turning the VPN on my phone off to use my wearable or
> watch something on my phone, I’d like to be able to opt those apps out of
> using the VPN at all. I’m sure there are many more examples of apps that
> simply don’t need to go through a VPN, as no confidential information is
> passed through them.

This sounds like a generally useful feature.

> My proposal is to add another Fragment that’s just a list of all apps
> installed on the phone with check boxes next to them. If the checkbox is
> checked, that app will be routed through Wireguard. If not, it will be
> to bypass the VPN. Naturally, all apps will be default to being checked.

If you base the UI on DialogPreference or MultiSelectListPreference,
will take care of persisting the setting for you, and it would be easy to
add to
the settings page.

> This is an easy change to make for the GoBackend implementation using
> VpnService.Builder.addDisallowedApplication(<packageName>), but would
> be pretty complicated to add to WgQuickBackend. Perhaps this is something
> that would only be possible for GoBackend users.

For WgQuickBackend, we'd need to modify the set_users function[1] in the
wg-quick "script" to take a dynamic list of user IDs instead of hard coding
PackageManager should provide us the UIDs of other applications. I'm not
the best way to communicate the ID list from the app to the script. Jason,

> Any thoughts on this? I have everything working locally by simply adding
> these two hardcoded lines to
> builder.addDisallowedApplication("");
> builder.addDisallowedApplication("”);
> but I would like to make this more configurable and available to the rest
> Wireguard users if you’re agreeable to it. Thanks.

Thank you,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the WireGuard mailing list