aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tunnel/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* tunnel: report git commit as wgVersionJason A. Donenfeld2021-02-121-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ToolsInstaller: unbreak cleanupJason A. Donenfeld2020-10-271-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: do not constantly raise toasts when process is opportunistically killedJason A. Donenfeld2020-10-261-2/+5
| | | | | | | | | | | | | | | | | | | | | | Modern Android likes to kill processes to free ram and resources. When kernel-mode WireGuard is in use, this is quite alright with us, since the app doesn't actually need to consume any resources at all in order for the tunnel to run. So, we want to allow and encourage this resource frugality. However, when the quick settings tile is being used or when the app is referenced otherwise, the app will occasionally be restarted, to, for example, repaint the quick settings tile. This is also fine, as the process winds up being short-lived again. But, since process initialization means asking for a new root shell in order to check on kernel-mode WireGuard, this means that Magisk raises a systemwide toast. On some phones, this happens each and every time that the notification shade is pulled down. It's not only annoying but it sometimes obscures other notifications that users want to see, prompting their pulling down of the notification shade in the first place. In order to get rid of this nuisance, just disable these notifications and extraneous logs, so that we don't clutter the system every time that the process is opportunistically killed and restarted. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: clean up some docstring wordingJason A. Donenfeld2020-10-203-3/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Statistics: only do one hash lookupJason A. Donenfeld2020-09-211-4/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* TunnelManager: catch exception in intent receiverJason A. Donenfeld2020-09-211-7/+4
| | | | | | | | | | | | | | | | | | | java.lang.IllegalStateException: at android.app.ContextImpl.startServiceCommon (ContextImpl.java:1720) at android.app.ContextImpl.startService (ContextImpl.java:1675) at android.content.ContextWrapper.startService (ContextWrapper.java:669) at com.wireguard.android.backend.GoBackend.startVpnService (GoBackend.java:4) at com.wireguard.android.backend.GoBackend.setStateInternal (GoBackend.java:4) at com.wireguard.android.backend.GoBackend.setState (GoBackend.java:2) at com.wireguard.android.model.TunnelManager$setTunnelState$2$1.invokeSuspend (TunnelManager.java:6) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (BaseContinuationImpl.java:2) at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.java:2) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely (CoroutineScheduler.java) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask (CoroutineScheduler.java:7) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker (CoroutineScheduler.java:7) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run (CoroutineScheduler.java:7) Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: document more public API from backend packageHarsh Shandilya2020-09-166-1/+174
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* Ed25519: use implementation from TinkJason A. Donenfeld2020-09-163-22/+2513
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* gradle: desugar retrofuture and remove old depsJason A. Donenfeld2020-09-155-19/+11
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: add windows-style killswitch semantics for GoBackendJason A. Donenfeld2020-05-041-1/+12
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ToolsInstaller: update Magisk directoryHarsh Shandilya2020-04-231-6/+6
| | | | | | | | | | /data/adb/modules has been the location for modules since v18.0 and nobody should reasonably be on any older version anymore. This has continued to work for this long because Magisk created symlinks for backwards compat. However, these symlinks are not created anymore on Android 11, which is where this problem first surfaced. Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* tunnel: support IncludedApplications as whitelistJason A. Donenfeld2020-04-053-0/+42
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: hold peers in an ArrayListHarsh Shandilya2020-04-061-3/+1
| | | | | | | A set will cause identical peers to be dropped during save Reported-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* global: cleanup code styleJason A. Donenfeld2020-03-306-18/+27
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: hardcode tags so that minification doesn't ruin the logJason A. Donenfeld2020-03-285-5/+5
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* InetEndpoint: return proper parser exceptionJason A. Donenfeld2020-03-191-1/+1
| | | | | | | Wrapping this in something foreign doesn't make sense. Reported-by: Luis Ressel <aranea@aixah.de> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: Add an initial set of unit testsHarsh Shandilya2020-03-1412-0/+302
| | | | | | | Includes a control set of broken configuration files that we attempt to parse and verify that the parser fails in a predictable and consistent manner. Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* tunnel: Remove MISSING_VALUE from BadConfigException reasonsHarsh Shandilya2020-03-141-1/+0
| | | | | | | This is covered under SYNTAX_ERROR which feels like a reasonable choice, so get rid of this unused field and associated resource string. Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* config: show missing section error correctlyJason A. Donenfeld2020-03-131-1/+3
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: replace CompletableFuture with GhettoCompletableFutureJason A. Donenfeld2020-03-121-2/+33
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: add javadoc supportJason A. Donenfeld2020-03-113-4/+5
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: make use of @RestrictToJason A. Donenfeld2020-03-102-0/+7
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: java access control has important semantic meaningJason A. Donenfeld2020-03-103-3/+3
| | | | | | | It's not right to blindly follow all of AndroidStudio's suggestions, especially for things in tunnel/ which comprise useful API. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: Codestyle cleanupsHarsh Shandilya2020-03-106-37/+33
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ui: Codestyle cleanupsHarsh Shandilya2020-03-101-3/+3
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* global: format codeJason A. Donenfeld2020-03-0911-184/+195
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: optimize importsJason A. Donenfeld2020-03-0915-44/+29
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: get rid of nonnull gradle hackJason A. Donenfeld2020-03-0924-0/+70
| | | | | | | | | | Hacking things up via gradle is not right, and package-info.java poses problems with two modules, so instead we just apply it manually to every class. Remember to add this to new classes! Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* WgQuickBackend: by default use single-tunnel mode like GoBackend, but add optionJason A. Donenfeld2020-03-091-3/+35
| | | | | | | | | Note that this currently doesn't play well with people activating wg-quick tunnels from outside the app. Those tunnels won't be deactivated. But presumably that's desired behavior anyway, considering people are mucking around at the command line. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ModuleLoader: move to right projectJason A. Donenfeld2020-03-091-0/+186
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* AsyncWorker: move back to original locationJason A. Donenfeld2020-03-091-63/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Use AndroidX Nullable annotation everywhereHarsh Shandilya2020-03-091-1/+1
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* Migrate tunnel related classes to tunnel/ Gradle moduleHarsh Shandilya2020-03-0925-0/+3502
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>