summaryrefslogtreecommitdiffhomepage
path: root/app/src/main/java/com/wireguard/config
AgeCommit message (Collapse)Author
2020-03-09Migrate tunnel related classes to tunnel/ Gradle moduleHarsh Shandilya
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-02-10Attribute: remove need for android TextUtilsJason A. Donenfeld
If this is to be JRE-only, then it doesn't make sense to rely on the android class, especially since this is so trivial to inline. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-02-10InetAddresses: don't have global android importJason A. Donenfeld
This allows a proper fallback on normal JRE. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-10-18InetAddresses: cleanup and implement final fallbackJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-10-12export: use content resolver on android Q+Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-09-30Migrate to Android 10Harsh Shandilya
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2019-09-30InetAddresses: prepare for Android 10's real method supportJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-03-19InetEndpoint: properly match IPv6 addressesJason A. Donenfeld
The old one didn't account for trailing digits. Reported-by: Brandon Jackson <bjackson@napshome.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-01-07Update copyrightJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-18Migrate to AndroidXHarsh Shandilya
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2018-12-15InetEndpoint: disallow huge portsJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-15Provide semantically meaningful exceptions for translationSamuel Holland
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-11Fix locale usageJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-11Throw illegalargumentexception instead of nullpointerexception for builder ↵Jason A. Donenfeld
errors Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-11Lowercase endpoint in exception messageJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-10Do not allow for an empty port in endpointJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-09Use English lower casingJason A. Donenfeld
In Turkish, I becomes ı instead of i, which is a problem when matching things like "AllowedIPs". Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-08Do not close zip input streamJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-08Remodel the ModelSamuel Holland
- The configuration and crypto model is now entirely independent of Android classes other than Nullable and TextUtils. - Model classes are immutable and use builders that enforce the appropriate optional/required attributes. - The Android config proxies (for Parcelable and databinding) are moved to the Android side of the codebase, and are designed to be safe for two-way databinding. This allows proper observability in TunnelDetailFragment. - Various robustness fixes and documentation updates to helper classes. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-11-11Auto-format the source directoriesSamuel Holland
Blame Jason for writing Java in vim. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-01Fix small errorJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-01Peer: prefer v4 endpoints to v6Jason A. Donenfeld
This works around DNS64 XLAT changeovers. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-06global: update copyright headersJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-08-26Supress false-positive DefaultLocale warningsHarsh Shandilya
We decided in 402472237e8f that it's a bad idea for our use-case Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2018-08-26Extract error messages to string resourcesHarsh Shandilya
Useful for validation errors and localisation later on Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2018-08-16config: fix wrong Peer endpoint string formatZhao Gang
When a tunnel is running, saving the tunnel's config with an IPv6 address endpoint like [::1]:42 would result in the wrong format ::1:42. This patch fixes it. For endpoints with an IPv6 address(e.g. [::1]:42). Since the default endpoint InetSocketAddress is created unresolved, getEndpointString() returns "[::1]:42" (InetSocketAddress.getHostString() returns the literal hostname). After the endpoint is resolved, getEndpointString() returns "::1:42" (InetSocketAddress.getHostString() returns the IPv6 address without the square brackets). This inconsistent return values caused the above mentioned bug. With this patch, function getEndpointString would return the right format string whether the endpoint is resolved or not. Signed-off-by: Zhao Gang <gang.zhao.42@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-07-27config: show more informative error message on wrong keyJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-07-25Added QR code scanner as tunnel import methodEric Kuck
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-07-24config: Remove Locale based string formatHarsh Shandilya
The configurations are supposed to be in a very specific format which is not user-facing and hence doesn't have to be adjusted for locale avoiding both the redundancy as well as potential breakages in the configuration file format from different locales. Fixes: 71c67aa24ae2 ("config: Minor cleanup") Reported-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2018-07-16InetAddresses: unwrap reflection exceptionsJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-07-13config: dns servers can be nullJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-07-13config: make loadData privateJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-07-13global: Add nullity annotationsEric Kuck
Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
2018-07-12Version bumpJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-07-12TunnelEditorFragment: add DNSes to allowedIPs when excluding rfc1918Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-07-06global: move to Apache 2.0Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-07-06PeerEditor: add exclude private IPs functionalityJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-07-06TunnelEditor: fix nitsJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-07-06AppListDialogFragment: add implementation for excluding applicationsEric Kuck
Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
2018-06-19config: Refactor IPCidr and use of InetAddressSamuel Holland
Use a canonically-named utility class to tack on methods to the existing InetAddress class. Rename IPCidr to InetNetwork so it better matches InetAddress and is more pronouceable :) While here, simplify the constructor and toString() functions, and properly implement hashCode(). Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-05-09global: Cleanup line lengths and misc lint warningsHarsh Shandilya
I know we decided to ditch the idea of shutting up "Exception thrown with empty param" warnings but this pesters me too much and we can instead just treat this as a weird future proofing thing if and when we end up needing the exception messages. Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2018-05-03config: loosen parser to match realityJason A. Donenfeld
Mid-line comments, mixed case. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-05-03global: fix up copyrightsJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-05-02global: Add or update copyright headers in Java codeSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-04-30global: Clean up JavaSamuel Holland
Address Java and Android lints. Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-04-30global: Automatic code formattingSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-04-30TunnelEditorFragment: rewrite and simplifyJason A. Donenfeld
This should remove some null pointer dereferences and overall make the thing more robust. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-28Allow importing from zip fileJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-28config: Minor cleanupHarsh Shandilya
- Stop implicitly assuming locales in String.format - Cleanup method visibilities - Improve uses of Integer methods - Remove unused getToken method Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2018-04-28Use validation instead of two-way bindingJason A. Donenfeld
This is insane, but it appears to be working. We essentially store things in a separate class for editing, and then commit it back at a given time. This business with onViewStateRestored in both TunnelEditorFragment and in TunnelDetailFragment is buggy and likely wrong. In general TunnelEditorFragment should probably be rewritten. The relationship with the changed name is not clear. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>