aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/app/src/main/java/com/wireguard/config/Interface.java (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Update copyrightJason A. Donenfeld2019-01-071-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Migrate to AndroidXHarsh Shandilya2018-12-181-1/+1
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* Provide semantically meaningful exceptions for translationSamuel Holland2018-12-151-40/+43
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Fix locale usageJason A. Donenfeld2018-12-111-4/+3
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Throw illegalargumentexception instead of nullpointerexception for builder errorsJason A. Donenfeld2018-12-111-1/+4
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Use English lower casingJason A. Donenfeld2018-12-091-1/+2
| | | | | | | 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>
* Remodel the ModelSamuel Holland2018-12-081-316/+266
| | | | | | | | | | | | | | - 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>
* Auto-format the source directoriesSamuel Holland2018-11-111-5/+5
| | | | | | Blame Jason for writing Java in vim. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: update copyright headersJason A. Donenfeld2018-09-061-2/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Extract error messages to string resourcesHarsh Shandilya2018-08-261-2/+6
| | | | | | Useful for validation errors and localisation later on Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* config: show more informative error message on wrong keyJason A. Donenfeld2018-07-271-0/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* config: make loadData privateJason A. Donenfeld2018-07-131-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: Add nullity annotationsEric Kuck2018-07-131-18/+33
| | | | Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
* global: move to Apache 2.0Jason A. Donenfeld2018-07-061-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* TunnelEditor: fix nitsJason A. Donenfeld2018-07-061-0/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* AppListDialogFragment: add implementation for excluding applicationsEric Kuck2018-07-061-0/+44
| | | | Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
* config: Refactor IPCidr and use of InetAddressSamuel Holland2018-06-191-5/+5
| | | | | | | | | 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-55/+60
| | | | | | Address Java and Android lints. Signed-off-by: Samuel Holland <samuel@sholland.org>
* global: Automatic code formattingSamuel Holland2018-04-301-166/+163
| | | | Signed-off-by: Samuel Holland <samuel@sholland.org>
* TunnelEditorFragment: rewrite and simplifyJason A. Donenfeld2018-04-301-47/+41
| | | | | | | 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-3/+3
| | | | | | | | | - 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-61/+130
| | | | | | | | | | | | | | 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-7/+1
| | | | | | | 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-18/+15
| | | | | | | | | 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-64/+119
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Remove sloppy java with enterprise java horrorsJason A. Donenfeld2018-04-171-37/+60
| | | | | | | 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>
* Config: Handle multiple address or dns in config fileAurélien Chabot2018-04-171-2/+16
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Serviceless rewrite, part 1Samuel Holland2018-01-061-37/+9
| | | | Signed-off-by: Samuel Holland <samuel@sholland.org>
* Config/Interface/Peer: Make ParcelableSamuel Holland2017-08-231-2/+44
| | | | | | 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-5/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Config/Interface: Allow copyFrom() to work on nullSamuel Holland2017-08-231-5/+13
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Interface: Rework private key handlingSamuel Holland2017-08-171-11/+17
| | | | | | | 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>
* Major renaming and refactoring in activity and serviceSamuel Holland2017-08-131-3/+29
| | | | | | Apparently "configuration" is the proper term, not "profile". Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Interface: Correctly handle setting a null or empty keySamuel Holland2017-08-091-4/+8
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* KeyEncoding: Clean up and reorganize to match styleSamuel Holland2017-08-091-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Constant time base64Jason A. Donenfeld2017-08-081-1/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Interface: Convert to using Keypair classSamuel Holland2017-08-011-6/+22
| | | | | | | 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>
* Profile: Parse config file to a string per attributeSamuel Holland2017-07-291-0/+99
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>