aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/app/src/main/java/com/wireguard/config/Peer.java (follow)
Commit message (Collapse)AuthorAgeFilesLines
* global: move to Apache 2.0Jason A. Donenfeld2018-07-061-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* PeerEditor: add exclude private IPs functionalityJason A. Donenfeld2018-07-061-0/+33
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* config: Refactor IPCidr and use of InetAddressSamuel Holland2018-06-191-4/+4
| | | | | | | | | 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>
* global: fix up copyrightsJason A. Donenfeld2018-05-031-0/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: Add or update copyright headers in Java codeSamuel Holland2018-05-021-0/+5
| | | | Signed-off-by: Samuel Holland <samuel@sholland.org>
* global: Clean up JavaSamuel Holland2018-04-301-43/+51
| | | | | | Address Java and Android lints. Signed-off-by: Samuel Holland <samuel@sholland.org>
* global: Automatic code formattingSamuel Holland2018-04-301-152/+149
| | | | Signed-off-by: Samuel Holland <samuel@sholland.org>
* TunnelEditorFragment: rewrite and simplifyJason A. Donenfeld2018-04-301-45/+37
| | | | | | | This should remove some null pointer dereferences and overall make the thing more robust. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* config: Minor cleanupHarsh Shandilya2018-04-281-4/+11
| | | | | | | | | - 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>
* Use validation instead of two-way bindingJason A. Donenfeld2018-04-281-32/+103
| | | | | | | | | | | | | | 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>
* Do not do DNS lookups for IPsJason A. Donenfeld2018-04-271-2/+0
| | | | | | | 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>
* Throw IllegalArgumentExceptions when arguments are badJason A. Donenfeld2018-04-271-15/+12
| | | | | | | | | 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>
* More javaficationJason A. Donenfeld2018-04-181-43/+111
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Remove sloppy java with enterprise java horrorsJason A. Donenfeld2018-04-171-13/+30
| | | | | | | 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>
* Peer: Add missing @OverrideSamuel Holland2018-01-171-0/+1
| | | | Signed-off-by: Samuel Holland <samuel@sholland.org>
* Serviceless rewrite, part 1Samuel Holland2018-01-061-37/+12
| | | | Signed-off-by: Samuel Holland <samuel@sholland.org>
* Config: make parsing stricterJason A. Donenfeld2017-11-261-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Peer: Add a field for the optional pre-shared keySamuel Holland2017-08-241-0/+20
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Config/Interface/Peer: Make ParcelableSamuel Holland2017-08-231-1/+36
| | | | | | This allows saving the editor state across restarts. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Config/Interface/Peer: Fix some missed change notificationsSamuel Holland2017-08-231-8/+9
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Peer: Associate with a ConfigSamuel Holland2017-08-191-1/+15
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Major renaming and refactoring in activity and serviceSamuel Holland2017-08-131-2/+27
| | | | | | Apparently "configuration" is the proper term, not "profile". Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Profile: Parse config file to a string per attributeSamuel Holland2017-07-291-0/+83
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>