summaryrefslogtreecommitdiffhomepage
path: root/app/src/main/java/com/wireguard/config
AgeCommit message (Collapse)Author
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>
2018-04-27Do not do DNS lookups for IPsJason A. Donenfeld
This involves reflection, which is a bummer, but it's better than doing unnecessary DNS lookups. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-27Throw IllegalArgumentExceptions when arguments are badJason A. Donenfeld
This will make the two way data binding crash more, but it will improve the robustness of the config file parser, which deals with exceptions gracefully, and when we move to one way data binding, it will help with that too. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-18More javaficationJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-17Remove sloppy java with enterprise java horrorsJason A. Donenfeld
Since the amount of mind numbing boiler plate has been increased, this must be the proper way to do things. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-04-17Config: Handle multiple address or dns in config fileAurélien Chabot
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-01-17Peer: Add missing @OverrideSamuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2018-01-06Serviceless rewrite, part 1Samuel Holland
Signed-off-by: Samuel Holland <samuel@sholland.org>
2017-11-29Config: use consistant verbJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-26Config: make parsing stricterJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-24Centralize/unify validation of configurationsSamuel Holland
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-24Peer: Add a field for the optional pre-shared keySamuel Holland
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-23Config/Interface/Peer: Make ParcelableSamuel Holland
This allows saving the editor state across restarts. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-23Config/Interface/Peer: Fix some missed change notificationsSamuel Holland
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-23Config/Interface: Allow copyFrom() to work on nullSamuel Holland
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-22Use data binding to provide EditText input filtersSamuel Holland
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-19Peer: Associate with a ConfigSamuel Holland
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-17ConfigEditFragment: Add extremely basic validationSamuel Holland
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-17Interface: Rework private key handlingSamuel Holland
This works much better with a data-bound UI -- no confusing erasing of the text box, and no crashes, either! Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-16Config: add an isPrimary propertySamuel Holland
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-16Config: Make it ComparableSamuel Holland
This will be used for future sorting. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-16Config: Rename function to make databinding happySamuel Holland
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-13Major renaming and refactoring in activity and serviceSamuel Holland
Apparently "configuration" is the proper term, not "profile". Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-13Profile: Add function to copy config from another profileSamuel Holland
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-09Interface: Correctly handle setting a null or empty keySamuel Holland
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-09KeyEncoding: Clean up and reorganize to match styleSamuel Holland
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-08Constant time base64Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-08Profile: Add helper to check name validitySamuel Holland
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-08Profile: Make name modifiableSamuel Holland
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-08-01Interface: Convert to using Keypair classSamuel Holland
This allows retrieving the public key and generating keypairs, both of which will be exposed in the UI. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-07-31Profile: Implement deep copyingSamuel Holland
This is a simple, naive implementation that {,de}serializes the profile's state, but it does not depend on the internal representation of Profile or its contained classes. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-07-31Copyable: New utility interface for deep-copyable classesSamuel Holland
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-07-31Profile: Track connection stateSamuel Holland
Observability is only enabled for isConnected because it is the only mutable property. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-07-29Profile: Add a blank line before each peer sectionSamuel Holland
This is purely a cosmetic change in the generated config files. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-07-29Profile: Parse config file to a string per attributeSamuel Holland
This parser should be able to handle any valid WireGuard or wg-quick configuration file. It separates the file into a single interface object and a peer object for each peer. All "[Interface]" sections in the file are combined into the one object. For now, later lines in a block with the same key overwrite earlier lines. This is only relevant for attributes that are lists, such as Address and AllowedIPs, where additional lines may be expected to append to the list. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-07-29Profile: Add minimal implementationSamuel Holland
This represents a wg-quick profile as two strings: the file name and the file contents. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>