feat(android): set search-domain on VPN configuration - #8436
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| }) | ||
| }) | ||
| .transpose()? | ||
| .unwrap_or_default(); |
There was a problem hiding this comment.
Does this return a nullable pointer if None? Otherwise I think this might send an empty string by default which won't be what we want on the other side of the FFI right?
There was a problem hiding this comment.
Yes the default for JString is null.
There was a problem hiding this comment.
I can add a quick unit test for that.
There was a problem hiding this comment.
Nevermind, scratch that - just tested and I think the Option makes it over the FFI. I wouldn't have thought so, quite surprising.
There was a problem hiding this comment.
Nevermind, scratch that - just tested and I think the
Optionmakes it over the FFI. I wouldn't have thought so, quite surprising.
The Option doesn't, the function-signature is still Ljava/lang/String;, so we are passing a String. But everything in Java can be nullable so we are effectively passing null. The Default impl for JString creates a JObject::null, which is why this works.
On Android, we can use
addSearchDomainto configure the search domain list for our VPN tunnel.Thankfully, this gets applied to the system resolver without any other hackery involved (unlike for Apple in #8421), and most apps use the system resolver for queries. The one exception to this are some network utilities like AndroDNS and Fing.
Tested to work fine in Termux using
github.ioas the search domain, which responds to ICMP echoes to any subdomain:Related #8410